From ddce83fdb72bb0bc1b1311cc73d524d8bdb59556 Mon Sep 17 00:00:00 2001 From: mckelvin Date: Tue, 23 Aug 2016 15:09:50 +0800 Subject: [PATCH 1/3] Merge common, func, abstract, stream as pxi to _ta_lib.pyx --- setup.py | 17 +- talib/__init__.py | 21 +- talib/{abstract.pyx => _abstract.pxi} | 21 +- talib/{common.pyx => _common.pxi} | 5 +- talib/{func.pyx => _func.pxi} | 9 +- talib/{stream.pyx => _stream.pxi} | 338 ++++++++++++-------------- talib/{libta_lib.pxd => _ta_lib.pxd} | 0 talib/_ta_lib.pyx | 4 + talib/abstract.py | 25 ++ talib/common.pxd | 2 +- talib/stream.py | 6 + 11 files changed, 229 insertions(+), 219 deletions(-) rename talib/{abstract.pyx => _abstract.pxi} (97%) rename talib/{common.pyx => _common.pxi} (97%) rename talib/{func.pyx => _func.pxi} (99%) rename talib/{stream.pyx => _stream.pxi} (94%) rename talib/{libta_lib.pxd => _ta_lib.pxd} (100%) create mode 100644 talib/_ta_lib.pyx create mode 100644 talib/abstract.py create mode 100644 talib/stream.py diff --git a/setup.py b/setup.py index a43027686..fc10846db 100644 --- a/setup.py +++ b/setup.py @@ -80,16 +80,15 @@ if has_cython: cmdclass['build_ext'] = build_ext -ext_modules = [] -for name in ['common', 'func', 'abstract', 'stream']: - ext = Extension( - 'talib.%s' % name, - [('talib/%s.pyx' if has_cython else 'talib/%s.c') % name], - include_dirs = include_dirs, - library_dirs = lib_talib_dirs, - libraries = [lib_talib_name] +ext_modules = [ + Extension( + 'talib._ta_lib', + ['talib/_ta_lib.pyx' if has_cython else 'talib/_ta_lib.c'], + include_dirs=include_dirs, + library_dirs=lib_talib_dirs, + libraries=[lib_talib_name] ) - ext_modules.append(ext) +] setup( name = 'TA-Lib', diff --git a/talib/__init__.py b/talib/__init__.py index 430be4f69..e2d2bfd41 100644 --- a/talib/__init__.py +++ b/talib/__init__.py @@ -1,13 +1,16 @@ import atexit -from . import common -from . import abstract -from . import stream -from .common import MA_Type, __ta_version__ -from .common import _ta_set_unstable_period as set_unstable_period -from .common import _ta_get_unstable_period as get_unstable_period -from .func import * +from ._ta_lib import ( + _ta_initialize, _ta_shutdown, MA_Type, __ta_version__, + _ta_set_unstable_period as set_unstable_period, + _ta_get_unstable_period as get_unstable_period, + __TA_FUNCTION_NAMES__ +) + +func = __import__("_ta_lib", globals(), locals(), __TA_FUNCTION_NAMES__, level=1) +for func_name in __TA_FUNCTION_NAMES__: + globals()[func_name] = getattr(func, func_name) __version__ = '0.4.10' @@ -18,8 +21,8 @@ # functions are called. Finally, when the python process exits, we shutdown # the underlying TA-Lib. -common._ta_initialize() -atexit.register(common._ta_shutdown) +_ta_initialize() +atexit.register(_ta_shutdown) __function_groups__ = { 'Cycle Indicators': [ diff --git a/talib/abstract.pyx b/talib/_abstract.pxi similarity index 97% rename from talib/abstract.pyx rename to talib/_abstract.pxi index c7e801a67..1d27a6a7e 100644 --- a/talib/abstract.pyx +++ b/talib/_abstract.pxi @@ -2,9 +2,6 @@ This file Copyright (c) 2013 Brian A Cappello ''' import math - -from . import func as func_c -from .common import _ta_check_success, MA_Type try: from collections import OrderedDict except ImportError: # handle python 2.6 and earlier @@ -14,11 +11,11 @@ import numpy import sys cimport numpy as np -cimport libta_lib as lib +cimport _ta_lib as lib +# NOTE: _ta_check_success, MA_Type is defined in _common.pxi lib.TA_Initialize() -__FUNCTION_NAMES = set(func_c.__all__) __INPUT_ARRAYS_DEFAULTS = {'open': None, 'high': None, @@ -90,11 +87,9 @@ class Function(object): - FunctionInstance([input_arrays,] [param_args_andor_kwargs]) # calls set_function_args and returns self.outputs """ - def __init__(self, function_name, *args, **kwargs): + def __init__(self, function_name, func_object, *args, **kwargs): # make sure the function_name is valid and define all of our variables self.__name = function_name.upper() - if self.__name not in __FUNCTION_NAMES: - raise Exception('%s not supported by TA-LIB.' % self.__name) self.__namestr = self.__name self.__name = str2bytes(self.__name) self.__info = None @@ -109,6 +104,7 @@ class Function(object): # finish initializing: query the TALIB abstract interface and set arguments self.__initialize_function_info() self.set_function_args(*args, **kwargs) + self.func_object = func_object def __initialize_function_info(self): # function info @@ -386,7 +382,7 @@ class Function(object): args.append(value) # Use the func module to actually call the function. - results = func_c.__getattribute__(self.__namestr)(*args) + results = self.func_object(*args) if isinstance(results, np.ndarray): keys = self.__outputs.keys() if not isinstance(keys, list): @@ -682,10 +678,3 @@ cdef int __ta_getLookback(lib.TA_ParamHolder *holder): retCode = lib.TA_GetLookback(holder, &lookback) _ta_check_success('TA_GetLookback', retCode) return lookback - -# Configure all the available TA-Lib functions to be exported as -# an abstract function wrapper for convenient import. -for name in __FUNCTION_NAMES: - exec "%s = Function('%s')" % (name, name) - -__all__ = ['Function'] + list(__FUNCTION_NAMES) diff --git a/talib/common.pyx b/talib/_common.pxi similarity index 97% rename from talib/common.pyx rename to talib/_common.pxi index 0a2fc67dc..b5ce392d1 100644 --- a/talib/common.pyx +++ b/talib/_common.pxi @@ -1,6 +1,5 @@ - -cimport libta_lib as lib -from libta_lib cimport TA_RetCode, TA_FuncUnstId +cimport _ta_lib as lib +from _ta_lib cimport TA_RetCode, TA_FuncUnstId __ta_version__ = lib.TA_GetVersionString() diff --git a/talib/func.pyx b/talib/_func.pxi similarity index 99% rename from talib/func.pyx rename to talib/_func.pxi index 253e64a3b..29b59ede3 100644 --- a/talib/func.pyx +++ b/talib/_func.pxi @@ -2,7 +2,7 @@ cimport numpy as np from numpy import nan from cython import boundscheck, wraparound -from .common cimport _ta_check_success +# _ta_check_success: defined in _common.pxi cdef double NaN = nan @@ -14,10 +14,9 @@ cdef extern from "numpy/arrayobject.h": np.import_array() # Initialize the NumPy C API -cimport libta_lib as lib -from libta_lib cimport TA_RetCode +cimport _ta_lib as lib +from _ta_lib cimport TA_RetCode -lib.TA_Initialize() @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function @@ -11243,4 +11242,4 @@ def WMA( np.ndarray real not None , int timeperiod=-2**31 ): _ta_check_success("TA_WMA", retCode) return outreal -__all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] +__TA_FUNCTION_NAMES__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] diff --git a/talib/stream.pyx b/talib/_stream.pxi similarity index 94% rename from talib/stream.pyx rename to talib/_stream.pxi index 3d968c141..e3f606448 100644 --- a/talib/stream.pyx +++ b/talib/_stream.pxi @@ -1,27 +1,14 @@ cimport numpy as np -from numpy import nan from cython import boundscheck, wraparound +cimport _ta_lib as lib +from _ta_lib cimport TA_RetCode +# NOTE: _ta_check_success, NaN are defined in common.pxi +# NumPy C API is initialize in _func.pxi -from .common cimport _ta_check_success - -cdef double NaN = nan - -cdef extern from "numpy/arrayobject.h": - int PyArray_TYPE(np.ndarray) - object PyArray_EMPTY(int, np.npy_intp*, int, int) - int PyArray_FLAGS(np.ndarray) - object PyArray_GETCONTIGUOUS(np.ndarray) - -np.import_array() # Initialize the NumPy C API - -cimport libta_lib as lib -from libta_lib cimport TA_RetCode - -lib.TA_Initialize() @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ACOS( np.ndarray real not None ): +def stream_ACOS( np.ndarray real not None ): """ ACOS(real) Vector Trigonometric ACos (Math Transform) @@ -55,7 +42,7 @@ def ACOS( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): +def stream_AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): """ AD(high, low, close, volume) Chaikin A/D Line (Volume Indicators) @@ -119,7 +106,7 @@ def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close no @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): +def stream_ADD( np.ndarray real0 not None , np.ndarray real1 not None ): """ ADD(real0, real1) Vector Arithmetic Add (Math Operators) @@ -164,7 +151,7 @@ def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): +def stream_ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) Chaikin A/D Oscillator (Volume Indicators) @@ -231,7 +218,7 @@ def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ ADX(high, low, close[, timeperiod=?]) Average Directional Movement Index (Momentum Indicators) @@ -287,7 +274,7 @@ def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ ADXR(high, low, close[, timeperiod=?]) Average Directional Movement Index Rating (Momentum Indicators) @@ -343,7 +330,7 @@ def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): +def stream_APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) Absolute Price Oscillator (Momentum Indicators) @@ -381,7 +368,7 @@ def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**3 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): +def stream_AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): """ AROON(high, low[, timeperiod=?]) Aroon (Momentum Indicators) @@ -430,7 +417,7 @@ def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=- @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): +def stream_AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): """ AROONOSC(high, low[, timeperiod=?]) Aroon Oscillator (Momentum Indicators) @@ -476,7 +463,7 @@ def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperio @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ASIN( np.ndarray real not None ): +def stream_ASIN( np.ndarray real not None ): """ ASIN(real) Vector Trigonometric ASin (Math Transform) @@ -510,7 +497,7 @@ def ASIN( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ATAN( np.ndarray real not None ): +def stream_ATAN( np.ndarray real not None ): """ ATAN(real) Vector Trigonometric ATan (Math Transform) @@ -544,7 +531,7 @@ def ATAN( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ ATR(high, low, close[, timeperiod=?]) Average True Range (Volatility Indicators) @@ -600,7 +587,7 @@ def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ AVGPRICE(open, high, low, close) Average Price (Price Transform) @@ -664,7 +651,7 @@ def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray l @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): +def stream_BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) Bollinger Bands (Overlap Studies) @@ -709,7 +696,7 @@ def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): +def stream_BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): """ BETA(real0, real1[, timeperiod=?]) Beta (Statistic Functions) @@ -756,7 +743,7 @@ def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ BOP(open, high, low, close) Balance Of Power (Momentum Indicators) @@ -820,7 +807,7 @@ def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low no @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ CCI(high, low, close[, timeperiod=?]) Commodity Channel Index (Momentum Indicators) @@ -876,7 +863,7 @@ def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL2CROWS(open, high, low, close) Two Crows (Pattern Recognition) @@ -940,7 +927,7 @@ def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3BLACKCROWS(open, high, low, close) Three Black Crows (Pattern Recognition) @@ -1004,7 +991,7 @@ def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3INSIDE(open, high, low, close) Three Inside Up/Down (Pattern Recognition) @@ -1068,7 +1055,7 @@ def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3LINESTRIKE(open, high, low, close) Three-Line Strike (Pattern Recognition) @@ -1132,7 +1119,7 @@ def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3OUTSIDE(open, high, low, close) Three Outside Up/Down (Pattern Recognition) @@ -1196,7 +1183,7 @@ def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3STARSINSOUTH(open, high, low, close) Three Stars In The South (Pattern Recognition) @@ -1260,7 +1247,7 @@ def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDL3WHITESOLDIERS(open, high, low, close) Three Advancing White Soldiers (Pattern Recognition) @@ -1324,7 +1311,7 @@ def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): +def stream_CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) Abandoned Baby (Pattern Recognition) @@ -1390,7 +1377,7 @@ def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLADVANCEBLOCK(open, high, low, close) Advance Block (Pattern Recognition) @@ -1454,7 +1441,7 @@ def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.nd @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLBELTHOLD(open, high, low, close) Belt-hold (Pattern Recognition) @@ -1518,7 +1505,7 @@ def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLBREAKAWAY(open, high, low, close) Breakaway (Pattern Recognition) @@ -1582,7 +1569,7 @@ def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarr @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLCLOSINGMARUBOZU(open, high, low, close) Closing Marubozu (Pattern Recognition) @@ -1646,7 +1633,7 @@ def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLCONCEALBABYSWALL(open, high, low, close) Concealing Baby Swallow (Pattern Recognition) @@ -1710,7 +1697,7 @@ def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLCOUNTERATTACK(open, high, low, close) Counterattack (Pattern Recognition) @@ -1774,7 +1761,7 @@ def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): +def stream_CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) Dark Cloud Cover (Pattern Recognition) @@ -1840,7 +1827,7 @@ def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLDOJI(open, high, low, close) Doji (Pattern Recognition) @@ -1904,7 +1891,7 @@ def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray lo @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLDOJISTAR(open, high, low, close) Doji Star (Pattern Recognition) @@ -1968,7 +1955,7 @@ def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLDRAGONFLYDOJI(open, high, low, close) Dragonfly Doji (Pattern Recognition) @@ -2032,7 +2019,7 @@ def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLENGULFING(open, high, low, close) Engulfing Pattern (Pattern Recognition) @@ -2096,7 +2083,7 @@ def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarr @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): +def stream_CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) Evening Doji Star (Pattern Recognition) @@ -2162,7 +2149,7 @@ def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): +def stream_CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) Evening Star (Pattern Recognition) @@ -2228,7 +2215,7 @@ def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLGAPSIDESIDEWHITE(open, high, low, close) Up/Down-gap side-by-side white lines (Pattern Recognition) @@ -2292,7 +2279,7 @@ def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLGRAVESTONEDOJI(open, high, low, close) Gravestone Doji (Pattern Recognition) @@ -2356,7 +2343,7 @@ def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHAMMER(open, high, low, close) Hammer (Pattern Recognition) @@ -2420,7 +2407,7 @@ def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHANGINGMAN(open, high, low, close) Hanging Man (Pattern Recognition) @@ -2484,7 +2471,7 @@ def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndar @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHARAMI(open, high, low, close) Harami Pattern (Pattern Recognition) @@ -2548,7 +2535,7 @@ def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHARAMICROSS(open, high, low, close) Harami Cross Pattern (Pattern Recognition) @@ -2612,7 +2599,7 @@ def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHIGHWAVE(open, high, low, close) High-Wave Candle (Pattern Recognition) @@ -2676,7 +2663,7 @@ def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHIKKAKE(open, high, low, close) Hikkake Pattern (Pattern Recognition) @@ -2740,7 +2727,7 @@ def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHIKKAKEMOD(open, high, low, close) Modified Hikkake Pattern (Pattern Recognition) @@ -2804,7 +2791,7 @@ def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndar @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLHOMINGPIGEON(open, high, low, close) Homing Pigeon (Pattern Recognition) @@ -2868,7 +2855,7 @@ def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.nd @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLIDENTICAL3CROWS(open, high, low, close) Identical Three Crows (Pattern Recognition) @@ -2932,7 +2919,7 @@ def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLINNECK(open, high, low, close) In-Neck Pattern (Pattern Recognition) @@ -2996,7 +2983,7 @@ def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLINVERTEDHAMMER(open, high, low, close) Inverted Hammer (Pattern Recognition) @@ -3060,7 +3047,7 @@ def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLKICKING(open, high, low, close) Kicking (Pattern Recognition) @@ -3124,7 +3111,7 @@ def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLKICKINGBYLENGTH(open, high, low, close) Kicking - bull/bear determined by the longer marubozu (Pattern Recognition) @@ -3188,7 +3175,7 @@ def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLLADDERBOTTOM(open, high, low, close) Ladder Bottom (Pattern Recognition) @@ -3252,7 +3239,7 @@ def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.nd @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLLONGLEGGEDDOJI(open, high, low, close) Long Legged Doji (Pattern Recognition) @@ -3316,7 +3303,7 @@ def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLLONGLINE(open, high, low, close) Long Line Candle (Pattern Recognition) @@ -3380,7 +3367,7 @@ def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLMARUBOZU(open, high, low, close) Marubozu (Pattern Recognition) @@ -3444,7 +3431,7 @@ def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLMATCHINGLOW(open, high, low, close) Matching Low (Pattern Recognition) @@ -3508,7 +3495,7 @@ def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): +def stream_CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): """ CDLMATHOLD(open, high, low, close[, penetration=?]) Mat Hold (Pattern Recognition) @@ -3574,7 +3561,7 @@ def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): +def stream_CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) Morning Doji Star (Pattern Recognition) @@ -3640,7 +3627,7 @@ def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): +def stream_CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) Morning Star (Pattern Recognition) @@ -3706,7 +3693,7 @@ def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLONNECK(open, high, low, close) On-Neck Pattern (Pattern Recognition) @@ -3770,7 +3757,7 @@ def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLPIERCING(open, high, low, close) Piercing Pattern (Pattern Recognition) @@ -3834,7 +3821,7 @@ def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarra @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLRICKSHAWMAN(open, high, low, close) Rickshaw Man (Pattern Recognition) @@ -3898,7 +3885,7 @@ def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLRISEFALL3METHODS(open, high, low, close) Rising/Falling Three Methods (Pattern Recognition) @@ -3962,7 +3949,7 @@ def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSEPARATINGLINES(open, high, low, close) Separating Lines (Pattern Recognition) @@ -4026,7 +4013,7 @@ def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSHOOTINGSTAR(open, high, low, close) Shooting Star (Pattern Recognition) @@ -4090,7 +4077,7 @@ def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.nd @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSHORTLINE(open, high, low, close) Short Line Candle (Pattern Recognition) @@ -4154,7 +4141,7 @@ def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarr @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSPINNINGTOP(open, high, low, close) Spinning Top (Pattern Recognition) @@ -4218,7 +4205,7 @@ def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.nda @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSTALLEDPATTERN(open, high, low, close) Stalled Pattern (Pattern Recognition) @@ -4282,7 +4269,7 @@ def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np. @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLSTICKSANDWICH(open, high, low, close) Stick Sandwich (Pattern Recognition) @@ -4346,7 +4333,7 @@ def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLTAKURI(open, high, low, close) Takuri (Dragonfly Doji with very long lower shadow) (Pattern Recognition) @@ -4410,7 +4397,7 @@ def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLTASUKIGAP(open, high, low, close) Tasuki Gap (Pattern Recognition) @@ -4474,7 +4461,7 @@ def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarr @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLTHRUSTING(open, high, low, close) Thrusting Pattern (Pattern Recognition) @@ -4538,7 +4525,7 @@ def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarr @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLTRISTAR(open, high, low, close) Tristar Pattern (Pattern Recognition) @@ -4602,7 +4589,7 @@ def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLUNIQUE3RIVER(open, high, low, close) Unique 3 River (Pattern Recognition) @@ -4666,7 +4653,7 @@ def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.nd @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLUPSIDEGAP2CROWS(open, high, low, close) Upside Gap Two Crows (Pattern Recognition) @@ -4730,7 +4717,7 @@ def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ CDLXSIDEGAP3METHODS(open, high, low, close) Upside/Downside Gap Three Methods (Pattern Recognition) @@ -4794,7 +4781,7 @@ def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CEIL( np.ndarray real not None ): +def stream_CEIL( np.ndarray real not None ): """ CEIL(real) Vector Ceil (Math Transform) @@ -4828,7 +4815,7 @@ def CEIL( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CMO( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_CMO( np.ndarray real not None , int timeperiod=-2**31 ): """ CMO(real[, timeperiod=?]) Chande Momentum Oscillator (Momentum Indicators) @@ -4864,7 +4851,7 @@ def CMO( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): +def stream_CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): """ CORREL(real0, real1[, timeperiod=?]) Pearson's Correlation Coefficient (r) (Statistic Functions) @@ -4911,7 +4898,7 @@ def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperi @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def COS( np.ndarray real not None ): +def stream_COS( np.ndarray real not None ): """ COS(real) Vector Trigonometric Cos (Math Transform) @@ -4945,7 +4932,7 @@ def COS( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def COSH( np.ndarray real not None ): +def stream_COSH( np.ndarray real not None ): """ COSH(real) Vector Trigonometric Cosh (Math Transform) @@ -4979,7 +4966,7 @@ def COSH( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_DEMA( np.ndarray real not None , int timeperiod=-2**31 ): """ DEMA(real[, timeperiod=?]) Double Exponential Moving Average (Overlap Studies) @@ -5015,7 +5002,7 @@ def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): +def stream_DIV( np.ndarray real0 not None , np.ndarray real1 not None ): """ DIV(real0, real1) Vector Arithmetic Div (Math Operators) @@ -5060,7 +5047,7 @@ def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ DX(high, low, close[, timeperiod=?]) Directional Movement Index (Momentum Indicators) @@ -5116,7 +5103,7 @@ def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close no @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def EMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_EMA( np.ndarray real not None , int timeperiod=-2**31 ): """ EMA(real[, timeperiod=?]) Exponential Moving Average (Overlap Studies) @@ -5152,7 +5139,7 @@ def EMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def EXP( np.ndarray real not None ): +def stream_EXP( np.ndarray real not None ): """ EXP(real) Vector Arithmetic Exp (Math Transform) @@ -5186,7 +5173,7 @@ def EXP( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def FLOOR( np.ndarray real not None ): +def stream_FLOOR( np.ndarray real not None ): """ FLOOR(real) Vector Floor (Math Transform) @@ -5220,7 +5207,7 @@ def FLOOR( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_DCPERIOD( np.ndarray real not None ): +def stream_HT_DCPERIOD( np.ndarray real not None ): """ HT_DCPERIOD(real) Hilbert Transform - Dominant Cycle Period (Cycle Indicators) @@ -5254,7 +5241,7 @@ def HT_DCPERIOD( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_DCPHASE( np.ndarray real not None ): +def stream_HT_DCPHASE( np.ndarray real not None ): """ HT_DCPHASE(real) Hilbert Transform - Dominant Cycle Phase (Cycle Indicators) @@ -5288,7 +5275,7 @@ def HT_DCPHASE( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_PHASOR( np.ndarray real not None ): +def stream_HT_PHASOR( np.ndarray real not None ): """ HT_PHASOR(real) Hilbert Transform - Phasor Components (Cycle Indicators) @@ -5325,7 +5312,7 @@ def HT_PHASOR( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_SINE( np.ndarray real not None ): +def stream_HT_SINE( np.ndarray real not None ): """ HT_SINE(real) Hilbert Transform - SineWave (Cycle Indicators) @@ -5362,7 +5349,7 @@ def HT_SINE( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_TRENDLINE( np.ndarray real not None ): +def stream_HT_TRENDLINE( np.ndarray real not None ): """ HT_TRENDLINE(real) Hilbert Transform - Instantaneous Trendline (Overlap Studies) @@ -5396,7 +5383,7 @@ def HT_TRENDLINE( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def HT_TRENDMODE( np.ndarray real not None ): +def stream_HT_TRENDMODE( np.ndarray real not None ): """ HT_TRENDMODE(real) Hilbert Transform - Trend vs Cycle Mode (Cycle Indicators) @@ -5430,7 +5417,7 @@ def HT_TRENDMODE( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_KAMA( np.ndarray real not None , int timeperiod=-2**31 ): """ KAMA(real[, timeperiod=?]) Kaufman Adaptive Moving Average (Overlap Studies) @@ -5466,7 +5453,7 @@ def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): """ LINEARREG(real[, timeperiod=?]) Linear Regression (Statistic Functions) @@ -5502,7 +5489,7 @@ def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): """ LINEARREG_ANGLE(real[, timeperiod=?]) Linear Regression Angle (Statistic Functions) @@ -5538,7 +5525,7 @@ def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): """ LINEARREG_INTERCEPT(real[, timeperiod=?]) Linear Regression Intercept (Statistic Functions) @@ -5574,7 +5561,7 @@ def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): """ LINEARREG_SLOPE(real[, timeperiod=?]) Linear Regression Slope (Statistic Functions) @@ -5610,7 +5597,7 @@ def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LN( np.ndarray real not None ): +def stream_LN( np.ndarray real not None ): """ LN(real) Vector Log Natural (Math Transform) @@ -5644,7 +5631,7 @@ def LN( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def LOG10( np.ndarray real not None ): +def stream_LOG10( np.ndarray real not None ): """ LOG10(real) Vector Log10 (Math Transform) @@ -5678,7 +5665,7 @@ def LOG10( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): +def stream_MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): """ MA(real[, timeperiod=?, matype=?]) Moving average (Overlap Studies) @@ -5715,7 +5702,7 @@ def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): +def stream_MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) Moving Average Convergence/Divergence (Momentum Indicators) @@ -5759,7 +5746,7 @@ def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2** @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): +def stream_MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) MACD with controllable MA type (Momentum Indicators) @@ -5806,7 +5793,7 @@ def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): +def stream_MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): """ MACDFIX(real[, signalperiod=?]) Moving Average Convergence/Divergence Fix 12/26 (Momentum Indicators) @@ -5848,7 +5835,7 @@ def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): +def stream_MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): """ MAMA(real[, fastlimit=?, slowlimit=?]) MESA Adaptive Moving Average (Overlap Studies) @@ -5888,7 +5875,7 @@ def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=- @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): +def stream_MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) Moving average with variable period (Overlap Studies) @@ -5937,7 +5924,7 @@ def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MAX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MAX( np.ndarray real not None , int timeperiod=-2**31 ): """ MAX(real[, timeperiod=?]) Highest value over a specified period (Math Operators) @@ -5973,7 +5960,7 @@ def MAX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): """ MAXINDEX(real[, timeperiod=?]) Index of highest value over a specified period (Math Operators) @@ -6009,7 +5996,7 @@ def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): +def stream_MEDPRICE( np.ndarray high not None , np.ndarray low not None ): """ MEDPRICE(high, low) Median Price (Price Transform) @@ -6053,7 +6040,7 @@ def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): +def stream_MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): """ MFI(high, low, close, volume[, timeperiod=?]) Money Flow Index (Momentum Indicators) @@ -6119,7 +6106,7 @@ def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close n @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): """ MIDPOINT(real[, timeperiod=?]) MidPoint over period (Overlap Studies) @@ -6155,7 +6142,7 @@ def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): +def stream_MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): """ MIDPRICE(high, low[, timeperiod=?]) Midpoint Price over period (Overlap Studies) @@ -6201,7 +6188,7 @@ def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperio @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MIN( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MIN( np.ndarray real not None , int timeperiod=-2**31 ): """ MIN(real[, timeperiod=?]) Lowest value over a specified period (Math Operators) @@ -6237,7 +6224,7 @@ def MIN( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): """ MININDEX(real[, timeperiod=?]) Index of lowest value over a specified period (Math Operators) @@ -6273,7 +6260,7 @@ def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): """ MINMAX(real[, timeperiod=?]) Lowest and highest values over a specified period (Math Operators) @@ -6312,7 +6299,7 @@ def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): """ MINMAXINDEX(real[, timeperiod=?]) Indexes of lowest and highest values over a specified period (Math Operators) @@ -6351,7 +6338,7 @@ def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ MINUS_DI(high, low, close[, timeperiod=?]) Minus Directional Indicator (Momentum Indicators) @@ -6407,7 +6394,7 @@ def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray cl @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): +def stream_MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): """ MINUS_DM(high, low[, timeperiod=?]) Minus Directional Movement (Momentum Indicators) @@ -6453,7 +6440,7 @@ def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperio @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MOM( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_MOM( np.ndarray real not None , int timeperiod=-2**31 ): """ MOM(real[, timeperiod=?]) Momentum (Momentum Indicators) @@ -6489,7 +6476,7 @@ def MOM( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): +def stream_MULT( np.ndarray real0 not None , np.ndarray real1 not None ): """ MULT(real0, real1) Vector Arithmetic Mult (Math Operators) @@ -6534,7 +6521,7 @@ def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ NATR(high, low, close[, timeperiod=?]) Normalized Average True Range (Volatility Indicators) @@ -6590,7 +6577,7 @@ def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def OBV( np.ndarray real not None , np.ndarray volume not None ): +def stream_OBV( np.ndarray real not None , np.ndarray volume not None ): """ OBV(real, volume) On Balance Volume (Volume Indicators) @@ -6635,7 +6622,7 @@ def OBV( np.ndarray real not None , np.ndarray volume not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ PLUS_DI(high, low, close[, timeperiod=?]) Plus Directional Indicator (Momentum Indicators) @@ -6691,7 +6678,7 @@ def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray clo @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): +def stream_PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): """ PLUS_DM(high, low[, timeperiod=?]) Plus Directional Movement (Momentum Indicators) @@ -6737,7 +6724,7 @@ def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): +def stream_PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) Percentage Price Oscillator (Momentum Indicators) @@ -6775,7 +6762,7 @@ def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**3 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ROC( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_ROC( np.ndarray real not None , int timeperiod=-2**31 ): """ ROC(real[, timeperiod=?]) Rate of change : ((real/prevPrice)-1)*100 (Momentum Indicators) @@ -6811,7 +6798,7 @@ def ROC( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_ROCP( np.ndarray real not None , int timeperiod=-2**31 ): """ ROCP(real[, timeperiod=?]) Rate of change Percentage: (real-prevPrice)/prevPrice (Momentum Indicators) @@ -6847,7 +6834,7 @@ def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_ROCR( np.ndarray real not None , int timeperiod=-2**31 ): """ ROCR(real[, timeperiod=?]) Rate of change ratio: (real/prevPrice) (Momentum Indicators) @@ -6883,7 +6870,7 @@ def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): """ ROCR100(real[, timeperiod=?]) Rate of change ratio 100 scale: (real/prevPrice)*100 (Momentum Indicators) @@ -6919,7 +6906,7 @@ def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def RSI( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_RSI( np.ndarray real not None , int timeperiod=-2**31 ): """ RSI(real[, timeperiod=?]) Relative Strength Index (Momentum Indicators) @@ -6955,7 +6942,7 @@ def RSI( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): +def stream_SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): """ SAR(high, low[, acceleration=?, maximum=?]) Parabolic SAR (Overlap Studies) @@ -7002,7 +6989,7 @@ def SAR( np.ndarray high not None , np.ndarray low not None , double acceleratio @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): +def stream_SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) Parabolic SAR - Extended (Overlap Studies) @@ -7055,7 +7042,7 @@ def SAREXT( np.ndarray high not None , np.ndarray low not None , double startval @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SIN( np.ndarray real not None ): +def stream_SIN( np.ndarray real not None ): """ SIN(real) Vector Trigonometric Sin (Math Transform) @@ -7089,7 +7076,7 @@ def SIN( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SINH( np.ndarray real not None ): +def stream_SINH( np.ndarray real not None ): """ SINH(real) Vector Trigonometric Sinh (Math Transform) @@ -7123,7 +7110,7 @@ def SINH( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_SMA( np.ndarray real not None , int timeperiod=-2**31 ): """ SMA(real[, timeperiod=?]) Simple Moving Average (Overlap Studies) @@ -7159,7 +7146,7 @@ def SMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SQRT( np.ndarray real not None ): +def stream_SQRT( np.ndarray real not None ): """ SQRT(real) Vector Square Root (Math Transform) @@ -7193,7 +7180,7 @@ def SQRT( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): +def stream_STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): """ STDDEV(real[, timeperiod=?, nbdev=?]) Standard Deviation (Statistic Functions) @@ -7230,7 +7217,7 @@ def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e3 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): +def stream_STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) Stochastic (Momentum Indicators) @@ -7293,7 +7280,7 @@ def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): +def stream_STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) Stochastic Fast (Momentum Indicators) @@ -7354,7 +7341,7 @@ def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray clos @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): +def stream_STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) Stochastic Relative Strength Index (Momentum Indicators) @@ -7396,7 +7383,7 @@ def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_perio @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): +def stream_SUB( np.ndarray real0 not None , np.ndarray real1 not None ): """ SUB(real0, real1) Vector Arithmetic Substraction (Math Operators) @@ -7441,7 +7428,7 @@ def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def SUM( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_SUM( np.ndarray real not None , int timeperiod=-2**31 ): """ SUM(real[, timeperiod=?]) Summation (Math Operators) @@ -7477,7 +7464,7 @@ def SUM( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): +def stream_T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): """ T3(real[, timeperiod=?, vfactor=?]) Triple Exponential Moving Average (T3) (Overlap Studies) @@ -7514,7 +7501,7 @@ def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TAN( np.ndarray real not None ): +def stream_TAN( np.ndarray real not None ): """ TAN(real) Vector Trigonometric Tan (Math Transform) @@ -7548,7 +7535,7 @@ def TAN( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TANH( np.ndarray real not None ): +def stream_TANH( np.ndarray real not None ): """ TANH(real) Vector Trigonometric Tanh (Math Transform) @@ -7582,7 +7569,7 @@ def TANH( np.ndarray real not None ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_TEMA( np.ndarray real not None , int timeperiod=-2**31 ): """ TEMA(real[, timeperiod=?]) Triple Exponential Moving Average (Overlap Studies) @@ -7618,7 +7605,7 @@ def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ TRANGE(high, low, close) True Range (Volatility Indicators) @@ -7672,7 +7659,7 @@ def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray clos @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): """ TRIMA(real[, timeperiod=?]) Triangular Moving Average (Overlap Studies) @@ -7708,7 +7695,7 @@ def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_TRIX( np.ndarray real not None , int timeperiod=-2**31 ): """ TRIX(real[, timeperiod=?]) 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (Momentum Indicators) @@ -7744,7 +7731,7 @@ def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TSF( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_TSF( np.ndarray real not None , int timeperiod=-2**31 ): """ TSF(real[, timeperiod=?]) Time Series Forecast (Statistic Functions) @@ -7780,7 +7767,7 @@ def TSF( np.ndarray real not None , int timeperiod=-2**31 ): @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ TYPPRICE(high, low, close) Typical Price (Price Transform) @@ -7834,7 +7821,7 @@ def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray cl @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): +def stream_ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) Ultimate Oscillator (Momentum Indicators) @@ -7892,7 +7879,7 @@ def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray clos @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): +def stream_VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): """ VAR(real[, timeperiod=?, nbdev=?]) Variance (Statistic Functions) @@ -7929,7 +7916,7 @@ def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ) @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): +def stream_WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): """ WCLPRICE(high, low, close) Weighted Close Price (Price Transform) @@ -7983,7 +7970,7 @@ def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray cl @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): +def stream_WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): """ WILLR(high, low, close[, timeperiod=?]) Williams' %R (Momentum Indicators) @@ -8039,7 +8026,7 @@ def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close @wraparound(False) # turn off relative indexing from end of lists @boundscheck(False) # turn off bounds-checking for entire function -def WMA( np.ndarray real not None , int timeperiod=-2**31 ): +def stream_WMA( np.ndarray real not None , int timeperiod=-2**31 ): """ WMA(real[, timeperiod=?]) Weighted Moving Average (Overlap Studies) @@ -8073,4 +8060,3 @@ def WMA( np.ndarray real not None , int timeperiod=-2**31 ): _ta_check_success("TA_WMA", retCode) return outreal -__all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] diff --git a/talib/libta_lib.pxd b/talib/_ta_lib.pxd similarity index 100% rename from talib/libta_lib.pxd rename to talib/_ta_lib.pxd diff --git a/talib/_ta_lib.pyx b/talib/_ta_lib.pyx new file mode 100644 index 000000000..3bb1a994b --- /dev/null +++ b/talib/_ta_lib.pyx @@ -0,0 +1,4 @@ +include "_common.pxi" +include "_func.pxi" +include "_abstract.pxi" +include "_stream.pxi" diff --git a/talib/abstract.py b/talib/abstract.py new file mode 100644 index 000000000..5ab26d37b --- /dev/null +++ b/talib/abstract.py @@ -0,0 +1,25 @@ +import talib._ta_lib as _ta_lib +from ._ta_lib import Function as _Function, __TA_FUNCTION_NAMES__, _get_defaults_and_docs + + +_func_obj_mapping = { + func_name: getattr(_ta_lib, func_name) + for func_name in __TA_FUNCTION_NAMES__ +} + + +def Function(function_name, *args, **kwargs): + func_name = function_name.upper() + if func_name not in _func_obj_mapping: + raise Exception('%s not supported by TA-LIB.' % func_name) + + return _Function( + func_name, _func_obj_mapping[func_name], *args, **kwargs + ) + + +for func_name in __TA_FUNCTION_NAMES__: + globals()[func_name] = Function(func_name) + + +__all__ = ["Function"] + __TA_FUNCTION_NAMES__ diff --git a/talib/common.pxd b/talib/common.pxd index 50c264e7b..a1357543b 100644 --- a/talib/common.pxd +++ b/talib/common.pxd @@ -1,2 +1,2 @@ -from libta_lib cimport TA_RetCode +from _ta_lib cimport TA_RetCode cpdef _ta_check_success(str function_name, TA_RetCode ret_code) diff --git a/talib/stream.py b/talib/stream.py new file mode 100644 index 000000000..ee2cc85e9 --- /dev/null +++ b/talib/stream.py @@ -0,0 +1,6 @@ +import talib._ta_lib as _ta_lib +from ._ta_lib import __TA_FUNCTION_NAMES__ + + +for func_name in __TA_FUNCTION_NAMES__: + globals()[func_name] = getattr(_ta_lib, "stream_%s" % func_name) From 4bab2a000e51fbf2de94056136d507795eb6e562 Mon Sep 17 00:00:00 2001 From: mckelvin Date: Sat, 4 Feb 2017 11:19:04 +0800 Subject: [PATCH 2/3] Update generated c files (using Cython 0.24.1) --- talib/_ta_lib.c | 250401 ++++++++++++++++++++++++++++++++++++++++++++ talib/abstract.c | 20518 ---- talib/common.c | 5519 - talib/func.c | 138741 ------------------------ talib/stream.c | 102155 ------------------ 5 files changed, 250401 insertions(+), 266933 deletions(-) create mode 100644 talib/_ta_lib.c delete mode 100644 talib/abstract.c delete mode 100644 talib/common.c delete mode 100644 talib/func.c delete mode 100644 talib/stream.c diff --git a/talib/_ta_lib.c b/talib/_ta_lib.c new file mode 100644 index 000000000..0bb156727 --- /dev/null +++ b/talib/_ta_lib.c @@ -0,0 +1,250401 @@ +/* Generated by Cython 0.24.1 */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_24_1" +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 + #define CYTHON_USE_PYLONG_INTERNALS 1 +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if PY_VERSION_HEX >= 0x030500B1 +#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) +#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; +} __Pyx_PyAsyncMethodsStruct; +#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) +#else +#define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) + +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__talib___ta_lib +#define __PYX_HAVE_API__talib___ta_lib +#include "ta-lib/ta_defs.h" +#include "ta-lib/ta_common.h" +#include "ta-lib/ta_abstract.h" +#include "ta-lib/ta_func.h" +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* None.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "talib/_common.pxi", + "talib/_abstract.pxi", + "talib/_func.pxi", + "talib/_stream.pxi", + "__init__.pxd", + "talib/_ta_lib.pyx", + "type.pxd", +}; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* None.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +/* None.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* ListAppend.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyIntBinop.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* py_dict_keys.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + ((likely((cfunc)->func)) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* PyNumberPow2.proto */ +#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1) +#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0) +static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace); + +/* SliceObject.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* PyIntBinop.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ + PyObject_RichCompare(op1, op2, Py_EQ) + #endif + +/* PyIntBinop.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* SetItemInt.proto */ +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* SaveResetException.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInputParameterType value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_FuncFlags(TA_FuncFlags value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_InputFlags(TA_InputFlags value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OutputFlags(TA_OutputFlags value); + +/* None.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* None.proto */ +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* None.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* None.proto */ +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +/* None.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE TA_RetCode __Pyx_PyInt_As_TA_RetCode(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE TA_FuncUnstId __Pyx_PyInt_As_TA_FuncUnstId(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyIdentifierFromString.proto */ +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +/* ModuleImport.proto */ +static PyObject *__Pyx_ImportModule(const char *name); + +/* TypeImport.proto */ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'talib._ta_lib' */ +static double __pyx_v_5talib_7_ta_lib_NaN; +static PyObject *__pyx_f_5talib_7_ta_lib__ta_check_success(PyObject *, TA_RetCode, int __pyx_skip_dispatch); /*proto*/ +static TA_FuncHandle *__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(char *); /*proto*/ +static TA_ParamHolder *__pyx_f_5talib_7_ta_lib___ta_paramHolderAlloc(char *); /*proto*/ +static int __pyx_f_5talib_7_ta_lib___ta_paramHolderFree(TA_ParamHolder *); /*proto*/ +static int __pyx_f_5talib_7_ta_lib___ta_setOptInputParamInteger(TA_ParamHolder *, int, int); /*proto*/ +static int __pyx_f_5talib_7_ta_lib___ta_setOptInputParamReal(TA_ParamHolder *, int, int); /*proto*/ +static int __pyx_f_5talib_7_ta_lib___ta_getLookback(TA_ParamHolder *); /*proto*/ +#define __Pyx_MODULE_NAME "talib._ta_lib" +int __pyx_module_is_main_talib___ta_lib = 0; + +/* Implementation of 'talib._ta_lib' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_min; +static PyObject *__pyx_builtin_max; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static const char __pyx_k_3[] = "3"; +static const char __pyx_k_b[] = "b"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_s[] = "s"; +static const char __pyx_k_AD[] = "AD"; +static const char __pyx_k_DX[] = "DX"; +static const char __pyx_k_LN[] = "LN"; +static const char __pyx_k_MA[] = "MA"; +static const char __pyx_k_T3[] = "T3"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_in[] = "in"; +static const char __pyx_k_ADD[] = "ADD"; +static const char __pyx_k_ADX[] = "ADX"; +static const char __pyx_k_ALL[] = "ALL"; +static const char __pyx_k_APO[] = "APO"; +static const char __pyx_k_ATR[] = "ATR"; +static const char __pyx_k_BOP[] = "BOP"; +static const char __pyx_k_CCI[] = "CCI"; +static const char __pyx_k_CMO[] = "CMO"; +static const char __pyx_k_COS[] = "COS"; +static const char __pyx_k_DIV[] = "DIV"; +static const char __pyx_k_Dot[] = "Dot"; +static const char __pyx_k_EMA[] = "EMA"; +static const char __pyx_k_EXP[] = "EXP"; +static const char __pyx_k_MAX[] = "MAX"; +static const char __pyx_k_MFI[] = "MFI"; +static const char __pyx_k_MIN[] = "MIN"; +static const char __pyx_k_MOM[] = "MOM"; +static const char __pyx_k_OBV[] = "OBV"; +static const char __pyx_k_PPO[] = "PPO"; +static const char __pyx_k_ROC[] = "ROC"; +static const char __pyx_k_RSI[] = "RSI"; +static const char __pyx_k_SAR[] = "SAR"; +static const char __pyx_k_SIN[] = "SIN"; +static const char __pyx_k_SMA[] = "SMA"; +static const char __pyx_k_SUB[] = "SUB"; +static const char __pyx_k_SUM[] = "SUM"; +static const char __pyx_k_TAN[] = "TAN"; +static const char __pyx_k_TSF[] = "TSF"; +static const char __pyx_k_VAR[] = "VAR"; +static const char __pyx_k_WMA[] = "WMA"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_idx[] = "idx"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_log[] = "log"; +static const char __pyx_k_low[] = "low"; +static const char __pyx_k_max[] = "max"; +static const char __pyx_k_min[] = "min"; +static const char __pyx_k_nan[] = "nan"; +static const char __pyx_k_out[] = "out"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ret[] = "ret"; +static const char __pyx_k_run[] = "run"; +static const char __pyx_k_s_2[] = "%s"; +static const char __pyx_k_s_3[] = "(%s)"; +static const char __pyx_k_s_4[] = " %s"; +static const char __pyx_k_s_s[] = " %s: %s"; +static const char __pyx_k_str[] = "__str__"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_val[] = "val"; +static const char __pyx_k_ACOS[] = "ACOS"; +static const char __pyx_k_ADXR[] = "ADXR"; +static const char __pyx_k_ASIN[] = "ASIN"; +static const char __pyx_k_ATAN[] = "ATAN"; +static const char __pyx_k_BETA[] = "BETA"; +static const char __pyx_k_CEIL[] = "CEIL"; +static const char __pyx_k_COSH[] = "COSH"; +static const char __pyx_k_DEMA[] = "DEMA"; +static const char __pyx_k_KAMA[] = "KAMA"; +static const char __pyx_k_Line[] = "Line"; +static const char __pyx_k_MACD[] = "MACD"; +static const char __pyx_k_MAMA[] = "MAMA"; +static const char __pyx_k_MAVP[] = "MAVP"; +static const char __pyx_k_MULT[] = "MULT"; +static const char __pyx_k_NATR[] = "NATR"; +static const char __pyx_k_NONE[] = "NONE"; +static const char __pyx_k_ROCP[] = "ROCP"; +static const char __pyx_k_ROCR[] = "ROCR"; +static const char __pyx_k_SINH[] = "SINH"; +static const char __pyx_k_SQRT[] = "SQRT"; +static const char __pyx_k_TANH[] = "TANH"; +static const char __pyx_k_TEMA[] = "TEMA"; +static const char __pyx_k_TRIX[] = "TRIX"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_call[] = "__call__"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_docs[] = "docs"; +static const char __pyx_k_flag[] = "flag"; +static const char __pyx_k_help[] = "help"; +static const char __pyx_k_high[] = "high"; +static const char __pyx_k_info[] = "info"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_math[] = "math"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_open[] = "open"; +static const char __pyx_k_real[] = "real"; +static const char __pyx_k_repr[] = "__repr__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_type[] = "type_"; +static const char __pyx_k_ADOSC[] = "ADOSC"; +static const char __pyx_k_AROON[] = "AROON"; +static const char __pyx_k_FLOOR[] = "FLOOR"; +static const char __pyx_k_LOG10[] = "LOG10"; +static const char __pyx_k_STOCH[] = "STOCH"; +static const char __pyx_k_TA_AD[] = "TA_AD"; +static const char __pyx_k_TA_DX[] = "TA_DX"; +static const char __pyx_k_TA_LN[] = "TA_LN"; +static const char __pyx_k_TA_MA[] = "TA_MA"; +static const char __pyx_k_TA_T3[] = "TA_T3"; +static const char __pyx_k_TRIMA[] = "TRIMA"; +static const char __pyx_k_WILLR[] = "WILLR"; +static const char __pyx_k__1211[] = ""; +static const char __pyx_k__1212[] = ", "; +static const char __pyx_k__1214[] = "("; +static const char __pyx_k__1215[] = " "; +static const char __pyx_k__1216[] = ")\n"; +static const char __pyx_k__1217[] = "\n"; +static const char __pyx_k_ascii[] = "ascii"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_group[] = "group"; +static const char __pyx_k_index[] = "index"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_nbdev[] = "nbdev"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_optIn[] = "optIn"; +static const char __pyx_k_param[] = "param"; +static const char __pyx_k_price[] = "price"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_real0[] = "real0"; +static const char __pyx_k_real1[] = "real1"; +static const char __pyx_k_s_s_2[] = "[%s=%s]"; +static const char __pyx_k_table[] = "table"; +static const char __pyx_k_upper[] = "upper"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_BBANDS[] = "BBANDS"; +static const char __pyx_k_CORREL[] = "CORREL"; +static const char __pyx_k_Inputs[] = "Inputs:"; +static const char __pyx_k_MINMAX[] = "MINMAX"; +static const char __pyx_k_SAREXT[] = "SAREXT"; +static const char __pyx_k_STDDEV[] = "STDDEV"; +static const char __pyx_k_STOCHF[] = "STOCHF"; +static const char __pyx_k_Series[] = "Series"; +static const char __pyx_k_TA_ADD[] = "TA_ADD"; +static const char __pyx_k_TA_ADX[] = "TA_ADX"; +static const char __pyx_k_TA_APO[] = "TA_APO"; +static const char __pyx_k_TA_ATR[] = "TA_ATR"; +static const char __pyx_k_TA_BOP[] = "TA_BOP"; +static const char __pyx_k_TA_CCI[] = "TA_CCI"; +static const char __pyx_k_TA_CMO[] = "TA_CMO"; +static const char __pyx_k_TA_COS[] = "TA_COS"; +static const char __pyx_k_TA_DIV[] = "TA_DIV"; +static const char __pyx_k_TA_EMA[] = "TA_EMA"; +static const char __pyx_k_TA_EXP[] = "TA_EXP"; +static const char __pyx_k_TA_MAX[] = "TA_MAX"; +static const char __pyx_k_TA_MFI[] = "TA_MFI"; +static const char __pyx_k_TA_MIN[] = "TA_MIN"; +static const char __pyx_k_TA_MOM[] = "TA_MOM"; +static const char __pyx_k_TA_OBV[] = "TA_OBV"; +static const char __pyx_k_TA_PPO[] = "TA_PPO"; +static const char __pyx_k_TA_ROC[] = "TA_ROC"; +static const char __pyx_k_TA_RSI[] = "TA_RSI"; +static const char __pyx_k_TA_SAR[] = "TA_SAR"; +static const char __pyx_k_TA_SIN[] = "TA_SIN"; +static const char __pyx_k_TA_SMA[] = "TA_SMA"; +static const char __pyx_k_TA_SUB[] = "TA_SUB"; +static const char __pyx_k_TA_SUM[] = "TA_SUM"; +static const char __pyx_k_TA_TAN[] = "TA_TAN"; +static const char __pyx_k_TA_TSF[] = "TA_TSF"; +static const char __pyx_k_TA_VAR[] = "TA_VAR"; +static const char __pyx_k_TA_WMA[] = "TA_WMA"; +static const char __pyx_k_TRANGE[] = "TRANGE"; +static const char __pyx_k_ULTOSC[] = "ULTOSC"; +static const char __pyx_k_begidx[] = "begidx"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_endidx[] = "endidx"; +static const char __pyx_k_groups[] = "groups"; +static const char __pyx_k_holder[] = "holder"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_length[] = "length"; +static const char __pyx_k_lookup[] = "_lookup"; +static const char __pyx_k_matype[] = "matype"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_object[] = "object"; +static const char __pyx_k_outmax[] = "outmax"; +static const char __pyx_k_outmin[] = "outmin"; +static const char __pyx_k_output[] = "output"; +static const char __pyx_k_pandas[] = "pandas"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_period[] = "period"; +static const char __pyx_k_price0[] = "price0"; +static const char __pyx_k_price1[] = "price1"; +static const char __pyx_k_prices[] = "prices"; +static const char __pyx_k_series[] = "series"; +static const char __pyx_k_type_2[] = "type"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_volume[] = "volume"; +static const char __pyx_k_xrange[] = "xrange"; +static const char __pyx_k_CDLDOJI[] = "CDLDOJI"; +static const char __pyx_k_HT_SINE[] = "HT_SINE"; +static const char __pyx_k_MACDEXT[] = "MACDEXT"; +static const char __pyx_k_MACDFIX[] = "MACDFIX"; +static const char __pyx_k_MA_Type[] = "MA_Type"; +static const char __pyx_k_Outputs[] = "Outputs:"; +static const char __pyx_k_PLUS_DI[] = "PLUS_DI"; +static const char __pyx_k_PLUS_DM[] = "PLUS_DM"; +static const char __pyx_k_ROCR100[] = "ROCR100"; +static const char __pyx_k_Success[] = "Success"; +static const char __pyx_k_TA_ACOS[] = "TA_ACOS"; +static const char __pyx_k_TA_ADXR[] = "TA_ADXR"; +static const char __pyx_k_TA_ASIN[] = "TA_ASIN"; +static const char __pyx_k_TA_ATAN[] = "TA_ATAN"; +static const char __pyx_k_TA_BETA[] = "TA_BETA"; +static const char __pyx_k_TA_CEIL[] = "TA_CEIL"; +static const char __pyx_k_TA_COSH[] = "TA_COSH"; +static const char __pyx_k_TA_DEMA[] = "TA_DEMA"; +static const char __pyx_k_TA_KAMA[] = "TA_KAMA"; +static const char __pyx_k_TA_MACD[] = "TA_MACD"; +static const char __pyx_k_TA_MAMA[] = "TA_MAMA"; +static const char __pyx_k_TA_MAVP[] = "TA_MAVP"; +static const char __pyx_k_TA_MULT[] = "TA_MULT"; +static const char __pyx_k_TA_NATR[] = "TA_NATR"; +static const char __pyx_k_TA_ROCP[] = "TA_ROCP"; +static const char __pyx_k_TA_ROCR[] = "TA_ROCR"; +static const char __pyx_k_TA_SINH[] = "TA_SINH"; +static const char __pyx_k_TA_SQRT[] = "TA_SQRT"; +static const char __pyx_k_TA_TANH[] = "TA_TANH"; +static const char __pyx_k_TA_TEMA[] = "TA_TEMA"; +static const char __pyx_k_TA_TRIX[] = "TA_TRIX"; +static const char __pyx_k_columns[] = "columns"; +static const char __pyx_k_getitem[] = "__getitem__"; +static const char __pyx_k_integer[] = "integer"; +static const char __pyx_k_max_int[] = "max_int"; +static const char __pyx_k_maximum[] = "maximum"; +static const char __pyx_k_min_int[] = "min_int"; +static const char __pyx_k_nbdevdn[] = "nbdevdn"; +static const char __pyx_k_nbdevup[] = "nbdevup"; +static const char __pyx_k_outfama[] = "outfama"; +static const char __pyx_k_outmacd[] = "outmacd"; +static const char __pyx_k_outmama[] = "outmama"; +static const char __pyx_k_outputs[] = "outputs"; +static const char __pyx_k_outreal[] = "outreal"; +static const char __pyx_k_outsine[] = "outsine"; +static const char __pyx_k_periods[] = "periods"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_replace[] = "replace"; +static const char __pyx_k_results[] = "results"; +static const char __pyx_k_retCode[] = "retCode"; +static const char __pyx_k_unicode[] = "__unicode__"; +static const char __pyx_k_version[] = "version"; +static const char __pyx_k_vfactor[] = "vfactor"; +static const char __pyx_k_AROONOSC[] = "AROONOSC"; +static const char __pyx_k_AVGPRICE[] = "AVGPRICE"; +static const char __pyx_k_Function[] = "Function"; +static const char __pyx_k_MAXINDEX[] = "MAXINDEX"; +static const char __pyx_k_MEDPRICE[] = "MEDPRICE"; +static const char __pyx_k_MIDPOINT[] = "MIDPOINT"; +static const char __pyx_k_MIDPRICE[] = "MIDPRICE"; +static const char __pyx_k_MININDEX[] = "MININDEX"; +static const char __pyx_k_MINUS_DI[] = "MINUS_DI"; +static const char __pyx_k_MINUS_DM[] = "MINUS_DM"; +static const char __pyx_k_STOCHRSI[] = "STOCHRSI"; +static const char __pyx_k_TA_ADOSC[] = "TA_ADOSC"; +static const char __pyx_k_TA_AROON[] = "TA_AROON"; +static const char __pyx_k_TA_FLOOR[] = "TA_FLOOR"; +static const char __pyx_k_TA_LOG10[] = "TA_LOG10"; +static const char __pyx_k_TA_STOCH[] = "TA_STOCH"; +static const char __pyx_k_TA_TRIMA[] = "TA_TRIMA"; +static const char __pyx_k_TA_WILLR[] = "TA_WILLR"; +static const char __pyx_k_TYPPRICE[] = "TYPPRICE"; +static const char __pyx_k_WCLPRICE[] = "WCLPRICE"; +static const char __pyx_k_defaults[] = "defaults"; +static const char __pyx_k_lookback[] = "lookback"; +static const char __pyx_k_low_data[] = "low_data"; +static const char __pyx_k_outfastd[] = "outfastd"; +static const char __pyx_k_outfastk[] = "outfastk"; +static const char __pyx_k_outslowd[] = "outslowd"; +static const char __pyx_k_outslowk[] = "outslowk"; +static const char __pyx_k_property[] = "property"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_ret_code[] = "ret_code"; +static const char __pyx_k_CDL2CROWS[] = "CDL2CROWS"; +static const char __pyx_k_CDLHAMMER[] = "CDLHAMMER"; +static const char __pyx_k_CDLHARAMI[] = "CDLHARAMI"; +static const char __pyx_k_CDLINNECK[] = "CDLINNECK"; +static const char __pyx_k_CDLONNECK[] = "CDLONNECK"; +static const char __pyx_k_CDLTAKURI[] = "CDLTAKURI"; +static const char __pyx_k_DataFrame[] = "DataFrame"; +static const char __pyx_k_Exception[] = "Exception"; +static const char __pyx_k_HT_PHASOR[] = "HT_PHASOR"; +static const char __pyx_k_Histogram[] = "Histogram"; +static const char __pyx_k_LINEARREG[] = "LINEARREG"; +static const char __pyx_k_TA_BBANDS[] = "TA_BBANDS"; +static const char __pyx_k_TA_CORREL[] = "TA_CORREL"; +static const char __pyx_k_TA_MINMAX[] = "TA_MINMAX"; +static const char __pyx_k_TA_SAREXT[] = "TA_SAREXT"; +static const char __pyx_k_TA_STDDEV[] = "TA_STDDEV"; +static const char __pyx_k_TA_STOCHF[] = "TA_STOCHF"; +static const char __pyx_k_TA_TRANGE[] = "TA_TRANGE"; +static const char __pyx_k_TA_ULTOSC[] = "TA_ULTOSC"; +static const char __pyx_k_bytes2str[] = "bytes2str"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_fastlimit[] = "fastlimit"; +static const char __pyx_k_func_args[] = "func_args"; +static const char __pyx_k_func_info[] = "func_info"; +static const char __pyx_k_func_line[] = "func_line"; +static const char __pyx_k_functions[] = "functions"; +static const char __pyx_k_get_flags[] = "__get_flags"; +static const char __pyx_k_high_data[] = "high_data"; +static const char __pyx_k_maxperiod[] = "maxperiod"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_minperiod[] = "minperiod"; +static const char __pyx_k_open_data[] = "open_data"; +static const char __pyx_k_opt_input[] = "opt_input"; +static const char __pyx_k_outbegidx[] = "outbegidx"; +static const char __pyx_k_outmaxidx[] = "outmaxidx"; +static const char __pyx_k_outminidx[] = "outminidx"; +static const char __pyx_k_real_data[] = "real_data"; +static const char __pyx_k_slowlimit[] = "slowlimit"; +static const char __pyx_k_str2bytes[] = "str2bytes"; +static const char __pyx_k_stream_AD[] = "stream_AD"; +static const char __pyx_k_stream_DX[] = "stream_DX"; +static const char __pyx_k_stream_LN[] = "stream_LN"; +static const char __pyx_k_stream_MA[] = "stream_MA"; +static const char __pyx_k_stream_T3[] = "stream_T3"; +static const char __pyx_k_timeStamp[] = "timeStamp"; +static const char __pyx_k_CDL3INSIDE[] = "CDL3INSIDE"; +static const char __pyx_k_CDLHIKKAKE[] = "CDLHIKKAKE"; +static const char __pyx_k_CDLKICKING[] = "CDLKICKING"; +static const char __pyx_k_CDLMATHOLD[] = "CDLMATHOLD"; +static const char __pyx_k_CDLTRISTAR[] = "CDLTRISTAR"; +static const char __pyx_k_HT_DCPHASE[] = "HT_DCPHASE"; +static const char __pyx_k_Parameters[] = "Parameters:"; +static const char __pyx_k_TA_CDLDOJI[] = "TA_CDLDOJI"; +static const char __pyx_k_TA_HT_SINE[] = "TA_HT_SINE"; +static const char __pyx_k_TA_MACDEXT[] = "TA_MACDEXT"; +static const char __pyx_k_TA_MACDFIX[] = "TA_MACDFIX"; +static const char __pyx_k_TA_PLUS_DI[] = "TA_PLUS_DI"; +static const char __pyx_k_TA_PLUS_DM[] = "TA_PLUS_DM"; +static const char __pyx_k_TA_ROCR100[] = "TA_ROCR100"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_close_data[] = "close_data"; +static const char __pyx_k_fastmatype[] = "fastmatype"; +static const char __pyx_k_fastperiod[] = "fastperiod"; +static const char __pyx_k_input_name[] = "input_name"; +static const char __pyx_k_num_inputs[] = "num_inputs"; +static const char __pyx_k_outaroonup[] = "outaroonup"; +static const char __pyx_k_outinphase[] = "outinphase"; +static const char __pyx_k_outinteger[] = "outinteger"; +static const char __pyx_k_param_name[] = "param_name"; +static const char __pyx_k_parameters[] = "parameters"; +static const char __pyx_k_real0_data[] = "real0_data"; +static const char __pyx_k_real1_data[] = "real1_data"; +static const char __pyx_k_skip_first[] = "skip_first"; +static const char __pyx_k_slowmatype[] = "slowmatype"; +static const char __pyx_k_slowperiod[] = "slowperiod"; +static const char __pyx_k_startvalue[] = "startvalue"; +static const char __pyx_k_stream_ADD[] = "stream_ADD"; +static const char __pyx_k_stream_ADX[] = "stream_ADX"; +static const char __pyx_k_stream_APO[] = "stream_APO"; +static const char __pyx_k_stream_ATR[] = "stream_ATR"; +static const char __pyx_k_stream_BOP[] = "stream_BOP"; +static const char __pyx_k_stream_CCI[] = "stream_CCI"; +static const char __pyx_k_stream_CMO[] = "stream_CMO"; +static const char __pyx_k_stream_COS[] = "stream_COS"; +static const char __pyx_k_stream_DIV[] = "stream_DIV"; +static const char __pyx_k_stream_EMA[] = "stream_EMA"; +static const char __pyx_k_stream_EXP[] = "stream_EXP"; +static const char __pyx_k_stream_MAX[] = "stream_MAX"; +static const char __pyx_k_stream_MFI[] = "stream_MFI"; +static const char __pyx_k_stream_MIN[] = "stream_MIN"; +static const char __pyx_k_stream_MOM[] = "stream_MOM"; +static const char __pyx_k_stream_OBV[] = "stream_OBV"; +static const char __pyx_k_stream_PPO[] = "stream_PPO"; +static const char __pyx_k_stream_ROC[] = "stream_ROC"; +static const char __pyx_k_stream_RSI[] = "stream_RSI"; +static const char __pyx_k_stream_SAR[] = "stream_SAR"; +static const char __pyx_k_stream_SIN[] = "stream_SIN"; +static const char __pyx_k_stream_SMA[] = "stream_SMA"; +static const char __pyx_k_stream_SUB[] = "stream_SUB"; +static const char __pyx_k_stream_SUM[] = "stream_SUM"; +static const char __pyx_k_stream_TAN[] = "stream_TAN"; +static const char __pyx_k_stream_TSF[] = "stream_TSF"; +static const char __pyx_k_stream_VAR[] = "stream_VAR"; +static const char __pyx_k_stream_WMA[] = "stream_WMA"; +static const char __pyx_k_ta_version[] = "__ta_version__"; +static const char __pyx_k_timeperiod[] = "timeperiod"; +static const char __pyx_k_CDL3OUTSIDE[] = "CDL3OUTSIDE"; +static const char __pyx_k_CDLBELTHOLD[] = "CDLBELTHOLD"; +static const char __pyx_k_CDLDOJISTAR[] = "CDLDOJISTAR"; +static const char __pyx_k_CDLHIGHWAVE[] = "CDLHIGHWAVE"; +static const char __pyx_k_CDLLONGLINE[] = "CDLLONGLINE"; +static const char __pyx_k_CDLMARUBOZU[] = "CDLMARUBOZU"; +static const char __pyx_k_CDLPIERCING[] = "CDLPIERCING"; +static const char __pyx_k_Dashed_Line[] = "Dashed Line"; +static const char __pyx_k_Dotted_Line[] = "Dotted Line"; +static const char __pyx_k_HT_DCPERIOD[] = "HT_DCPERIOD"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MINMAXINDEX[] = "MINMAXINDEX"; +static const char __pyx_k_OrderedDict[] = "OrderedDict"; +static const char __pyx_k_TA_AROONOSC[] = "TA_AROONOSC"; +static const char __pyx_k_TA_AVGPRICE[] = "TA_AVGPRICE"; +static const char __pyx_k_TA_MAXINDEX[] = "TA_MAXINDEX"; +static const char __pyx_k_TA_MEDPRICE[] = "TA_MEDPRICE"; +static const char __pyx_k_TA_MIDPOINT[] = "TA_MIDPOINT"; +static const char __pyx_k_TA_MIDPRICE[] = "TA_MIDPRICE"; +static const char __pyx_k_TA_MININDEX[] = "TA_MININDEX"; +static const char __pyx_k_TA_MINUS_DI[] = "TA_MINUS_DI"; +static const char __pyx_k_TA_MINUS_DM[] = "TA_MINUS_DM"; +static const char __pyx_k_TA_STOCHRSI[] = "TA_STOCHRSI"; +static const char __pyx_k_TA_Shutdown[] = "TA_Shutdown"; +static const char __pyx_k_TA_TYPPRICE[] = "TA_TYPPRICE"; +static const char __pyx_k_TA_WCLPRICE[] = "TA_WCLPRICE"; +static const char __pyx_k_any_ndarray[] = "(any ndarray)"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_func_object[] = "func_object"; +static const char __pyx_k_input_names[] = "input_names"; +static const char __pyx_k_num_outputs[] = "num_outputs"; +static const char __pyx_k_ordereddict[] = "ordereddict"; +static const char __pyx_k_outleadsine[] = "outleadsine"; +static const char __pyx_k_outmacdhist[] = "outmacdhist"; +static const char __pyx_k_outmax_data[] = "outmax_data"; +static const char __pyx_k_outmin_data[] = "outmin_data"; +static const char __pyx_k_output_name[] = "output_name"; +static const char __pyx_k_penetration[] = "penetration"; +static const char __pyx_k_stream_ACOS[] = "stream_ACOS"; +static const char __pyx_k_stream_ADXR[] = "stream_ADXR"; +static const char __pyx_k_stream_ASIN[] = "stream_ASIN"; +static const char __pyx_k_stream_ATAN[] = "stream_ATAN"; +static const char __pyx_k_stream_BETA[] = "stream_BETA"; +static const char __pyx_k_stream_CEIL[] = "stream_CEIL"; +static const char __pyx_k_stream_COSH[] = "stream_COSH"; +static const char __pyx_k_stream_DEMA[] = "stream_DEMA"; +static const char __pyx_k_stream_KAMA[] = "stream_KAMA"; +static const char __pyx_k_stream_MACD[] = "stream_MACD"; +static const char __pyx_k_stream_MAMA[] = "stream_MAMA"; +static const char __pyx_k_stream_MAVP[] = "stream_MAVP"; +static const char __pyx_k_stream_MULT[] = "stream_MULT"; +static const char __pyx_k_stream_NATR[] = "stream_NATR"; +static const char __pyx_k_stream_ROCP[] = "stream_ROCP"; +static const char __pyx_k_stream_ROCR[] = "stream_ROCR"; +static const char __pyx_k_stream_SINH[] = "stream_SINH"; +static const char __pyx_k_stream_SQRT[] = "stream_SQRT"; +static const char __pyx_k_stream_TANH[] = "stream_TANH"; +static const char __pyx_k_stream_TEMA[] = "stream_TEMA"; +static const char __pyx_k_stream_TRIX[] = "stream_TRIX"; +static const char __pyx_k_ta_shutdown[] = "_ta_shutdown"; +static const char __pyx_k_timeperiod1[] = "timeperiod1"; +static const char __pyx_k_timeperiod2[] = "timeperiod2"; +static const char __pyx_k_timeperiod3[] = "timeperiod3"; +static const char __pyx_k_update_info[] = "update_info"; +static const char __pyx_k_value_range[] = "value_range"; +static const char __pyx_k_volume_data[] = "volume_data"; +static const char __pyx_k_CDLBREAKAWAY[] = "CDLBREAKAWAY"; +static const char __pyx_k_CDLENGULFING[] = "CDLENGULFING"; +static const char __pyx_k_CDLSHORTLINE[] = "CDLSHORTLINE"; +static const char __pyx_k_CDLTASUKIGAP[] = "CDLTASUKIGAP"; +static const char __pyx_k_CDLTHRUSTING[] = "CDLTHRUSTING"; +static const char __pyx_k_Function_run[] = "Function.run"; +static const char __pyx_k_HT_TRENDLINE[] = "HT_TRENDLINE"; +static const char __pyx_k_HT_TRENDMODE[] = "HT_TRENDMODE"; +static const char __pyx_k_Pattern_Bool[] = "Pattern (Bool)"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_TA_CDL2CROWS[] = "TA_CDL2CROWS"; +static const char __pyx_k_TA_CDLHAMMER[] = "TA_CDLHAMMER"; +static const char __pyx_k_TA_CDLHARAMI[] = "TA_CDLHARAMI"; +static const char __pyx_k_TA_CDLINNECK[] = "TA_CDLINNECK"; +static const char __pyx_k_TA_CDLONNECK[] = "TA_CDLONNECK"; +static const char __pyx_k_TA_CDLTAKURI[] = "TA_CDLTAKURI"; +static const char __pyx_k_TA_HT_PHASOR[] = "TA_HT_PHASOR"; +static const char __pyx_k_TA_LINEARREG[] = "TA_LINEARREG"; +static const char __pyx_k_acceleration[] = "acceleration"; +static const char __pyx_k_column_stack[] = "column_stack"; +static const char __pyx_k_display_name[] = "display_name"; +static const char __pyx_k_fastd_matype[] = "fastd_matype"; +static const char __pyx_k_fastd_period[] = "fastd_period"; +static const char __pyx_k_fastk_period[] = "fastk_period"; +static const char __pyx_k_input_arrays[] = "input_arrays"; +static const char __pyx_k_missing_keys[] = "missing_keys"; +static const char __pyx_k_openInterest[] = "openInterest"; +static const char __pyx_k_outaroondown[] = "outaroondown"; +static const char __pyx_k_outfama_data[] = "outfama_data"; +static const char __pyx_k_outmacd_data[] = "outmacd_data"; +static const char __pyx_k_outmama_data[] = "outmama_data"; +static const char __pyx_k_outnbelement[] = "outnbelement"; +static const char __pyx_k_output_flags[] = "output_flags"; +static const char __pyx_k_output_names[] = "output_names"; +static const char __pyx_k_outreal_data[] = "outreal_data"; +static const char __pyx_k_outsine_data[] = "outsine_data"; +static const char __pyx_k_periods_data[] = "periods_data"; +static const char __pyx_k_price_series[] = "price_series"; +static const char __pyx_k_signalmatype[] = "signalmatype"; +static const char __pyx_k_signalperiod[] = "signalperiod"; +static const char __pyx_k_slowd_matype[] = "slowd_matype"; +static const char __pyx_k_slowd_period[] = "slowd_period"; +static const char __pyx_k_slowk_matype[] = "slowk_matype"; +static const char __pyx_k_slowk_period[] = "slowk_period"; +static const char __pyx_k_stream_ADOSC[] = "stream_ADOSC"; +static const char __pyx_k_stream_AROON[] = "stream_AROON"; +static const char __pyx_k_stream_FLOOR[] = "stream_FLOOR"; +static const char __pyx_k_stream_LOG10[] = "stream_LOG10"; +static const char __pyx_k_stream_STOCH[] = "stream_STOCH"; +static const char __pyx_k_stream_TRIMA[] = "stream_TRIMA"; +static const char __pyx_k_stream_WILLR[] = "stream_WILLR"; +static const char __pyx_k_CDLHANGINGMAN[] = "CDLHANGINGMAN"; +static const char __pyx_k_CDLHIKKAKEMOD[] = "CDLHIKKAKEMOD"; +static const char __pyx_k_Function_info[] = "Function.info"; +static const char __pyx_k_PANDAS_SERIES[] = "__PANDAS_SERIES"; +static const char __pyx_k_TA_CDL3INSIDE[] = "TA_CDL3INSIDE"; +static const char __pyx_k_TA_CDLHIKKAKE[] = "TA_CDLHIKKAKE"; +static const char __pyx_k_TA_CDLKICKING[] = "TA_CDLKICKING"; +static const char __pyx_k_TA_CDLMATHOLD[] = "TA_CDLMATHOLD"; +static const char __pyx_k_TA_CDLTRISTAR[] = "TA_CDLTRISTAR"; +static const char __pyx_k_TA_FUNC_FLAGS[] = "TA_FUNC_FLAGS"; +static const char __pyx_k_TA_HT_DCPHASE[] = "TA_HT_DCPHASE"; +static const char __pyx_k_TA_Initialize[] = "TA_Initialize"; +static const char __pyx_k_call_function[] = "__call_function"; +static const char __pyx_k_default_value[] = "default_value"; +static const char __pyx_k_documentation[] = "documentation"; +static const char __pyx_k_function_name[] = "function_name"; +static const char __pyx_k_outfastd_data[] = "outfastd_data"; +static const char __pyx_k_outfastk_data[] = "outfastk_data"; +static const char __pyx_k_outmacdsignal[] = "outmacdsignal"; +static const char __pyx_k_outquadrature[] = "outquadrature"; +static const char __pyx_k_outslowd_data[] = "outslowd_data"; +static const char __pyx_k_outslowk_data[] = "outslowk_data"; +static const char __pyx_k_stream_BBANDS[] = "stream_BBANDS"; +static const char __pyx_k_stream_CORREL[] = "stream_CORREL"; +static const char __pyx_k_stream_MINMAX[] = "stream_MINMAX"; +static const char __pyx_k_stream_SAREXT[] = "stream_SAREXT"; +static const char __pyx_k_stream_STDDEV[] = "stream_STDDEV"; +static const char __pyx_k_stream_STOCHF[] = "stream_STOCHF"; +static const char __pyx_k_stream_TRANGE[] = "stream_TRANGE"; +static const char __pyx_k_stream_ULTOSC[] = "stream_ULTOSC"; +static const char __pyx_k_ta_initialize[] = "_ta_initialize"; +static const char __pyx_k_talib__ta_lib[] = "talib._ta_lib"; +static const char __pyx_k_CDL3BLACKCROWS[] = "CDL3BLACKCROWS"; +static const char __pyx_k_CDL3LINESTRIKE[] = "CDL3LINESTRIKE"; +static const char __pyx_k_CDLEVENINGSTAR[] = "CDLEVENINGSTAR"; +static const char __pyx_k_CDLHARAMICROSS[] = "CDLHARAMICROSS"; +static const char __pyx_k_CDLMATCHINGLOW[] = "CDLMATCHINGLOW"; +static const char __pyx_k_CDLMORNINGSTAR[] = "CDLMORNINGSTAR"; +static const char __pyx_k_CDLRICKSHAWMAN[] = "CDLRICKSHAWMAN"; +static const char __pyx_k_CDLSPINNINGTOP[] = "CDLSPINNINGTOP"; +static const char __pyx_k_Function___str[] = "Function.__str__"; +static const char __pyx_k_Function__info[] = "_Function__info"; +static const char __pyx_k_Function__name[] = "_Function__name"; +static const char __pyx_k_MA_Type___init[] = "MA_Type.__init__"; +static const char __pyx_k_TA_CDL3OUTSIDE[] = "TA_CDL3OUTSIDE"; +static const char __pyx_k_TA_CDLBELTHOLD[] = "TA_CDLBELTHOLD"; +static const char __pyx_k_TA_CDLDOJISTAR[] = "TA_CDLDOJISTAR"; +static const char __pyx_k_TA_CDLHIGHWAVE[] = "TA_CDLHIGHWAVE"; +static const char __pyx_k_TA_CDLLONGLINE[] = "TA_CDLLONGLINE"; +static const char __pyx_k_TA_CDLMARUBOZU[] = "TA_CDLMARUBOZU"; +static const char __pyx_k_TA_CDLPIERCING[] = "TA_CDLPIERCING"; +static const char __pyx_k_TA_GetFuncInfo[] = "TA_GetFuncInfo"; +static const char __pyx_k_TA_GetLookback[] = "TA_GetLookback"; +static const char __pyx_k_TA_HT_DCPERIOD[] = "TA_HT_DCPERIOD"; +static const char __pyx_k_TA_INPUT_FLAGS[] = "TA_INPUT_FLAGS"; +static const char __pyx_k_TA_MINMAXINDEX[] = "TA_MINMAXINDEX"; +static const char __pyx_k_function_flags[] = "function_flags"; +static const char __pyx_k_get_parameters[] = "get_parameters"; +static const char __pyx_k_input_arrays_2[] = "[input_arrays]"; +static const char __pyx_k_num_opt_inputs[] = "num_opt_inputs"; +static const char __pyx_k_outmaxidx_data[] = "outmaxidx_data"; +static const char __pyx_k_outminidx_data[] = "outminidx_data"; +static const char __pyx_k_set_parameters[] = "set_parameters"; +static const char __pyx_k_stream_CDLDOJI[] = "stream_CDLDOJI"; +static const char __pyx_k_stream_HT_SINE[] = "stream_HT_SINE"; +static const char __pyx_k_stream_MACDEXT[] = "stream_MACDEXT"; +static const char __pyx_k_stream_MACDFIX[] = "stream_MACDFIX"; +static const char __pyx_k_stream_PLUS_DI[] = "stream_PLUS_DI"; +static const char __pyx_k_stream_PLUS_DM[] = "stream_PLUS_DM"; +static const char __pyx_k_stream_ROCR100[] = "stream_ROCR100"; +static const char __pyx_k_ta_getFuncInfo[] = "_ta_getFuncInfo"; +static const char __pyx_k_CDLADVANCEBLOCK[] = "CDLADVANCEBLOCK"; +static const char __pyx_k_CDLHOMINGPIGEON[] = "CDLHOMINGPIGEON"; +static const char __pyx_k_CDLLADDERBOTTOM[] = "CDLLADDERBOTTOM"; +static const char __pyx_k_CDLSHOOTINGSTAR[] = "CDLSHOOTINGSTAR"; +static const char __pyx_k_CDLUNIQUE3RIVER[] = "CDLUNIQUE3RIVER"; +static const char __pyx_k_Function___call[] = "Function.__call__"; +static const char __pyx_k_Function___init[] = "Function.__init__"; +static const char __pyx_k_Function___repr[] = "Function.__repr__"; +static const char __pyx_k_LINEARREG_ANGLE[] = "LINEARREG_ANGLE"; +static const char __pyx_k_LINEARREG_SLOPE[] = "LINEARREG_SLOPE"; +static const char __pyx_k_TA_CDLBREAKAWAY[] = "TA_CDLBREAKAWAY"; +static const char __pyx_k_TA_CDLENGULFING[] = "TA_CDLENGULFING"; +static const char __pyx_k_TA_CDLSHORTLINE[] = "TA_CDLSHORTLINE"; +static const char __pyx_k_TA_CDLTASUKIGAP[] = "TA_CDLTASUKIGAP"; +static const char __pyx_k_TA_CDLTHRUSTING[] = "TA_CDLTHRUSTING"; +static const char __pyx_k_TA_HT_TRENDLINE[] = "TA_HT_TRENDLINE"; +static const char __pyx_k_TA_HT_TRENDMODE[] = "TA_HT_TRENDMODE"; +static const char __pyx_k_TA_OUTPUT_FLAGS[] = "TA_OUTPUT_FLAGS"; +static const char __pyx_k_get_input_names[] = "get_input_names"; +static const char __pyx_k_offsetonreverse[] = "offsetonreverse"; +static const char __pyx_k_outaroonup_data[] = "outaroonup_data"; +static const char __pyx_k_outinphase_data[] = "outinphase_data"; +static const char __pyx_k_outinteger_data[] = "outinteger_data"; +static const char __pyx_k_set_input_names[] = "set_input_names"; +static const char __pyx_k_stream_AROONOSC[] = "stream_AROONOSC"; +static const char __pyx_k_stream_AVGPRICE[] = "stream_AVGPRICE"; +static const char __pyx_k_stream_MAXINDEX[] = "stream_MAXINDEX"; +static const char __pyx_k_stream_MEDPRICE[] = "stream_MEDPRICE"; +static const char __pyx_k_stream_MIDPOINT[] = "stream_MIDPOINT"; +static const char __pyx_k_stream_MIDPRICE[] = "stream_MIDPRICE"; +static const char __pyx_k_stream_MININDEX[] = "stream_MININDEX"; +static const char __pyx_k_stream_MINUS_DI[] = "stream_MINUS_DI"; +static const char __pyx_k_stream_MINUS_DM[] = "stream_MINUS_DM"; +static const char __pyx_k_stream_STOCHRSI[] = "stream_STOCHRSI"; +static const char __pyx_k_stream_TYPPRICE[] = "stream_TYPPRICE"; +static const char __pyx_k_stream_WCLPRICE[] = "stream_WCLPRICE"; +static const char __pyx_k_ta_getFuncTable[] = "_ta_getFuncTable"; +static const char __pyx_k_CDL3STARSINSOUTH[] = "CDL3STARSINSOUTH"; +static const char __pyx_k_CDLABANDONEDBABY[] = "CDLABANDONEDBABY"; +static const char __pyx_k_CDLCOUNTERATTACK[] = "CDLCOUNTERATTACK"; +static const char __pyx_k_CDLDRAGONFLYDOJI[] = "CDLDRAGONFLYDOJI"; +static const char __pyx_k_CDLSTICKSANDWICH[] = "CDLSTICKSANDWICH"; +static const char __pyx_k_Function_outputs[] = "Function.outputs"; +static const char __pyx_k_PANDAS_DATAFRAME[] = "__PANDAS_DATAFRAME"; +static const char __pyx_k_TA_CDLHANGINGMAN[] = "TA_CDLHANGINGMAN"; +static const char __pyx_k_TA_CDLHIKKAKEMOD[] = "TA_CDLHIKKAKEMOD"; +static const char __pyx_k_TA_FuncTableFree[] = "TA_FuncTableFree"; +static const char __pyx_k_TA_GetFuncHandle[] = "TA_GetFuncHandle"; +static const char __pyx_k_accelerationlong[] = "accelerationlong"; +static const char __pyx_k_get_input_arrays[] = "get_input_arrays"; +static const char __pyx_k_outleadsine_data[] = "outleadsine_data"; +static const char __pyx_k_outmacdhist_data[] = "outmacdhist_data"; +static const char __pyx_k_outreallowerband[] = "outreallowerband"; +static const char __pyx_k_outrealupperband[] = "outrealupperband"; +static const char __pyx_k_set_input_arrays[] = "set_input_arrays"; +static const char __pyx_k_stream_CDL2CROWS[] = "stream_CDL2CROWS"; +static const char __pyx_k_stream_CDLHAMMER[] = "stream_CDLHAMMER"; +static const char __pyx_k_stream_CDLHARAMI[] = "stream_CDLHARAMI"; +static const char __pyx_k_stream_CDLINNECK[] = "stream_CDLINNECK"; +static const char __pyx_k_stream_CDLONNECK[] = "stream_CDLONNECK"; +static const char __pyx_k_stream_CDLTAKURI[] = "stream_CDLTAKURI"; +static const char __pyx_k_stream_HT_PHASOR[] = "stream_HT_PHASOR"; +static const char __pyx_k_stream_LINEARREG[] = "stream_LINEARREG"; +static const char __pyx_k_ta_func_unst_ids[] = "_ta_func_unst_ids"; +static const char __pyx_k_ta_getGroupTable[] = "_ta_getGroupTable"; +static const char __pyx_k_CDL3WHITESOLDIERS[] = "CDL3WHITESOLDIERS"; +static const char __pyx_k_CDLDARKCLOUDCOVER[] = "CDLDARKCLOUDCOVER"; +static const char __pyx_k_CDLGRAVESTONEDOJI[] = "CDLGRAVESTONEDOJI"; +static const char __pyx_k_CDLINVERTEDHAMMER[] = "CDLINVERTEDHAMMER"; +static const char __pyx_k_CDLLONGLEGGEDDOJI[] = "CDLLONGLEGGEDDOJI"; +static const char __pyx_k_CDLSTALLEDPATTERN[] = "CDLSTALLEDPATTERN"; +static const char __pyx_k_Function__namestr[] = "_Function__namestr"; +static const char __pyx_k_Function__outputs[] = "_Function__outputs"; +static const char __pyx_k_Function_lookback[] = "Function.lookback"; +static const char __pyx_k_MA_Type___getitem[] = "MA_Type.__getitem__"; +static const char __pyx_k_TA_CDL3BLACKCROWS[] = "TA_CDL3BLACKCROWS"; +static const char __pyx_k_TA_CDL3LINESTRIKE[] = "TA_CDL3LINESTRIKE"; +static const char __pyx_k_TA_CDLEVENINGSTAR[] = "TA_CDLEVENINGSTAR"; +static const char __pyx_k_TA_CDLHARAMICROSS[] = "TA_CDLHARAMICROSS"; +static const char __pyx_k_TA_CDLMATCHINGLOW[] = "TA_CDLMATCHINGLOW"; +static const char __pyx_k_TA_CDLMORNINGSTAR[] = "TA_CDLMORNINGSTAR"; +static const char __pyx_k_TA_CDLRICKSHAWMAN[] = "TA_CDLRICKSHAWMAN"; +static const char __pyx_k_TA_CDLSPINNINGTOP[] = "TA_CDLSPINNINGTOP"; +static const char __pyx_k_TA_FUNCTION_NAMES[] = "__TA_FUNCTION_NAMES__"; +static const char __pyx_k_TA_FuncTableAlloc[] = "TA_FuncTableAlloc"; +static const char __pyx_k_TA_GroupTableFree[] = "TA_GroupTableFree"; +static const char __pyx_k_accelerationshort[] = "accelerationshort"; +static const char __pyx_k_flags_lookup_dict[] = "flags_lookup_dict"; +static const char __pyx_k_low_is_not_double[] = "low is not double"; +static const char __pyx_k_outaroondown_data[] = "outaroondown_data"; +static const char __pyx_k_outrealmiddleband[] = "outrealmiddleband"; +static const char __pyx_k_set_function_args[] = "set_function_args"; +static const char __pyx_k_stream_CDL3INSIDE[] = "stream_CDL3INSIDE"; +static const char __pyx_k_stream_CDLHIKKAKE[] = "stream_CDLHIKKAKE"; +static const char __pyx_k_stream_CDLKICKING[] = "stream_CDLKICKING"; +static const char __pyx_k_stream_CDLMATHOLD[] = "stream_CDLMATHOLD"; +static const char __pyx_k_stream_CDLTRISTAR[] = "stream_CDLTRISTAR"; +static const char __pyx_k_stream_HT_DCPHASE[] = "stream_HT_DCPHASE"; +static const char __pyx_k_CDLCLOSINGMARUBOZU[] = "CDLCLOSINGMARUBOZU"; +static const char __pyx_k_CDLEVENINGDOJISTAR[] = "CDLEVENINGDOJISTAR"; +static const char __pyx_k_CDLIDENTICAL3CROWS[] = "CDLIDENTICAL3CROWS"; +static const char __pyx_k_CDLKICKINGBYLENGTH[] = "CDLKICKINGBYLENGTH"; +static const char __pyx_k_CDLMORNINGDOJISTAR[] = "CDLMORNINGDOJISTAR"; +static const char __pyx_k_CDLSEPARATINGLINES[] = "CDLSEPARATINGLINES"; +static const char __pyx_k_CDLUPSIDEGAP2CROWS[] = "CDLUPSIDEGAP2CROWS"; +static const char __pyx_k_Function___unicode[] = "Function.__unicode__"; +static const char __pyx_k_INPUT_ARRAYS_TYPES[] = "__INPUT_ARRAYS_TYPES"; +static const char __pyx_k_Output_can_be_zero[] = "Output can be zero"; +static const char __pyx_k_TA_CDLADVANCEBLOCK[] = "TA_CDLADVANCEBLOCK"; +static const char __pyx_k_TA_CDLHOMINGPIGEON[] = "TA_CDLHOMINGPIGEON"; +static const char __pyx_k_TA_CDLLADDERBOTTOM[] = "TA_CDLLADDERBOTTOM"; +static const char __pyx_k_TA_CDLSHOOTINGSTAR[] = "TA_CDLSHOOTINGSTAR"; +static const char __pyx_k_TA_CDLUNIQUE3RIVER[] = "TA_CDLUNIQUE3RIVER"; +static const char __pyx_k_TA_GroupTableAlloc[] = "TA_GroupTableAlloc"; +static const char __pyx_k_TA_LINEARREG_ANGLE[] = "TA_LINEARREG_ANGLE"; +static const char __pyx_k_TA_LINEARREG_SLOPE[] = "TA_LINEARREG_SLOPE"; +static const char __pyx_k_TA_ParamHolderFree[] = "TA_ParamHolderFree"; +static const char __pyx_k_high_is_not_double[] = "high is not double"; +static const char __pyx_k_inputs_are_all_NaN[] = "inputs are all NaN"; +static const char __pyx_k_open_is_not_double[] = "open is not double"; +static const char __pyx_k_outmacdsignal_data[] = "outmacdsignal_data"; +static const char __pyx_k_outquadrature_data[] = "outquadrature_data"; +static const char __pyx_k_real_is_not_double[] = "real is not double"; +static const char __pyx_k_stream_CDL3OUTSIDE[] = "stream_CDL3OUTSIDE"; +static const char __pyx_k_stream_CDLBELTHOLD[] = "stream_CDLBELTHOLD"; +static const char __pyx_k_stream_CDLDOJISTAR[] = "stream_CDLDOJISTAR"; +static const char __pyx_k_stream_CDLHIGHWAVE[] = "stream_CDLHIGHWAVE"; +static const char __pyx_k_stream_CDLLONGLINE[] = "stream_CDLLONGLINE"; +static const char __pyx_k_stream_CDLMARUBOZU[] = "stream_CDLMARUBOZU"; +static const char __pyx_k_stream_CDLPIERCING[] = "stream_CDLPIERCING"; +static const char __pyx_k_stream_HT_DCPERIOD[] = "stream_HT_DCPERIOD"; +static const char __pyx_k_stream_MINMAXINDEX[] = "stream_MINMAXINDEX"; +static const char __pyx_k_CDLCONCEALBABYSWALL[] = "CDLCONCEALBABYSWALL"; +static const char __pyx_k_CDLGAPSIDESIDEWHITE[] = "CDLGAPSIDESIDEWHITE"; +static const char __pyx_k_CDLRISEFALL3METHODS[] = "CDLRISEFALL3METHODS"; +static const char __pyx_k_CDLXSIDEGAP3METHODS[] = "CDLXSIDEGAP3METHODS"; +static const char __pyx_k_LINEARREG_INTERCEPT[] = "LINEARREG_INTERCEPT"; +static const char __pyx_k_TA_CDL3STARSINSOUTH[] = "TA_CDL3STARSINSOUTH"; +static const char __pyx_k_TA_CDLABANDONEDBABY[] = "TA_CDLABANDONEDBABY"; +static const char __pyx_k_TA_CDLCOUNTERATTACK[] = "TA_CDLCOUNTERATTACK"; +static const char __pyx_k_TA_CDLDRAGONFLYDOJI[] = "TA_CDLDRAGONFLYDOJI"; +static const char __pyx_k_TA_CDLSTICKSANDWICH[] = "TA_CDLSTICKSANDWICH"; +static const char __pyx_k_TA_ParamHolderAlloc[] = "TA_ParamHolderAlloc"; +static const char __pyx_k_accelerationmaxlong[] = "accelerationmaxlong"; +static const char __pyx_k_close_is_not_double[] = "close is not double"; +static const char __pyx_k_get_opt_input_value[] = "__get_opt_input_value"; +static const char __pyx_k_real0_is_not_double[] = "real0 is not double"; +static const char __pyx_k_real1_is_not_double[] = "real1 is not double"; +static const char __pyx_k_stream_CDLBREAKAWAY[] = "stream_CDLBREAKAWAY"; +static const char __pyx_k_stream_CDLENGULFING[] = "stream_CDLENGULFING"; +static const char __pyx_k_stream_CDLSHORTLINE[] = "stream_CDLSHORTLINE"; +static const char __pyx_k_stream_CDLTASUKIGAP[] = "stream_CDLTASUKIGAP"; +static const char __pyx_k_stream_CDLTHRUSTING[] = "stream_CDLTHRUSTING"; +static const char __pyx_k_stream_HT_TRENDLINE[] = "stream_HT_TRENDLINE"; +static const char __pyx_k_stream_HT_TRENDMODE[] = "stream_HT_TRENDMODE"; +static const char __pyx_k_Function__opt_inputs[] = "_Function__opt_inputs"; +static const char __pyx_k_TA_CDL3WHITESOLDIERS[] = "TA_CDL3WHITESOLDIERS"; +static const char __pyx_k_TA_CDLDARKCLOUDCOVER[] = "TA_CDLDARKCLOUDCOVER"; +static const char __pyx_k_TA_CDLGRAVESTONEDOJI[] = "TA_CDLGRAVESTONEDOJI"; +static const char __pyx_k_TA_CDLINVERTEDHAMMER[] = "TA_CDLINVERTEDHAMMER"; +static const char __pyx_k_TA_CDLLONGLEGGEDDOJI[] = "TA_CDLLONGLEGGEDDOJI"; +static const char __pyx_k_TA_CDLSTALLEDPATTERN[] = "TA_CDLSTALLEDPATTERN"; +static const char __pyx_k_TA_SetUnstablePeriod[] = "TA_SetUnstablePeriod"; +static const char __pyx_k_accelerationinitlong[] = "accelerationinitlong"; +static const char __pyx_k_accelerationmaxshort[] = "accelerationmaxshort"; +static const char __pyx_k_stream_CDLHANGINGMAN[] = "stream_CDLHANGINGMAN"; +static const char __pyx_k_stream_CDLHIKKAKEMOD[] = "stream_CDLHIKKAKEMOD"; +static const char __pyx_k_volume_is_not_double[] = "volume is not double"; +static const char __pyx_k_Function__input_names[] = "_Function__input_names"; +static const char __pyx_k_Function_output_flags[] = "Function.output_flags"; +static const char __pyx_k_Function_output_names[] = "Function.output_names"; +static const char __pyx_k_INPUT_ARRAYS_DEFAULTS[] = "__INPUT_ARRAYS_DEFAULTS"; +static const char __pyx_k_Output_is_over_volume[] = "Output is over volume"; +static const char __pyx_k_Simple_Moving_Average[] = "Simple Moving Average"; +static const char __pyx_k_TA_CDLCLOSINGMARUBOZU[] = "TA_CDLCLOSINGMARUBOZU"; +static const char __pyx_k_TA_CDLEVENINGDOJISTAR[] = "TA_CDLEVENINGDOJISTAR"; +static const char __pyx_k_TA_CDLIDENTICAL3CROWS[] = "TA_CDLIDENTICAL3CROWS"; +static const char __pyx_k_TA_CDLKICKINGBYLENGTH[] = "TA_CDLKICKINGBYLENGTH"; +static const char __pyx_k_TA_CDLMORNINGDOJISTAR[] = "TA_CDLMORNINGDOJISTAR"; +static const char __pyx_k_TA_CDLSEPARATINGLINES[] = "TA_CDLSEPARATINGLINES"; +static const char __pyx_k_TA_CDLUPSIDEGAP2CROWS[] = "TA_CDLUPSIDEGAP2CROWS"; +static const char __pyx_k_accelerationinitshort[] = "accelerationinitshort"; +static const char __pyx_k_get_defaults_and_docs[] = "_get_defaults_and_docs"; +static const char __pyx_k_outreallowerband_data[] = "outreallowerband_data"; +static const char __pyx_k_outrealupperband_data[] = "outrealupperband_data"; +static const char __pyx_k_periods_is_not_double[] = "periods is not double"; +static const char __pyx_k_stream_CDL3BLACKCROWS[] = "stream_CDL3BLACKCROWS"; +static const char __pyx_k_stream_CDL3LINESTRIKE[] = "stream_CDL3LINESTRIKE"; +static const char __pyx_k_stream_CDLEVENINGSTAR[] = "stream_CDLEVENINGSTAR"; +static const char __pyx_k_stream_CDLHARAMICROSS[] = "stream_CDLHARAMICROSS"; +static const char __pyx_k_stream_CDLMATCHINGLOW[] = "stream_CDLMATCHINGLOW"; +static const char __pyx_k_stream_CDLMORNINGSTAR[] = "stream_CDLMORNINGSTAR"; +static const char __pyx_k_stream_CDLRICKSHAWMAN[] = "stream_CDLRICKSHAWMAN"; +static const char __pyx_k_stream_CDLSPINNINGTOP[] = "stream_CDLSPINNINGTOP"; +static const char __pyx_k_Function__input_arrays[] = "_Function__input_arrays"; +static const char __pyx_k_Output_can_be_negative[] = "Output can be negative"; +static const char __pyx_k_Output_can_be_positive[] = "Output can be positive"; +static const char __pyx_k_TA_CDLCONCEALBABYSWALL[] = "TA_CDLCONCEALBABYSWALL"; +static const char __pyx_k_TA_CDLGAPSIDESIDEWHITE[] = "TA_CDLGAPSIDESIDEWHITE"; +static const char __pyx_k_TA_CDLRISEFALL3METHODS[] = "TA_CDLRISEFALL3METHODS"; +static const char __pyx_k_TA_CDLXSIDEGAP3METHODS[] = "TA_CDLXSIDEGAP3METHODS"; +static const char __pyx_k_TA_LINEARREG_INTERCEPT[] = "TA_LINEARREG_INTERCEPT"; +static const char __pyx_k_display_name_s_group_s[] = "%(display_name)s (%(group)s)\n"; +static const char __pyx_k_outrealmiddleband_data[] = "outrealmiddleband_data"; +static const char __pyx_k_stream_CDLADVANCEBLOCK[] = "stream_CDLADVANCEBLOCK"; +static const char __pyx_k_stream_CDLHOMINGPIGEON[] = "stream_CDLHOMINGPIGEON"; +static const char __pyx_k_stream_CDLLADDERBOTTOM[] = "stream_CDLLADDERBOTTOM"; +static const char __pyx_k_stream_CDLSHOOTINGSTAR[] = "stream_CDLSHOOTINGSTAR"; +static const char __pyx_k_stream_CDLUNIQUE3RIVER[] = "stream_CDLUNIQUE3RIVER"; +static const char __pyx_k_stream_LINEARREG_ANGLE[] = "stream_LINEARREG_ANGLE"; +static const char __pyx_k_stream_LINEARREG_SLOPE[] = "stream_LINEARREG_SLOPE"; +static const char __pyx_k_ta_get_unstable_period[] = "_ta_get_unstable_period"; +static const char __pyx_k_ta_set_unstable_period[] = "_ta_set_unstable_period"; +static const char __pyx_k_Function__call_function[] = "_Function__call_function"; +static const char __pyx_k_Function__outputs_valid[] = "_Function__outputs_valid"; +static const char __pyx_k_Function_function_flags[] = "Function.function_flags"; +static const char __pyx_k_Function_get_parameters[] = "Function.get_parameters"; +static const char __pyx_k_Function_set_parameters[] = "Function.set_parameters"; +static const char __pyx_k_Output_is_a_candlestick[] = "Output is a candlestick"; +static const char __pyx_k_TA_SetOptInputParamReal[] = "TA_SetOptInputParamReal"; +static const char __pyx_k_Weighted_Moving_Average[] = "Weighted Moving Average"; +static const char __pyx_k_stream_CDL3STARSINSOUTH[] = "stream_CDL3STARSINSOUTH"; +static const char __pyx_k_stream_CDLABANDONEDBABY[] = "stream_CDLABANDONEDBABY"; +static const char __pyx_k_stream_CDLCOUNTERATTACK[] = "stream_CDLCOUNTERATTACK"; +static const char __pyx_k_stream_CDLDRAGONFLYDOJI[] = "stream_CDLDRAGONFLYDOJI"; +static const char __pyx_k_stream_CDLSTICKSANDWICH[] = "stream_CDLSTICKSANDWICH"; +static const char __pyx_k_Bad_Object_TA_BAD_OBJECT[] = "Bad Object (TA_BAD_OBJECT)"; +static const char __pyx_k_Function___call_function[] = "Function.__call_function"; +static const char __pyx_k_Function_get_input_names[] = "Function.get_input_names"; +static const char __pyx_k_Function_set_input_names[] = "Function.set_input_names"; +static const char __pyx_k_TA_GetInputParameterInfo[] = "TA_GetInputParameterInfo"; +static const char __pyx_k_initialize_function_info[] = "__initialize_function_info"; +static const char __pyx_k_input_price_series_names[] = "input_price_series_names"; +static const char __pyx_k_low_has_wrong_dimensions[] = "low has wrong dimensions"; +static const char __pyx_k_stream_CDL3WHITESOLDIERS[] = "stream_CDL3WHITESOLDIERS"; +static const char __pyx_k_stream_CDLDARKCLOUDCOVER[] = "stream_CDLDARKCLOUDCOVER"; +static const char __pyx_k_stream_CDLGRAVESTONEDOJI[] = "stream_CDLGRAVESTONEDOJI"; +static const char __pyx_k_stream_CDLINVERTEDHAMMER[] = "stream_CDLINVERTEDHAMMER"; +static const char __pyx_k_stream_CDLLONGLEGGEDDOJI[] = "stream_CDLLONGLEGGEDDOJI"; +static const char __pyx_k_stream_CDLSTALLEDPATTERN[] = "stream_CDLSTALLEDPATTERN"; +static const char __pyx_k_ta_getInputParameterInfo[] = "_ta_getInputParameterInfo"; +static const char __pyx_k_Function_get_input_arrays[] = "Function.get_input_arrays"; +static const char __pyx_k_Function_set_input_arrays[] = "Function.set_input_arrays"; +static const char __pyx_k_TA_GetOutputParameterInfo[] = "TA_GetOutputParameterInfo"; +static const char __pyx_k_Triangular_Moving_Average[] = "Triangular Moving Average"; +static const char __pyx_k_high_has_wrong_dimensions[] = "high has wrong dimensions"; +static const char __pyx_k_open_has_wrong_dimensions[] = "open has wrong dimensions"; +static const char __pyx_k_real_has_wrong_dimensions[] = "real has wrong dimensions"; +static const char __pyx_k_stream_CDLCLOSINGMARUBOZU[] = "stream_CDLCLOSINGMARUBOZU"; +static const char __pyx_k_stream_CDLEVENINGDOJISTAR[] = "stream_CDLEVENINGDOJISTAR"; +static const char __pyx_k_stream_CDLIDENTICAL3CROWS[] = "stream_CDLIDENTICAL3CROWS"; +static const char __pyx_k_stream_CDLKICKINGBYLENGTH[] = "stream_CDLKICKINGBYLENGTH"; +static const char __pyx_k_stream_CDLMORNINGDOJISTAR[] = "stream_CDLMORNINGDOJISTAR"; +static const char __pyx_k_stream_CDLSEPARATINGLINES[] = "stream_CDLSEPARATINGLINES"; +static const char __pyx_k_stream_CDLUPSIDEGAP2CROWS[] = "stream_CDLUPSIDEGAP2CROWS"; +static const char __pyx_k_ta_getOutputParameterInfo[] = "_ta_getOutputParameterInfo"; +static const char __pyx_k_Bad_Parameter_TA_BAD_PARAM[] = "Bad Parameter (TA_BAD_PARAM)"; +static const char __pyx_k_Exponential_Moving_Average[] = "Exponential Moving Average"; +static const char __pyx_k_Function_set_function_args[] = "Function.set_function_args"; +static const char __pyx_k_Output_scale_same_as_input[] = "Output scale same as input"; +static const char __pyx_k_TA_SetOptInputParamInteger[] = "TA_SetOptInputParamInteger"; +static const char __pyx_k_close_has_wrong_dimensions[] = "close has wrong dimensions"; +static const char __pyx_k_input_price_series_names_2[] = "__input_price_series_names"; +static const char __pyx_k_real0_has_wrong_dimensions[] = "real0 has wrong dimensions"; +static const char __pyx_k_real1_has_wrong_dimensions[] = "real1 has wrong dimensions"; +static const char __pyx_k_stream_CDLCONCEALBABYSWALL[] = "stream_CDLCONCEALBABYSWALL"; +static const char __pyx_k_stream_CDLGAPSIDESIDEWHITE[] = "stream_CDLGAPSIDESIDEWHITE"; +static const char __pyx_k_stream_CDLRISEFALL3METHODS[] = "stream_CDLRISEFALL3METHODS"; +static const char __pyx_k_stream_CDLXSIDEGAP3METHODS[] = "stream_CDLXSIDEGAP3METHODS"; +static const char __pyx_k_stream_LINEARREG_INTERCEPT[] = "stream_LINEARREG_INTERCEPT"; +static const char __pyx_k_INPUT_PRICE_SERIES_DEFAULTS[] = "__INPUT_PRICE_SERIES_DEFAULTS"; +static const char __pyx_k_TA_GetOptInputParameterInfo[] = "TA_GetOptInputParameterInfo"; +static const char __pyx_k_input_lengths_are_different[] = "input lengths are different"; +static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static const char __pyx_k_ta_getOptInputParameterInfo[] = "_ta_getOptInputParameterInfo"; +static const char __pyx_k_volume_has_wrong_dimensions[] = "volume has wrong dimensions"; +static const char __pyx_k_MESA_Adaptive_Moving_Average[] = "MESA Adaptive Moving Average"; +static const char __pyx_k_Unknown_Error_TA_UNKNOWN_ERR[] = "Unknown Error (TA_UNKNOWN_ERR)"; +static const char __pyx_k_periods_has_wrong_dimensions[] = "periods has wrong dimensions"; +static const char __pyx_k_Allocation_Error_TA_ALLOC_ERR[] = "Allocation Error (TA_ALLOC_ERR)"; +static const char __pyx_k_Function__get_opt_input_value[] = "_Function__get_opt_input_value"; +static const char __pyx_k_Function___get_opt_input_value[] = "Function.__get_opt_input_value"; +static const char __pyx_k_Not_Supported_TA_NOT_SUPPORTED[] = "Not Supported (TA_NOT_SUPPORTED)"; +static const char __pyx_k_Values_represent_a_lower_limit[] = "Values represent a lower limit"; +static const char __pyx_k_Function__initialize_function_i[] = "_Function__initialize_function_info"; +static const char __pyx_k_Function__input_price_series_na[] = "_Function__input_price_series_names"; +static const char __pyx_k_Function_has_an_unstable_period[] = "Function has an unstable period"; +static const char __pyx_k_Kaufman_Adaptive_Moving_Average[] = "Kaufman Adaptive Moving Average"; +static const char __pyx_k_Out_of_Range_Start_Index_TA_OUT[] = "Out-of-Range Start Index (TA_OUT_OF_RANGE_START_INDEX)"; +static const char __pyx_k_This_is_a_pythonic_wrapper_arou[] = "\n This is a pythonic wrapper around TALIB's abstract interface. It is\n intended to simplify using individual TALIB functions by providing a\n unified interface for setting/controlling input data, setting function\n parameters and retrieving results. Input data consists of a ``dict`` of\n ``numpy`` arrays (or a ``pandas.DataFrame``), one array for each of open,\n high, low, close and volume. This can be set with the set_input_arrays()\n method. Which keyed array(s) are used as inputs when calling the function\n is controlled using the input_names property.\n\n This class gets initialized with a TALIB function name and optionally an\n input_arrays object. It provides the following primary functions for\n setting inputs and retrieving results:\n\n ---- input_array/TA-function-parameter set-only functions -----\n - set_input_arrays(input_arrays)\n - set_function_args([input_arrays,] [param_args_andor_kwargs])\n\n Documentation for param_args_andor_kwargs can be seen by printing the\n Function instance or programatically via the info, input_names and\n parameters properties.\n\n ----- result-returning functions -----\n - the outputs property wraps a method which ensures results are always valid\n - run([input_arrays]) # calls set_input_arrays and returns self.outputs\n - FunctionInstance([input_arrays,] [param_args_andor_kwargs]) # calls set_function_args and returns self.outputs\n "; +static const char __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l[] = "/Users/kelvin/GitHub/mrjbq7/ta-lib/talib/_common.pxi"; +static const char __pyx_k_Values_represent_an_upper_limit[] = "Values represent an upper limit"; +static const char __pyx_k_integer_values_are_100_0_or_100[] = "integer (values are -100, 0 or 100)"; +static const char __pyx_k_s_function_failed_with_error_co[] = "%s function failed with error code %s: %s"; +static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static const char __pyx_k_Bull_Bear_Pattern_Bearish_0_Neut[] = "Bull/Bear Pattern (Bearish < 0, Neutral = 0, Bullish > 0)"; +static const char __pyx_k_Double_Exponential_Moving_Averag[] = "Double Exponential Moving Average"; +static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Function_Not_Found_TA_FUNC_NOT_F[] = "Function Not Found (TA_FUNC_NOT_FOUND)"; +static const char __pyx_k_Function___initialize_function_i[] = "Function.__initialize_function_info"; +static const char __pyx_k_Function___input_price_series_na[] = "Function.__input_price_series_names"; +static const char __pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU[] = "Group Not Found (TA_GROUP_NOT_FOUND)"; +static const char __pyx_k_Input_Not_All_Initialized_TA_INP[] = "Input Not All Initialized (TA_INPUT_NOT_ALL_INITIALIZE)"; +static const char __pyx_k_Internal_Error_TA_INTERNAL_ERROR[] = "Internal Error (TA_INTERNAL_ERROR)"; +static const char __pyx_k_Invalid_Handle_TA_INVALID_HANDLE[] = "Invalid Handle (TA_INVALID_HANDLE)"; +static const char __pyx_k_Invalid_List_Type_TA_INVALID_LIS[] = "Invalid List Type (TA_INVALID_LIST_TYPE)"; +static const char __pyx_k_Invalid_Parameter_Function_TA_IN[] = "Invalid Parameter Function (TA_INVALID_PARAM_FUNCTION)"; +static const char __pyx_k_Invalid_Parameter_Holder_TA_INVA[] = "Invalid Parameter Holder (TA_INVALID_PARAM_HOLDER)"; +static const char __pyx_k_Invalid_Parameter_Holder_Type_TA[] = "Invalid Parameter Holder Type (TA_INVALID_PARAM_HOLDER_TYPE)"; +static const char __pyx_k_Library_Not_Initialized_TA_LIB_N[] = "Library Not Initialized (TA_LIB_NOT_INITIALIZE)"; +static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static const char __pyx_k_Out_of_Range_End_Index_TA_OUT_OF[] = "Out-of-Range End Index (TA_OUT_OF_RANGE_END_INDEX)"; +static const char __pyx_k_Output_Not_All_Initialized_TA_OU[] = "Output Not All Initialized (TA_OUTPUT_NOT_ALL_INITIALIZE)"; +static const char __pyx_k_Strength_Pattern_200_100_Bearish[] = "Strength Pattern ([-200..-100] = Bearish, [-100..0] = Getting Bearish, 0 = Neutral, [0..100] = Getting Bullish, [100-200] = Bullish)"; +static const char __pyx_k_Triple_Exponential_Moving_Averag[] = "Triple Exponential Moving Average"; +static const char __pyx_k_Triple_Generalized_Double_Expone[] = "Triple Generalized Double Exponential Moving Average"; +static const char __pyx_k_input_arrays_parameter_missing_r[] = "input_arrays parameter missing required data key%s: %s"; +static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_2[] = "/Users/kelvin/GitHub/mrjbq7/ta-lib/talib/_func.pxi"; +static const char __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_3[] = "/Users/kelvin/GitHub/mrjbq7/ta-lib/talib/_abstract.pxi"; +static const char __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_4[] = "/Users/kelvin/GitHub/mrjbq7/ta-lib/talib/_stream.pxi"; +static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_s_3; +static PyObject *__pyx_n_s_ACOS; +static PyObject *__pyx_n_s_AD; +static PyObject *__pyx_n_s_ADD; +static PyObject *__pyx_n_s_ADOSC; +static PyObject *__pyx_n_s_ADX; +static PyObject *__pyx_n_s_ADXR; +static PyObject *__pyx_n_s_ALL; +static PyObject *__pyx_n_s_APO; +static PyObject *__pyx_n_s_AROON; +static PyObject *__pyx_n_s_AROONOSC; +static PyObject *__pyx_n_s_ASIN; +static PyObject *__pyx_n_s_ATAN; +static PyObject *__pyx_n_s_ATR; +static PyObject *__pyx_n_s_AVGPRICE; +static PyObject *__pyx_kp_s_Allocation_Error_TA_ALLOC_ERR; +static PyObject *__pyx_n_s_BBANDS; +static PyObject *__pyx_n_s_BETA; +static PyObject *__pyx_n_s_BOP; +static PyObject *__pyx_kp_s_Bad_Object_TA_BAD_OBJECT; +static PyObject *__pyx_kp_s_Bad_Parameter_TA_BAD_PARAM; +static PyObject *__pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut; +static PyObject *__pyx_n_s_CCI; +static PyObject *__pyx_n_s_CDL2CROWS; +static PyObject *__pyx_n_s_CDL3BLACKCROWS; +static PyObject *__pyx_n_s_CDL3INSIDE; +static PyObject *__pyx_n_s_CDL3LINESTRIKE; +static PyObject *__pyx_n_s_CDL3OUTSIDE; +static PyObject *__pyx_n_s_CDL3STARSINSOUTH; +static PyObject *__pyx_n_s_CDL3WHITESOLDIERS; +static PyObject *__pyx_n_s_CDLABANDONEDBABY; +static PyObject *__pyx_n_s_CDLADVANCEBLOCK; +static PyObject *__pyx_n_s_CDLBELTHOLD; +static PyObject *__pyx_n_s_CDLBREAKAWAY; +static PyObject *__pyx_n_s_CDLCLOSINGMARUBOZU; +static PyObject *__pyx_n_s_CDLCONCEALBABYSWALL; +static PyObject *__pyx_n_s_CDLCOUNTERATTACK; +static PyObject *__pyx_n_s_CDLDARKCLOUDCOVER; +static PyObject *__pyx_n_s_CDLDOJI; +static PyObject *__pyx_n_s_CDLDOJISTAR; +static PyObject *__pyx_n_s_CDLDRAGONFLYDOJI; +static PyObject *__pyx_n_s_CDLENGULFING; +static PyObject *__pyx_n_s_CDLEVENINGDOJISTAR; +static PyObject *__pyx_n_s_CDLEVENINGSTAR; +static PyObject *__pyx_n_s_CDLGAPSIDESIDEWHITE; +static PyObject *__pyx_n_s_CDLGRAVESTONEDOJI; +static PyObject *__pyx_n_s_CDLHAMMER; +static PyObject *__pyx_n_s_CDLHANGINGMAN; +static PyObject *__pyx_n_s_CDLHARAMI; +static PyObject *__pyx_n_s_CDLHARAMICROSS; +static PyObject *__pyx_n_s_CDLHIGHWAVE; +static PyObject *__pyx_n_s_CDLHIKKAKE; +static PyObject *__pyx_n_s_CDLHIKKAKEMOD; +static PyObject *__pyx_n_s_CDLHOMINGPIGEON; +static PyObject *__pyx_n_s_CDLIDENTICAL3CROWS; +static PyObject *__pyx_n_s_CDLINNECK; +static PyObject *__pyx_n_s_CDLINVERTEDHAMMER; +static PyObject *__pyx_n_s_CDLKICKING; +static PyObject *__pyx_n_s_CDLKICKINGBYLENGTH; +static PyObject *__pyx_n_s_CDLLADDERBOTTOM; +static PyObject *__pyx_n_s_CDLLONGLEGGEDDOJI; +static PyObject *__pyx_n_s_CDLLONGLINE; +static PyObject *__pyx_n_s_CDLMARUBOZU; +static PyObject *__pyx_n_s_CDLMATCHINGLOW; +static PyObject *__pyx_n_s_CDLMATHOLD; +static PyObject *__pyx_n_s_CDLMORNINGDOJISTAR; +static PyObject *__pyx_n_s_CDLMORNINGSTAR; +static PyObject *__pyx_n_s_CDLONNECK; +static PyObject *__pyx_n_s_CDLPIERCING; +static PyObject *__pyx_n_s_CDLRICKSHAWMAN; +static PyObject *__pyx_n_s_CDLRISEFALL3METHODS; +static PyObject *__pyx_n_s_CDLSEPARATINGLINES; +static PyObject *__pyx_n_s_CDLSHOOTINGSTAR; +static PyObject *__pyx_n_s_CDLSHORTLINE; +static PyObject *__pyx_n_s_CDLSPINNINGTOP; +static PyObject *__pyx_n_s_CDLSTALLEDPATTERN; +static PyObject *__pyx_n_s_CDLSTICKSANDWICH; +static PyObject *__pyx_n_s_CDLTAKURI; +static PyObject *__pyx_n_s_CDLTASUKIGAP; +static PyObject *__pyx_n_s_CDLTHRUSTING; +static PyObject *__pyx_n_s_CDLTRISTAR; +static PyObject *__pyx_n_s_CDLUNIQUE3RIVER; +static PyObject *__pyx_n_s_CDLUPSIDEGAP2CROWS; +static PyObject *__pyx_n_s_CDLXSIDEGAP3METHODS; +static PyObject *__pyx_n_s_CEIL; +static PyObject *__pyx_n_s_CMO; +static PyObject *__pyx_n_s_CORREL; +static PyObject *__pyx_n_s_COS; +static PyObject *__pyx_n_s_COSH; +static PyObject *__pyx_n_s_DEMA; +static PyObject *__pyx_n_s_DIV; +static PyObject *__pyx_n_s_DX; +static PyObject *__pyx_kp_s_Dashed_Line; +static PyObject *__pyx_n_s_DataFrame; +static PyObject *__pyx_n_s_Dot; +static PyObject *__pyx_kp_s_Dotted_Line; +static PyObject *__pyx_kp_s_Double_Exponential_Moving_Averag; +static PyObject *__pyx_n_s_EMA; +static PyObject *__pyx_n_s_EXP; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_s_Exponential_Moving_Average; +static PyObject *__pyx_n_s_FLOOR; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_Function; +static PyObject *__pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F; +static PyObject *__pyx_n_s_Function___call; +static PyObject *__pyx_n_s_Function___call_function; +static PyObject *__pyx_n_s_Function___get_opt_input_value; +static PyObject *__pyx_n_s_Function___init; +static PyObject *__pyx_n_s_Function___initialize_function_i; +static PyObject *__pyx_n_s_Function___input_price_series_na; +static PyObject *__pyx_n_s_Function___repr; +static PyObject *__pyx_n_s_Function___str; +static PyObject *__pyx_n_s_Function___unicode; +static PyObject *__pyx_n_s_Function__call_function; +static PyObject *__pyx_n_s_Function__get_opt_input_value; +static PyObject *__pyx_n_s_Function__info; +static PyObject *__pyx_n_s_Function__initialize_function_i; +static PyObject *__pyx_n_s_Function__input_arrays; +static PyObject *__pyx_n_s_Function__input_names; +static PyObject *__pyx_n_s_Function__input_price_series_na; +static PyObject *__pyx_n_s_Function__name; +static PyObject *__pyx_n_s_Function__namestr; +static PyObject *__pyx_n_s_Function__opt_inputs; +static PyObject *__pyx_n_s_Function__outputs; +static PyObject *__pyx_n_s_Function__outputs_valid; +static PyObject *__pyx_n_s_Function_function_flags; +static PyObject *__pyx_n_s_Function_get_input_arrays; +static PyObject *__pyx_n_s_Function_get_input_names; +static PyObject *__pyx_n_s_Function_get_parameters; +static PyObject *__pyx_kp_s_Function_has_an_unstable_period; +static PyObject *__pyx_n_s_Function_info; +static PyObject *__pyx_n_s_Function_lookback; +static PyObject *__pyx_n_s_Function_output_flags; +static PyObject *__pyx_n_s_Function_output_names; +static PyObject *__pyx_n_s_Function_outputs; +static PyObject *__pyx_n_s_Function_run; +static PyObject *__pyx_n_s_Function_set_function_args; +static PyObject *__pyx_n_s_Function_set_input_arrays; +static PyObject *__pyx_n_s_Function_set_input_names; +static PyObject *__pyx_n_s_Function_set_parameters; +static PyObject *__pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU; +static PyObject *__pyx_n_s_HT_DCPERIOD; +static PyObject *__pyx_n_s_HT_DCPHASE; +static PyObject *__pyx_n_s_HT_PHASOR; +static PyObject *__pyx_n_s_HT_SINE; +static PyObject *__pyx_n_s_HT_TRENDLINE; +static PyObject *__pyx_n_s_HT_TRENDMODE; +static PyObject *__pyx_n_s_Histogram; +static PyObject *__pyx_n_s_INPUT_ARRAYS_DEFAULTS; +static PyObject *__pyx_n_s_INPUT_ARRAYS_TYPES; +static PyObject *__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Input_Not_All_Initialized_TA_INP; +static PyObject *__pyx_kp_s_Inputs; +static PyObject *__pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR; +static PyObject *__pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE; +static PyObject *__pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS; +static PyObject *__pyx_kp_s_Invalid_Parameter_Function_TA_IN; +static PyObject *__pyx_kp_s_Invalid_Parameter_Holder_TA_INVA; +static PyObject *__pyx_kp_s_Invalid_Parameter_Holder_Type_TA; +static PyObject *__pyx_n_s_KAMA; +static PyObject *__pyx_kp_s_Kaufman_Adaptive_Moving_Average; +static PyObject *__pyx_n_s_LINEARREG; +static PyObject *__pyx_n_s_LINEARREG_ANGLE; +static PyObject *__pyx_n_s_LINEARREG_INTERCEPT; +static PyObject *__pyx_n_s_LINEARREG_SLOPE; +static PyObject *__pyx_n_s_LN; +static PyObject *__pyx_n_s_LOG10; +static PyObject *__pyx_kp_s_Library_Not_Initialized_TA_LIB_N; +static PyObject *__pyx_n_s_Line; +static PyObject *__pyx_n_s_MA; +static PyObject *__pyx_n_s_MACD; +static PyObject *__pyx_n_s_MACDEXT; +static PyObject *__pyx_n_s_MACDFIX; +static PyObject *__pyx_n_s_MAMA; +static PyObject *__pyx_n_s_MAVP; +static PyObject *__pyx_n_s_MAX; +static PyObject *__pyx_n_s_MAXINDEX; +static PyObject *__pyx_n_s_MA_Type; +static PyObject *__pyx_n_s_MA_Type___getitem; +static PyObject *__pyx_n_s_MA_Type___init; +static PyObject *__pyx_n_s_MEDPRICE; +static PyObject *__pyx_kp_s_MESA_Adaptive_Moving_Average; +static PyObject *__pyx_n_s_MFI; +static PyObject *__pyx_n_s_MIDPOINT; +static PyObject *__pyx_n_s_MIDPRICE; +static PyObject *__pyx_n_s_MIN; +static PyObject *__pyx_n_s_MININDEX; +static PyObject *__pyx_n_s_MINMAX; +static PyObject *__pyx_n_s_MINMAXINDEX; +static PyObject *__pyx_n_s_MINUS_DI; +static PyObject *__pyx_n_s_MINUS_DM; +static PyObject *__pyx_n_s_MOM; +static PyObject *__pyx_n_s_MULT; +static PyObject *__pyx_n_s_NATR; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED; +static PyObject *__pyx_n_s_OBV; +static PyObject *__pyx_n_s_OrderedDict; +static PyObject *__pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF; +static PyObject *__pyx_kp_s_Out_of_Range_Start_Index_TA_OUT; +static PyObject *__pyx_kp_s_Output_Not_All_Initialized_TA_OU; +static PyObject *__pyx_kp_s_Output_can_be_negative; +static PyObject *__pyx_kp_s_Output_can_be_positive; +static PyObject *__pyx_kp_s_Output_can_be_zero; +static PyObject *__pyx_kp_s_Output_is_a_candlestick; +static PyObject *__pyx_kp_s_Output_is_over_volume; +static PyObject *__pyx_kp_s_Output_scale_same_as_input; +static PyObject *__pyx_kp_s_Outputs; +static PyObject *__pyx_n_s_PANDAS_DATAFRAME; +static PyObject *__pyx_n_s_PANDAS_SERIES; +static PyObject *__pyx_n_s_PLUS_DI; +static PyObject *__pyx_n_s_PLUS_DM; +static PyObject *__pyx_n_s_PPO; +static PyObject *__pyx_kp_s_Parameters; +static PyObject *__pyx_kp_s_Pattern_Bool; +static PyObject *__pyx_n_s_ROC; +static PyObject *__pyx_n_s_ROCP; +static PyObject *__pyx_n_s_ROCR; +static PyObject *__pyx_n_s_ROCR100; +static PyObject *__pyx_n_s_RSI; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_SAR; +static PyObject *__pyx_n_s_SAREXT; +static PyObject *__pyx_n_s_SIN; +static PyObject *__pyx_n_s_SINH; +static PyObject *__pyx_n_s_SMA; +static PyObject *__pyx_n_s_SQRT; +static PyObject *__pyx_n_s_STDDEV; +static PyObject *__pyx_n_s_STOCH; +static PyObject *__pyx_n_s_STOCHF; +static PyObject *__pyx_n_s_STOCHRSI; +static PyObject *__pyx_n_s_SUB; +static PyObject *__pyx_n_s_SUM; +static PyObject *__pyx_n_s_Series; +static PyObject *__pyx_kp_s_Simple_Moving_Average; +static PyObject *__pyx_kp_s_Strength_Pattern_200_100_Bearish; +static PyObject *__pyx_n_s_Success; +static PyObject *__pyx_n_s_T3; +static PyObject *__pyx_n_s_TAN; +static PyObject *__pyx_n_s_TANH; +static PyObject *__pyx_n_s_TA_ACOS; +static PyObject *__pyx_n_s_TA_AD; +static PyObject *__pyx_n_s_TA_ADD; +static PyObject *__pyx_n_s_TA_ADOSC; +static PyObject *__pyx_n_s_TA_ADX; +static PyObject *__pyx_n_s_TA_ADXR; +static PyObject *__pyx_n_s_TA_APO; +static PyObject *__pyx_n_s_TA_AROON; +static PyObject *__pyx_n_s_TA_AROONOSC; +static PyObject *__pyx_n_s_TA_ASIN; +static PyObject *__pyx_n_s_TA_ATAN; +static PyObject *__pyx_n_s_TA_ATR; +static PyObject *__pyx_n_s_TA_AVGPRICE; +static PyObject *__pyx_n_s_TA_BBANDS; +static PyObject *__pyx_n_s_TA_BETA; +static PyObject *__pyx_n_s_TA_BOP; +static PyObject *__pyx_n_s_TA_CCI; +static PyObject *__pyx_n_s_TA_CDL2CROWS; +static PyObject *__pyx_n_s_TA_CDL3BLACKCROWS; +static PyObject *__pyx_n_s_TA_CDL3INSIDE; +static PyObject *__pyx_n_s_TA_CDL3LINESTRIKE; +static PyObject *__pyx_n_s_TA_CDL3OUTSIDE; +static PyObject *__pyx_n_s_TA_CDL3STARSINSOUTH; +static PyObject *__pyx_n_s_TA_CDL3WHITESOLDIERS; +static PyObject *__pyx_n_s_TA_CDLABANDONEDBABY; +static PyObject *__pyx_n_s_TA_CDLADVANCEBLOCK; +static PyObject *__pyx_n_s_TA_CDLBELTHOLD; +static PyObject *__pyx_n_s_TA_CDLBREAKAWAY; +static PyObject *__pyx_n_s_TA_CDLCLOSINGMARUBOZU; +static PyObject *__pyx_n_s_TA_CDLCONCEALBABYSWALL; +static PyObject *__pyx_n_s_TA_CDLCOUNTERATTACK; +static PyObject *__pyx_n_s_TA_CDLDARKCLOUDCOVER; +static PyObject *__pyx_n_s_TA_CDLDOJI; +static PyObject *__pyx_n_s_TA_CDLDOJISTAR; +static PyObject *__pyx_n_s_TA_CDLDRAGONFLYDOJI; +static PyObject *__pyx_n_s_TA_CDLENGULFING; +static PyObject *__pyx_n_s_TA_CDLEVENINGDOJISTAR; +static PyObject *__pyx_n_s_TA_CDLEVENINGSTAR; +static PyObject *__pyx_n_s_TA_CDLGAPSIDESIDEWHITE; +static PyObject *__pyx_n_s_TA_CDLGRAVESTONEDOJI; +static PyObject *__pyx_n_s_TA_CDLHAMMER; +static PyObject *__pyx_n_s_TA_CDLHANGINGMAN; +static PyObject *__pyx_n_s_TA_CDLHARAMI; +static PyObject *__pyx_n_s_TA_CDLHARAMICROSS; +static PyObject *__pyx_n_s_TA_CDLHIGHWAVE; +static PyObject *__pyx_n_s_TA_CDLHIKKAKE; +static PyObject *__pyx_n_s_TA_CDLHIKKAKEMOD; +static PyObject *__pyx_n_s_TA_CDLHOMINGPIGEON; +static PyObject *__pyx_n_s_TA_CDLIDENTICAL3CROWS; +static PyObject *__pyx_n_s_TA_CDLINNECK; +static PyObject *__pyx_n_s_TA_CDLINVERTEDHAMMER; +static PyObject *__pyx_n_s_TA_CDLKICKING; +static PyObject *__pyx_n_s_TA_CDLKICKINGBYLENGTH; +static PyObject *__pyx_n_s_TA_CDLLADDERBOTTOM; +static PyObject *__pyx_n_s_TA_CDLLONGLEGGEDDOJI; +static PyObject *__pyx_n_s_TA_CDLLONGLINE; +static PyObject *__pyx_n_s_TA_CDLMARUBOZU; +static PyObject *__pyx_n_s_TA_CDLMATCHINGLOW; +static PyObject *__pyx_n_s_TA_CDLMATHOLD; +static PyObject *__pyx_n_s_TA_CDLMORNINGDOJISTAR; +static PyObject *__pyx_n_s_TA_CDLMORNINGSTAR; +static PyObject *__pyx_n_s_TA_CDLONNECK; +static PyObject *__pyx_n_s_TA_CDLPIERCING; +static PyObject *__pyx_n_s_TA_CDLRICKSHAWMAN; +static PyObject *__pyx_n_s_TA_CDLRISEFALL3METHODS; +static PyObject *__pyx_n_s_TA_CDLSEPARATINGLINES; +static PyObject *__pyx_n_s_TA_CDLSHOOTINGSTAR; +static PyObject *__pyx_n_s_TA_CDLSHORTLINE; +static PyObject *__pyx_n_s_TA_CDLSPINNINGTOP; +static PyObject *__pyx_n_s_TA_CDLSTALLEDPATTERN; +static PyObject *__pyx_n_s_TA_CDLSTICKSANDWICH; +static PyObject *__pyx_n_s_TA_CDLTAKURI; +static PyObject *__pyx_n_s_TA_CDLTASUKIGAP; +static PyObject *__pyx_n_s_TA_CDLTHRUSTING; +static PyObject *__pyx_n_s_TA_CDLTRISTAR; +static PyObject *__pyx_n_s_TA_CDLUNIQUE3RIVER; +static PyObject *__pyx_n_s_TA_CDLUPSIDEGAP2CROWS; +static PyObject *__pyx_n_s_TA_CDLXSIDEGAP3METHODS; +static PyObject *__pyx_n_s_TA_CEIL; +static PyObject *__pyx_n_s_TA_CMO; +static PyObject *__pyx_n_s_TA_CORREL; +static PyObject *__pyx_n_s_TA_COS; +static PyObject *__pyx_n_s_TA_COSH; +static PyObject *__pyx_n_s_TA_DEMA; +static PyObject *__pyx_n_s_TA_DIV; +static PyObject *__pyx_n_s_TA_DX; +static PyObject *__pyx_n_s_TA_EMA; +static PyObject *__pyx_n_s_TA_EXP; +static PyObject *__pyx_n_s_TA_FLOOR; +static PyObject *__pyx_n_s_TA_FUNCTION_NAMES; +static PyObject *__pyx_n_s_TA_FUNC_FLAGS; +static PyObject *__pyx_n_s_TA_FuncTableAlloc; +static PyObject *__pyx_n_s_TA_FuncTableFree; +static PyObject *__pyx_n_s_TA_GetFuncHandle; +static PyObject *__pyx_n_s_TA_GetFuncInfo; +static PyObject *__pyx_n_s_TA_GetInputParameterInfo; +static PyObject *__pyx_n_s_TA_GetLookback; +static PyObject *__pyx_n_s_TA_GetOptInputParameterInfo; +static PyObject *__pyx_n_s_TA_GetOutputParameterInfo; +static PyObject *__pyx_n_s_TA_GroupTableAlloc; +static PyObject *__pyx_n_s_TA_GroupTableFree; +static PyObject *__pyx_n_s_TA_HT_DCPERIOD; +static PyObject *__pyx_n_s_TA_HT_DCPHASE; +static PyObject *__pyx_n_s_TA_HT_PHASOR; +static PyObject *__pyx_n_s_TA_HT_SINE; +static PyObject *__pyx_n_s_TA_HT_TRENDLINE; +static PyObject *__pyx_n_s_TA_HT_TRENDMODE; +static PyObject *__pyx_n_s_TA_INPUT_FLAGS; +static PyObject *__pyx_n_s_TA_Initialize; +static PyObject *__pyx_n_s_TA_KAMA; +static PyObject *__pyx_n_s_TA_LINEARREG; +static PyObject *__pyx_n_s_TA_LINEARREG_ANGLE; +static PyObject *__pyx_n_s_TA_LINEARREG_INTERCEPT; +static PyObject *__pyx_n_s_TA_LINEARREG_SLOPE; +static PyObject *__pyx_n_s_TA_LN; +static PyObject *__pyx_n_s_TA_LOG10; +static PyObject *__pyx_n_s_TA_MA; +static PyObject *__pyx_n_s_TA_MACD; +static PyObject *__pyx_n_s_TA_MACDEXT; +static PyObject *__pyx_n_s_TA_MACDFIX; +static PyObject *__pyx_n_s_TA_MAMA; +static PyObject *__pyx_n_s_TA_MAVP; +static PyObject *__pyx_n_s_TA_MAX; +static PyObject *__pyx_n_s_TA_MAXINDEX; +static PyObject *__pyx_n_s_TA_MEDPRICE; +static PyObject *__pyx_n_s_TA_MFI; +static PyObject *__pyx_n_s_TA_MIDPOINT; +static PyObject *__pyx_n_s_TA_MIDPRICE; +static PyObject *__pyx_n_s_TA_MIN; +static PyObject *__pyx_n_s_TA_MININDEX; +static PyObject *__pyx_n_s_TA_MINMAX; +static PyObject *__pyx_n_s_TA_MINMAXINDEX; +static PyObject *__pyx_n_s_TA_MINUS_DI; +static PyObject *__pyx_n_s_TA_MINUS_DM; +static PyObject *__pyx_n_s_TA_MOM; +static PyObject *__pyx_n_s_TA_MULT; +static PyObject *__pyx_n_s_TA_NATR; +static PyObject *__pyx_n_s_TA_OBV; +static PyObject *__pyx_n_s_TA_OUTPUT_FLAGS; +static PyObject *__pyx_n_s_TA_PLUS_DI; +static PyObject *__pyx_n_s_TA_PLUS_DM; +static PyObject *__pyx_n_s_TA_PPO; +static PyObject *__pyx_n_s_TA_ParamHolderAlloc; +static PyObject *__pyx_n_s_TA_ParamHolderFree; +static PyObject *__pyx_n_s_TA_ROC; +static PyObject *__pyx_n_s_TA_ROCP; +static PyObject *__pyx_n_s_TA_ROCR; +static PyObject *__pyx_n_s_TA_ROCR100; +static PyObject *__pyx_n_s_TA_RSI; +static PyObject *__pyx_n_s_TA_SAR; +static PyObject *__pyx_n_s_TA_SAREXT; +static PyObject *__pyx_n_s_TA_SIN; +static PyObject *__pyx_n_s_TA_SINH; +static PyObject *__pyx_n_s_TA_SMA; +static PyObject *__pyx_n_s_TA_SQRT; +static PyObject *__pyx_n_s_TA_STDDEV; +static PyObject *__pyx_n_s_TA_STOCH; +static PyObject *__pyx_n_s_TA_STOCHF; +static PyObject *__pyx_n_s_TA_STOCHRSI; +static PyObject *__pyx_n_s_TA_SUB; +static PyObject *__pyx_n_s_TA_SUM; +static PyObject *__pyx_n_s_TA_SetOptInputParamInteger; +static PyObject *__pyx_n_s_TA_SetOptInputParamReal; +static PyObject *__pyx_n_s_TA_SetUnstablePeriod; +static PyObject *__pyx_n_s_TA_Shutdown; +static PyObject *__pyx_n_s_TA_T3; +static PyObject *__pyx_n_s_TA_TAN; +static PyObject *__pyx_n_s_TA_TANH; +static PyObject *__pyx_n_s_TA_TEMA; +static PyObject *__pyx_n_s_TA_TRANGE; +static PyObject *__pyx_n_s_TA_TRIMA; +static PyObject *__pyx_n_s_TA_TRIX; +static PyObject *__pyx_n_s_TA_TSF; +static PyObject *__pyx_n_s_TA_TYPPRICE; +static PyObject *__pyx_n_s_TA_ULTOSC; +static PyObject *__pyx_n_s_TA_VAR; +static PyObject *__pyx_n_s_TA_WCLPRICE; +static PyObject *__pyx_n_s_TA_WILLR; +static PyObject *__pyx_n_s_TA_WMA; +static PyObject *__pyx_n_s_TEMA; +static PyObject *__pyx_n_s_TRANGE; +static PyObject *__pyx_n_s_TRIMA; +static PyObject *__pyx_n_s_TRIX; +static PyObject *__pyx_n_s_TSF; +static PyObject *__pyx_n_s_TYPPRICE; +static PyObject *__pyx_kp_s_This_is_a_pythonic_wrapper_arou; +static PyObject *__pyx_kp_s_Triangular_Moving_Average; +static PyObject *__pyx_kp_s_Triple_Exponential_Moving_Averag; +static PyObject *__pyx_kp_s_Triple_Generalized_Double_Expone; +static PyObject *__pyx_n_s_ULTOSC; +static PyObject *__pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR; +static PyObject *__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l; +static PyObject *__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2; +static PyObject *__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3; +static PyObject *__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4; +static PyObject *__pyx_n_s_VAR; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_Values_represent_a_lower_limit; +static PyObject *__pyx_kp_s_Values_represent_an_upper_limit; +static PyObject *__pyx_n_s_WCLPRICE; +static PyObject *__pyx_n_s_WILLR; +static PyObject *__pyx_n_s_WMA; +static PyObject *__pyx_kp_s_Weighted_Moving_Average; +static PyObject *__pyx_kp_s__1211; +static PyObject *__pyx_kp_s__1212; +static PyObject *__pyx_kp_s__1214; +static PyObject *__pyx_kp_s__1215; +static PyObject *__pyx_kp_s__1216; +static PyObject *__pyx_kp_s__1217; +static PyObject *__pyx_n_s_acceleration; +static PyObject *__pyx_n_s_accelerationinitlong; +static PyObject *__pyx_n_s_accelerationinitshort; +static PyObject *__pyx_n_s_accelerationlong; +static PyObject *__pyx_n_s_accelerationmaxlong; +static PyObject *__pyx_n_s_accelerationmaxshort; +static PyObject *__pyx_n_s_accelerationshort; +static PyObject *__pyx_kp_s_any_ndarray; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_ascii; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_begidx; +static PyObject *__pyx_n_s_bytes2str; +static PyObject *__pyx_n_s_call; +static PyObject *__pyx_n_s_call_function; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_close_data; +static PyObject *__pyx_kp_s_close_has_wrong_dimensions; +static PyObject *__pyx_kp_s_close_is_not_double; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_column_stack; +static PyObject *__pyx_n_s_columns; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_default_value; +static PyObject *__pyx_n_s_defaults; +static PyObject *__pyx_n_s_display_name; +static PyObject *__pyx_kp_s_display_name_s_group_s; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_docs; +static PyObject *__pyx_n_s_documentation; +static PyObject *__pyx_n_s_endidx; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_fastd_matype; +static PyObject *__pyx_n_s_fastd_period; +static PyObject *__pyx_n_s_fastk_period; +static PyObject *__pyx_n_s_fastlimit; +static PyObject *__pyx_n_s_fastmatype; +static PyObject *__pyx_n_s_fastperiod; +static PyObject *__pyx_n_s_flag; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_flags_lookup_dict; +static PyObject *__pyx_n_s_func_args; +static PyObject *__pyx_n_s_func_info; +static PyObject *__pyx_n_s_func_line; +static PyObject *__pyx_n_s_func_object; +static PyObject *__pyx_n_s_function_flags; +static PyObject *__pyx_n_s_function_name; +static PyObject *__pyx_n_s_functions; +static PyObject *__pyx_n_s_get_defaults_and_docs; +static PyObject *__pyx_n_s_get_flags; +static PyObject *__pyx_n_s_get_input_arrays; +static PyObject *__pyx_n_s_get_input_names; +static PyObject *__pyx_n_s_get_opt_input_value; +static PyObject *__pyx_n_s_get_parameters; +static PyObject *__pyx_n_s_getitem; +static PyObject *__pyx_n_s_group; +static PyObject *__pyx_n_s_groups; +static PyObject *__pyx_n_s_help; +static PyObject *__pyx_n_s_high; +static PyObject *__pyx_n_s_high_data; +static PyObject *__pyx_kp_s_high_has_wrong_dimensions; +static PyObject *__pyx_kp_s_high_is_not_double; +static PyObject *__pyx_n_s_holder; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_in; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_info; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_initialize_function_info; +static PyObject *__pyx_n_s_input_arrays; +static PyObject *__pyx_kp_s_input_arrays_2; +static PyObject *__pyx_kp_s_input_arrays_parameter_missing_r; +static PyObject *__pyx_kp_s_input_lengths_are_different; +static PyObject *__pyx_n_s_input_name; +static PyObject *__pyx_n_s_input_names; +static PyObject *__pyx_n_s_input_price_series_names; +static PyObject *__pyx_n_s_input_price_series_names_2; +static PyObject *__pyx_kp_s_inputs_are_all_NaN; +static PyObject *__pyx_n_s_integer; +static PyObject *__pyx_kp_s_integer_values_are_100_0_or_100; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_log; +static PyObject *__pyx_n_s_lookback; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_low; +static PyObject *__pyx_n_s_low_data; +static PyObject *__pyx_kp_s_low_has_wrong_dimensions; +static PyObject *__pyx_kp_s_low_is_not_double; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_math; +static PyObject *__pyx_n_s_matype; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_int; +static PyObject *__pyx_n_s_maximum; +static PyObject *__pyx_n_s_maxperiod; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_min_int; +static PyObject *__pyx_n_s_minperiod; +static PyObject *__pyx_n_s_missing_keys; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nbdev; +static PyObject *__pyx_n_s_nbdevdn; +static PyObject *__pyx_n_s_nbdevup; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_num_inputs; +static PyObject *__pyx_n_s_num_opt_inputs; +static PyObject *__pyx_n_s_num_outputs; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_offsetonreverse; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_openInterest; +static PyObject *__pyx_n_s_open_data; +static PyObject *__pyx_kp_s_open_has_wrong_dimensions; +static PyObject *__pyx_kp_s_open_is_not_double; +static PyObject *__pyx_n_s_optIn; +static PyObject *__pyx_n_s_opt_input; +static PyObject *__pyx_n_s_ordereddict; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_outaroondown; +static PyObject *__pyx_n_s_outaroondown_data; +static PyObject *__pyx_n_s_outaroonup; +static PyObject *__pyx_n_s_outaroonup_data; +static PyObject *__pyx_n_s_outbegidx; +static PyObject *__pyx_n_s_outfama; +static PyObject *__pyx_n_s_outfama_data; +static PyObject *__pyx_n_s_outfastd; +static PyObject *__pyx_n_s_outfastd_data; +static PyObject *__pyx_n_s_outfastk; +static PyObject *__pyx_n_s_outfastk_data; +static PyObject *__pyx_n_s_outinphase; +static PyObject *__pyx_n_s_outinphase_data; +static PyObject *__pyx_n_s_outinteger; +static PyObject *__pyx_n_s_outinteger_data; +static PyObject *__pyx_n_s_outleadsine; +static PyObject *__pyx_n_s_outleadsine_data; +static PyObject *__pyx_n_s_outmacd; +static PyObject *__pyx_n_s_outmacd_data; +static PyObject *__pyx_n_s_outmacdhist; +static PyObject *__pyx_n_s_outmacdhist_data; +static PyObject *__pyx_n_s_outmacdsignal; +static PyObject *__pyx_n_s_outmacdsignal_data; +static PyObject *__pyx_n_s_outmama; +static PyObject *__pyx_n_s_outmama_data; +static PyObject *__pyx_n_s_outmax; +static PyObject *__pyx_n_s_outmax_data; +static PyObject *__pyx_n_s_outmaxidx; +static PyObject *__pyx_n_s_outmaxidx_data; +static PyObject *__pyx_n_s_outmin; +static PyObject *__pyx_n_s_outmin_data; +static PyObject *__pyx_n_s_outminidx; +static PyObject *__pyx_n_s_outminidx_data; +static PyObject *__pyx_n_s_outnbelement; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_output_flags; +static PyObject *__pyx_n_s_output_name; +static PyObject *__pyx_n_s_output_names; +static PyObject *__pyx_n_s_outputs; +static PyObject *__pyx_n_s_outquadrature; +static PyObject *__pyx_n_s_outquadrature_data; +static PyObject *__pyx_n_s_outreal; +static PyObject *__pyx_n_s_outreal_data; +static PyObject *__pyx_n_s_outreallowerband; +static PyObject *__pyx_n_s_outreallowerband_data; +static PyObject *__pyx_n_s_outrealmiddleband; +static PyObject *__pyx_n_s_outrealmiddleband_data; +static PyObject *__pyx_n_s_outrealupperband; +static PyObject *__pyx_n_s_outrealupperband_data; +static PyObject *__pyx_n_s_outsine; +static PyObject *__pyx_n_s_outsine_data; +static PyObject *__pyx_n_s_outslowd; +static PyObject *__pyx_n_s_outslowd_data; +static PyObject *__pyx_n_s_outslowk; +static PyObject *__pyx_n_s_outslowk_data; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_param; +static PyObject *__pyx_n_s_param_name; +static PyObject *__pyx_n_s_parameters; +static PyObject *__pyx_n_s_params; +static PyObject *__pyx_n_s_penetration; +static PyObject *__pyx_n_s_period; +static PyObject *__pyx_n_s_periods; +static PyObject *__pyx_n_s_periods_data; +static PyObject *__pyx_kp_s_periods_has_wrong_dimensions; +static PyObject *__pyx_kp_s_periods_is_not_double; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_price; +static PyObject *__pyx_n_s_price0; +static PyObject *__pyx_n_s_price1; +static PyObject *__pyx_n_s_price_series; +static PyObject *__pyx_n_s_prices; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_real; +static PyObject *__pyx_n_s_real0; +static PyObject *__pyx_n_s_real0_data; +static PyObject *__pyx_kp_s_real0_has_wrong_dimensions; +static PyObject *__pyx_kp_s_real0_is_not_double; +static PyObject *__pyx_n_s_real1; +static PyObject *__pyx_n_s_real1_data; +static PyObject *__pyx_kp_s_real1_has_wrong_dimensions; +static PyObject *__pyx_kp_s_real1_is_not_double; +static PyObject *__pyx_n_s_real_data; +static PyObject *__pyx_kp_s_real_has_wrong_dimensions; +static PyObject *__pyx_kp_s_real_is_not_double; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_results; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_retCode; +static PyObject *__pyx_n_s_ret_code; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_kp_s_s_2; +static PyObject *__pyx_kp_s_s_3; +static PyObject *__pyx_kp_s_s_4; +static PyObject *__pyx_kp_s_s_function_failed_with_error_co; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_2; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_series; +static PyObject *__pyx_n_s_set_function_args; +static PyObject *__pyx_n_s_set_input_arrays; +static PyObject *__pyx_n_s_set_input_names; +static PyObject *__pyx_n_s_set_parameters; +static PyObject *__pyx_n_s_signalmatype; +static PyObject *__pyx_n_s_signalperiod; +static PyObject *__pyx_n_s_skip_first; +static PyObject *__pyx_n_s_slowd_matype; +static PyObject *__pyx_n_s_slowd_period; +static PyObject *__pyx_n_s_slowk_matype; +static PyObject *__pyx_n_s_slowk_period; +static PyObject *__pyx_n_s_slowlimit; +static PyObject *__pyx_n_s_slowmatype; +static PyObject *__pyx_n_s_slowperiod; +static PyObject *__pyx_n_s_startvalue; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_str2bytes; +static PyObject *__pyx_n_s_stream_ACOS; +static PyObject *__pyx_n_s_stream_AD; +static PyObject *__pyx_n_s_stream_ADD; +static PyObject *__pyx_n_s_stream_ADOSC; +static PyObject *__pyx_n_s_stream_ADX; +static PyObject *__pyx_n_s_stream_ADXR; +static PyObject *__pyx_n_s_stream_APO; +static PyObject *__pyx_n_s_stream_AROON; +static PyObject *__pyx_n_s_stream_AROONOSC; +static PyObject *__pyx_n_s_stream_ASIN; +static PyObject *__pyx_n_s_stream_ATAN; +static PyObject *__pyx_n_s_stream_ATR; +static PyObject *__pyx_n_s_stream_AVGPRICE; +static PyObject *__pyx_n_s_stream_BBANDS; +static PyObject *__pyx_n_s_stream_BETA; +static PyObject *__pyx_n_s_stream_BOP; +static PyObject *__pyx_n_s_stream_CCI; +static PyObject *__pyx_n_s_stream_CDL2CROWS; +static PyObject *__pyx_n_s_stream_CDL3BLACKCROWS; +static PyObject *__pyx_n_s_stream_CDL3INSIDE; +static PyObject *__pyx_n_s_stream_CDL3LINESTRIKE; +static PyObject *__pyx_n_s_stream_CDL3OUTSIDE; +static PyObject *__pyx_n_s_stream_CDL3STARSINSOUTH; +static PyObject *__pyx_n_s_stream_CDL3WHITESOLDIERS; +static PyObject *__pyx_n_s_stream_CDLABANDONEDBABY; +static PyObject *__pyx_n_s_stream_CDLADVANCEBLOCK; +static PyObject *__pyx_n_s_stream_CDLBELTHOLD; +static PyObject *__pyx_n_s_stream_CDLBREAKAWAY; +static PyObject *__pyx_n_s_stream_CDLCLOSINGMARUBOZU; +static PyObject *__pyx_n_s_stream_CDLCONCEALBABYSWALL; +static PyObject *__pyx_n_s_stream_CDLCOUNTERATTACK; +static PyObject *__pyx_n_s_stream_CDLDARKCLOUDCOVER; +static PyObject *__pyx_n_s_stream_CDLDOJI; +static PyObject *__pyx_n_s_stream_CDLDOJISTAR; +static PyObject *__pyx_n_s_stream_CDLDRAGONFLYDOJI; +static PyObject *__pyx_n_s_stream_CDLENGULFING; +static PyObject *__pyx_n_s_stream_CDLEVENINGDOJISTAR; +static PyObject *__pyx_n_s_stream_CDLEVENINGSTAR; +static PyObject *__pyx_n_s_stream_CDLGAPSIDESIDEWHITE; +static PyObject *__pyx_n_s_stream_CDLGRAVESTONEDOJI; +static PyObject *__pyx_n_s_stream_CDLHAMMER; +static PyObject *__pyx_n_s_stream_CDLHANGINGMAN; +static PyObject *__pyx_n_s_stream_CDLHARAMI; +static PyObject *__pyx_n_s_stream_CDLHARAMICROSS; +static PyObject *__pyx_n_s_stream_CDLHIGHWAVE; +static PyObject *__pyx_n_s_stream_CDLHIKKAKE; +static PyObject *__pyx_n_s_stream_CDLHIKKAKEMOD; +static PyObject *__pyx_n_s_stream_CDLHOMINGPIGEON; +static PyObject *__pyx_n_s_stream_CDLIDENTICAL3CROWS; +static PyObject *__pyx_n_s_stream_CDLINNECK; +static PyObject *__pyx_n_s_stream_CDLINVERTEDHAMMER; +static PyObject *__pyx_n_s_stream_CDLKICKING; +static PyObject *__pyx_n_s_stream_CDLKICKINGBYLENGTH; +static PyObject *__pyx_n_s_stream_CDLLADDERBOTTOM; +static PyObject *__pyx_n_s_stream_CDLLONGLEGGEDDOJI; +static PyObject *__pyx_n_s_stream_CDLLONGLINE; +static PyObject *__pyx_n_s_stream_CDLMARUBOZU; +static PyObject *__pyx_n_s_stream_CDLMATCHINGLOW; +static PyObject *__pyx_n_s_stream_CDLMATHOLD; +static PyObject *__pyx_n_s_stream_CDLMORNINGDOJISTAR; +static PyObject *__pyx_n_s_stream_CDLMORNINGSTAR; +static PyObject *__pyx_n_s_stream_CDLONNECK; +static PyObject *__pyx_n_s_stream_CDLPIERCING; +static PyObject *__pyx_n_s_stream_CDLRICKSHAWMAN; +static PyObject *__pyx_n_s_stream_CDLRISEFALL3METHODS; +static PyObject *__pyx_n_s_stream_CDLSEPARATINGLINES; +static PyObject *__pyx_n_s_stream_CDLSHOOTINGSTAR; +static PyObject *__pyx_n_s_stream_CDLSHORTLINE; +static PyObject *__pyx_n_s_stream_CDLSPINNINGTOP; +static PyObject *__pyx_n_s_stream_CDLSTALLEDPATTERN; +static PyObject *__pyx_n_s_stream_CDLSTICKSANDWICH; +static PyObject *__pyx_n_s_stream_CDLTAKURI; +static PyObject *__pyx_n_s_stream_CDLTASUKIGAP; +static PyObject *__pyx_n_s_stream_CDLTHRUSTING; +static PyObject *__pyx_n_s_stream_CDLTRISTAR; +static PyObject *__pyx_n_s_stream_CDLUNIQUE3RIVER; +static PyObject *__pyx_n_s_stream_CDLUPSIDEGAP2CROWS; +static PyObject *__pyx_n_s_stream_CDLXSIDEGAP3METHODS; +static PyObject *__pyx_n_s_stream_CEIL; +static PyObject *__pyx_n_s_stream_CMO; +static PyObject *__pyx_n_s_stream_CORREL; +static PyObject *__pyx_n_s_stream_COS; +static PyObject *__pyx_n_s_stream_COSH; +static PyObject *__pyx_n_s_stream_DEMA; +static PyObject *__pyx_n_s_stream_DIV; +static PyObject *__pyx_n_s_stream_DX; +static PyObject *__pyx_n_s_stream_EMA; +static PyObject *__pyx_n_s_stream_EXP; +static PyObject *__pyx_n_s_stream_FLOOR; +static PyObject *__pyx_n_s_stream_HT_DCPERIOD; +static PyObject *__pyx_n_s_stream_HT_DCPHASE; +static PyObject *__pyx_n_s_stream_HT_PHASOR; +static PyObject *__pyx_n_s_stream_HT_SINE; +static PyObject *__pyx_n_s_stream_HT_TRENDLINE; +static PyObject *__pyx_n_s_stream_HT_TRENDMODE; +static PyObject *__pyx_n_s_stream_KAMA; +static PyObject *__pyx_n_s_stream_LINEARREG; +static PyObject *__pyx_n_s_stream_LINEARREG_ANGLE; +static PyObject *__pyx_n_s_stream_LINEARREG_INTERCEPT; +static PyObject *__pyx_n_s_stream_LINEARREG_SLOPE; +static PyObject *__pyx_n_s_stream_LN; +static PyObject *__pyx_n_s_stream_LOG10; +static PyObject *__pyx_n_s_stream_MA; +static PyObject *__pyx_n_s_stream_MACD; +static PyObject *__pyx_n_s_stream_MACDEXT; +static PyObject *__pyx_n_s_stream_MACDFIX; +static PyObject *__pyx_n_s_stream_MAMA; +static PyObject *__pyx_n_s_stream_MAVP; +static PyObject *__pyx_n_s_stream_MAX; +static PyObject *__pyx_n_s_stream_MAXINDEX; +static PyObject *__pyx_n_s_stream_MEDPRICE; +static PyObject *__pyx_n_s_stream_MFI; +static PyObject *__pyx_n_s_stream_MIDPOINT; +static PyObject *__pyx_n_s_stream_MIDPRICE; +static PyObject *__pyx_n_s_stream_MIN; +static PyObject *__pyx_n_s_stream_MININDEX; +static PyObject *__pyx_n_s_stream_MINMAX; +static PyObject *__pyx_n_s_stream_MINMAXINDEX; +static PyObject *__pyx_n_s_stream_MINUS_DI; +static PyObject *__pyx_n_s_stream_MINUS_DM; +static PyObject *__pyx_n_s_stream_MOM; +static PyObject *__pyx_n_s_stream_MULT; +static PyObject *__pyx_n_s_stream_NATR; +static PyObject *__pyx_n_s_stream_OBV; +static PyObject *__pyx_n_s_stream_PLUS_DI; +static PyObject *__pyx_n_s_stream_PLUS_DM; +static PyObject *__pyx_n_s_stream_PPO; +static PyObject *__pyx_n_s_stream_ROC; +static PyObject *__pyx_n_s_stream_ROCP; +static PyObject *__pyx_n_s_stream_ROCR; +static PyObject *__pyx_n_s_stream_ROCR100; +static PyObject *__pyx_n_s_stream_RSI; +static PyObject *__pyx_n_s_stream_SAR; +static PyObject *__pyx_n_s_stream_SAREXT; +static PyObject *__pyx_n_s_stream_SIN; +static PyObject *__pyx_n_s_stream_SINH; +static PyObject *__pyx_n_s_stream_SMA; +static PyObject *__pyx_n_s_stream_SQRT; +static PyObject *__pyx_n_s_stream_STDDEV; +static PyObject *__pyx_n_s_stream_STOCH; +static PyObject *__pyx_n_s_stream_STOCHF; +static PyObject *__pyx_n_s_stream_STOCHRSI; +static PyObject *__pyx_n_s_stream_SUB; +static PyObject *__pyx_n_s_stream_SUM; +static PyObject *__pyx_n_s_stream_T3; +static PyObject *__pyx_n_s_stream_TAN; +static PyObject *__pyx_n_s_stream_TANH; +static PyObject *__pyx_n_s_stream_TEMA; +static PyObject *__pyx_n_s_stream_TRANGE; +static PyObject *__pyx_n_s_stream_TRIMA; +static PyObject *__pyx_n_s_stream_TRIX; +static PyObject *__pyx_n_s_stream_TSF; +static PyObject *__pyx_n_s_stream_TYPPRICE; +static PyObject *__pyx_n_s_stream_ULTOSC; +static PyObject *__pyx_n_s_stream_VAR; +static PyObject *__pyx_n_s_stream_WCLPRICE; +static PyObject *__pyx_n_s_stream_WILLR; +static PyObject *__pyx_n_s_stream_WMA; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_ta_func_unst_ids; +static PyObject *__pyx_n_s_ta_getFuncInfo; +static PyObject *__pyx_n_s_ta_getFuncTable; +static PyObject *__pyx_n_s_ta_getGroupTable; +static PyObject *__pyx_n_s_ta_getInputParameterInfo; +static PyObject *__pyx_n_s_ta_getOptInputParameterInfo; +static PyObject *__pyx_n_s_ta_getOutputParameterInfo; +static PyObject *__pyx_n_s_ta_get_unstable_period; +static PyObject *__pyx_n_s_ta_initialize; +static PyObject *__pyx_n_s_ta_set_unstable_period; +static PyObject *__pyx_n_s_ta_shutdown; +static PyObject *__pyx_n_s_ta_version; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_n_s_talib__ta_lib; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeStamp; +static PyObject *__pyx_n_s_timeperiod; +static PyObject *__pyx_n_s_timeperiod1; +static PyObject *__pyx_n_s_timeperiod2; +static PyObject *__pyx_n_s_timeperiod3; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_type_2; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_update_info; +static PyObject *__pyx_n_s_upper; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_value_range; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_vfactor; +static PyObject *__pyx_n_s_volume; +static PyObject *__pyx_n_s_volume_data; +static PyObject *__pyx_kp_s_volume_has_wrong_dimensions; +static PyObject *__pyx_kp_s_volume_is_not_double; +static PyObject *__pyx_n_s_xrange; +static PyObject *__pyx_pf_5talib_7_ta_lib__ta_check_success(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_2_ta_initialize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_4_ta_shutdown(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_7MA_Type___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_7MA_Type_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type_); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_6_ta_set_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_period); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8_ta_get_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_10ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_12AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_14ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_16ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_18ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_20ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_22APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_24AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_26AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_28ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_30ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_32ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_34AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_36BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_38BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_40BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_42CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_44CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_46CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_48CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_50CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_52CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_54CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_56CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_58CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_60CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_62CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_64CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_66CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_68CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_70CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_72CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_74CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_76CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_78CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_80CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_82CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_84CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_86CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_88CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_90CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_92CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_94CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_96CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_98CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_100CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_102CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_104CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_106CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_108CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_110CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_112CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_114CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_116CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_118CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_120CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_122CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_124CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_126CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_128CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_130CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_132CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_134CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_136CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_138CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_140CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_142CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_144CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_146CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_148CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_150CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_152CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_154CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_156CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_158CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_160CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_162CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_164CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_166CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_168CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_170CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_172COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_174COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_176DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_178DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_180DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_182EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_184EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_186FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_188HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_190HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_192HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_194HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_196HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_198HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_200KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_202LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_204LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_206LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_208LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_210LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_212LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_214MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_216MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_218MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_220MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_222MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_224MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_226MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_228MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_230MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_232MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_234MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_236MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_238MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_240MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_242MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_244MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_246MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_248MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_250MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_252MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_254NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_256OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_258PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_260PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_262PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_264ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_266ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_268ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_270ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_272RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_274SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_276SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_278SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_280SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_282SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_284SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_286STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_288STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_290STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_292STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_294SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_296SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_298T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_300TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_302TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_304TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_306TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_308TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_310TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_312TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_314TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_316ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_318VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_320WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_322WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_324WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_326str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_328bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_330str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_332bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_function_name, PyObject *__pyx_v_func_object, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_2__initialize_function_info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_4info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_6function_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_8output_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_10get_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_12set_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_names); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_14get_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_16set_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_18get_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_20set_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameters); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_22set_function_args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_24lookback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_26output_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_28outputs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_30run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_32__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_34__input_price_series_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_36__call_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_38__get_opt_input_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_name); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_40__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_42__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_334_ta_getGroupTable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_336_ta_getFuncTable(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_group); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_338__get_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flag, PyObject *__pyx_v_flags_lookup_dict); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_340_ta_getFuncInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_342_ta_getInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_344_ta_getOptInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_346_ta_getOutputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_348_get_defaults_and_docs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_info); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_350stream_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_352stream_AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_354stream_ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_356stream_ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_358stream_ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_360stream_ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_362stream_APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_364stream_AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_366stream_AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_368stream_ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_370stream_ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_372stream_ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_374stream_AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_376stream_BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_378stream_BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_380stream_BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_382stream_CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_384stream_CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_386stream_CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_388stream_CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_390stream_CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_392stream_CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_394stream_CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_396stream_CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_398stream_CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_400stream_CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_402stream_CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_404stream_CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_406stream_CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_408stream_CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_410stream_CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_412stream_CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_414stream_CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_416stream_CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_418stream_CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_420stream_CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_422stream_CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_424stream_CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_426stream_CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_428stream_CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_430stream_CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_432stream_CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_434stream_CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_436stream_CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_438stream_CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_440stream_CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_442stream_CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_444stream_CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_446stream_CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_448stream_CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_450stream_CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_452stream_CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_454stream_CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_456stream_CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_458stream_CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_460stream_CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_462stream_CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_464stream_CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_466stream_CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_468stream_CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_470stream_CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_472stream_CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_474stream_CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_476stream_CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_478stream_CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_480stream_CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_482stream_CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_484stream_CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_486stream_CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_488stream_CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_490stream_CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_492stream_CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_494stream_CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_496stream_CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_498stream_CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_500stream_CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_502stream_CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_504stream_CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_506stream_CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_508stream_CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_510stream_CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_512stream_COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_514stream_COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_516stream_DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_518stream_DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_520stream_DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_522stream_EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_524stream_EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_526stream_FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_528stream_HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_530stream_HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_532stream_HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_534stream_HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_536stream_HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_538stream_HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_540stream_KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_542stream_LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_544stream_LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_546stream_LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_548stream_LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_550stream_LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_552stream_LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_554stream_MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_556stream_MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_558stream_MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_560stream_MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_562stream_MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_564stream_MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_566stream_MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_568stream_MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_570stream_MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_572stream_MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_574stream_MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_576stream_MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_578stream_MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_580stream_MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_582stream_MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_584stream_MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_586stream_MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_588stream_MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_590stream_MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_592stream_MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_594stream_NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_596stream_OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_598stream_PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_600stream_PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_602stream_PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_604stream_ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_606stream_ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_608stream_ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_610stream_ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_612stream_RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_614stream_SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_616stream_SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_618stream_SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_620stream_SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_622stream_SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_624stream_SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_626stream_STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_628stream_STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_630stream_STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_632stream_STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_634stream_SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_636stream_SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_638stream_T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_640stream_TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_642stream_TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_644stream_TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_646stream_TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_648stream_TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_650stream_TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_652stream_TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_654stream_TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_656stream_ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_658stream_VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_660stream_WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_662stream_WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ +static PyObject *__pyx_pf_5talib_7_ta_lib_664stream_WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_4; +static PyObject *__pyx_int_5; +static PyObject *__pyx_int_6; +static PyObject *__pyx_int_7; +static PyObject *__pyx_int_8; +static PyObject *__pyx_int_9; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_11; +static PyObject *__pyx_int_12; +static PyObject *__pyx_int_13; +static PyObject *__pyx_int_14; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_16; +static PyObject *__pyx_int_32; +static PyObject *__pyx_int_64; +static PyObject *__pyx_int_128; +static PyObject *__pyx_int_256; +static PyObject *__pyx_int_512; +static PyObject *__pyx_int_1024; +static PyObject *__pyx_int_2048; +static PyObject *__pyx_int_4096; +static PyObject *__pyx_int_5000; +static PyObject *__pyx_int_65535; +static PyObject *__pyx_int_16777216; +static PyObject *__pyx_int_67108864; +static PyObject *__pyx_int_134217728; +static PyObject *__pyx_int_268435456; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__122; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__127; +static PyObject *__pyx_tuple__128; +static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__131; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__133; +static PyObject *__pyx_tuple__134; +static PyObject *__pyx_tuple__135; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__137; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__139; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__141; +static PyObject *__pyx_tuple__142; +static PyObject *__pyx_tuple__143; +static PyObject *__pyx_tuple__144; +static PyObject *__pyx_tuple__145; +static PyObject *__pyx_tuple__146; +static PyObject *__pyx_tuple__147; +static PyObject *__pyx_tuple__148; +static PyObject *__pyx_tuple__149; +static PyObject *__pyx_tuple__150; +static PyObject *__pyx_tuple__151; +static PyObject *__pyx_tuple__152; +static PyObject *__pyx_tuple__153; +static PyObject *__pyx_tuple__154; +static PyObject *__pyx_tuple__155; +static PyObject *__pyx_tuple__156; +static PyObject *__pyx_tuple__157; +static PyObject *__pyx_tuple__158; +static PyObject *__pyx_tuple__159; +static PyObject *__pyx_tuple__160; +static PyObject *__pyx_tuple__161; +static PyObject *__pyx_tuple__162; +static PyObject *__pyx_tuple__163; +static PyObject *__pyx_tuple__164; +static PyObject *__pyx_tuple__165; +static PyObject *__pyx_tuple__166; +static PyObject *__pyx_tuple__167; +static PyObject *__pyx_tuple__168; +static PyObject *__pyx_tuple__169; +static PyObject *__pyx_tuple__170; +static PyObject *__pyx_tuple__171; +static PyObject *__pyx_tuple__172; +static PyObject *__pyx_tuple__173; +static PyObject *__pyx_tuple__174; +static PyObject *__pyx_tuple__175; +static PyObject *__pyx_tuple__176; +static PyObject *__pyx_tuple__177; +static PyObject *__pyx_tuple__178; +static PyObject *__pyx_tuple__179; +static PyObject *__pyx_tuple__180; +static PyObject *__pyx_tuple__181; +static PyObject *__pyx_tuple__182; +static PyObject *__pyx_tuple__183; +static PyObject *__pyx_tuple__184; +static PyObject *__pyx_tuple__185; +static PyObject *__pyx_tuple__186; +static PyObject *__pyx_tuple__187; +static PyObject *__pyx_tuple__188; +static PyObject *__pyx_tuple__189; +static PyObject *__pyx_tuple__190; +static PyObject *__pyx_tuple__191; +static PyObject *__pyx_tuple__192; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__194; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__197; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__200; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__202; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__204; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__206; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__208; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__210; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__212; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__214; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__216; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_tuple__218; +static PyObject *__pyx_tuple__219; +static PyObject *__pyx_tuple__220; +static PyObject *__pyx_tuple__221; +static PyObject *__pyx_tuple__222; +static PyObject *__pyx_tuple__223; +static PyObject *__pyx_tuple__224; +static PyObject *__pyx_tuple__225; +static PyObject *__pyx_tuple__226; +static PyObject *__pyx_tuple__227; +static PyObject *__pyx_tuple__228; +static PyObject *__pyx_tuple__229; +static PyObject *__pyx_tuple__230; +static PyObject *__pyx_tuple__231; +static PyObject *__pyx_tuple__232; +static PyObject *__pyx_tuple__233; +static PyObject *__pyx_tuple__234; +static PyObject *__pyx_tuple__235; +static PyObject *__pyx_tuple__236; +static PyObject *__pyx_tuple__237; +static PyObject *__pyx_tuple__238; +static PyObject *__pyx_tuple__239; +static PyObject *__pyx_tuple__240; +static PyObject *__pyx_tuple__241; +static PyObject *__pyx_tuple__242; +static PyObject *__pyx_tuple__243; +static PyObject *__pyx_tuple__244; +static PyObject *__pyx_tuple__245; +static PyObject *__pyx_tuple__246; +static PyObject *__pyx_tuple__247; +static PyObject *__pyx_tuple__248; +static PyObject *__pyx_tuple__249; +static PyObject *__pyx_tuple__250; +static PyObject *__pyx_tuple__251; +static PyObject *__pyx_tuple__252; +static PyObject *__pyx_tuple__253; +static PyObject *__pyx_tuple__254; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__256; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__258; +static PyObject *__pyx_tuple__259; +static PyObject *__pyx_tuple__260; +static PyObject *__pyx_tuple__261; +static PyObject *__pyx_tuple__262; +static PyObject *__pyx_tuple__263; +static PyObject *__pyx_tuple__264; +static PyObject *__pyx_tuple__265; +static PyObject *__pyx_tuple__266; +static PyObject *__pyx_tuple__267; +static PyObject *__pyx_tuple__268; +static PyObject *__pyx_tuple__269; +static PyObject *__pyx_tuple__270; +static PyObject *__pyx_tuple__271; +static PyObject *__pyx_tuple__272; +static PyObject *__pyx_tuple__273; +static PyObject *__pyx_tuple__274; +static PyObject *__pyx_tuple__275; +static PyObject *__pyx_tuple__276; +static PyObject *__pyx_tuple__277; +static PyObject *__pyx_tuple__278; +static PyObject *__pyx_tuple__279; +static PyObject *__pyx_tuple__280; +static PyObject *__pyx_tuple__281; +static PyObject *__pyx_tuple__282; +static PyObject *__pyx_tuple__283; +static PyObject *__pyx_tuple__284; +static PyObject *__pyx_tuple__285; +static PyObject *__pyx_tuple__286; +static PyObject *__pyx_tuple__287; +static PyObject *__pyx_tuple__288; +static PyObject *__pyx_tuple__289; +static PyObject *__pyx_tuple__290; +static PyObject *__pyx_tuple__291; +static PyObject *__pyx_tuple__292; +static PyObject *__pyx_tuple__293; +static PyObject *__pyx_tuple__294; +static PyObject *__pyx_tuple__295; +static PyObject *__pyx_tuple__296; +static PyObject *__pyx_tuple__297; +static PyObject *__pyx_tuple__298; +static PyObject *__pyx_tuple__299; +static PyObject *__pyx_tuple__300; +static PyObject *__pyx_tuple__301; +static PyObject *__pyx_tuple__302; +static PyObject *__pyx_tuple__303; +static PyObject *__pyx_tuple__304; +static PyObject *__pyx_tuple__305; +static PyObject *__pyx_tuple__306; +static PyObject *__pyx_tuple__307; +static PyObject *__pyx_tuple__308; +static PyObject *__pyx_tuple__309; +static PyObject *__pyx_tuple__310; +static PyObject *__pyx_tuple__311; +static PyObject *__pyx_tuple__312; +static PyObject *__pyx_tuple__313; +static PyObject *__pyx_tuple__314; +static PyObject *__pyx_tuple__315; +static PyObject *__pyx_tuple__316; +static PyObject *__pyx_tuple__317; +static PyObject *__pyx_tuple__318; +static PyObject *__pyx_tuple__319; +static PyObject *__pyx_tuple__320; +static PyObject *__pyx_tuple__321; +static PyObject *__pyx_tuple__322; +static PyObject *__pyx_tuple__323; +static PyObject *__pyx_tuple__324; +static PyObject *__pyx_tuple__325; +static PyObject *__pyx_tuple__326; +static PyObject *__pyx_tuple__327; +static PyObject *__pyx_tuple__328; +static PyObject *__pyx_tuple__329; +static PyObject *__pyx_tuple__330; +static PyObject *__pyx_tuple__331; +static PyObject *__pyx_tuple__332; +static PyObject *__pyx_tuple__333; +static PyObject *__pyx_tuple__334; +static PyObject *__pyx_tuple__335; +static PyObject *__pyx_tuple__336; +static PyObject *__pyx_tuple__337; +static PyObject *__pyx_tuple__338; +static PyObject *__pyx_tuple__339; +static PyObject *__pyx_tuple__340; +static PyObject *__pyx_tuple__341; +static PyObject *__pyx_tuple__342; +static PyObject *__pyx_tuple__343; +static PyObject *__pyx_tuple__344; +static PyObject *__pyx_tuple__345; +static PyObject *__pyx_tuple__346; +static PyObject *__pyx_tuple__347; +static PyObject *__pyx_tuple__348; +static PyObject *__pyx_tuple__349; +static PyObject *__pyx_tuple__350; +static PyObject *__pyx_tuple__351; +static PyObject *__pyx_tuple__352; +static PyObject *__pyx_tuple__353; +static PyObject *__pyx_tuple__354; +static PyObject *__pyx_tuple__355; +static PyObject *__pyx_tuple__356; +static PyObject *__pyx_tuple__357; +static PyObject *__pyx_tuple__358; +static PyObject *__pyx_tuple__359; +static PyObject *__pyx_tuple__360; +static PyObject *__pyx_tuple__361; +static PyObject *__pyx_tuple__362; +static PyObject *__pyx_tuple__363; +static PyObject *__pyx_tuple__364; +static PyObject *__pyx_tuple__365; +static PyObject *__pyx_tuple__366; +static PyObject *__pyx_tuple__367; +static PyObject *__pyx_tuple__368; +static PyObject *__pyx_tuple__369; +static PyObject *__pyx_tuple__370; +static PyObject *__pyx_tuple__371; +static PyObject *__pyx_tuple__372; +static PyObject *__pyx_tuple__373; +static PyObject *__pyx_tuple__374; +static PyObject *__pyx_tuple__375; +static PyObject *__pyx_tuple__376; +static PyObject *__pyx_tuple__377; +static PyObject *__pyx_tuple__378; +static PyObject *__pyx_tuple__379; +static PyObject *__pyx_tuple__380; +static PyObject *__pyx_tuple__381; +static PyObject *__pyx_tuple__382; +static PyObject *__pyx_tuple__383; +static PyObject *__pyx_tuple__384; +static PyObject *__pyx_tuple__385; +static PyObject *__pyx_tuple__386; +static PyObject *__pyx_tuple__387; +static PyObject *__pyx_tuple__388; +static PyObject *__pyx_tuple__389; +static PyObject *__pyx_tuple__390; +static PyObject *__pyx_tuple__391; +static PyObject *__pyx_tuple__392; +static PyObject *__pyx_tuple__393; +static PyObject *__pyx_tuple__394; +static PyObject *__pyx_tuple__395; +static PyObject *__pyx_tuple__396; +static PyObject *__pyx_tuple__397; +static PyObject *__pyx_tuple__398; +static PyObject *__pyx_tuple__399; +static PyObject *__pyx_tuple__400; +static PyObject *__pyx_tuple__401; +static PyObject *__pyx_tuple__402; +static PyObject *__pyx_tuple__403; +static PyObject *__pyx_tuple__404; +static PyObject *__pyx_tuple__405; +static PyObject *__pyx_tuple__406; +static PyObject *__pyx_tuple__407; +static PyObject *__pyx_tuple__408; +static PyObject *__pyx_tuple__409; +static PyObject *__pyx_tuple__410; +static PyObject *__pyx_tuple__411; +static PyObject *__pyx_tuple__412; +static PyObject *__pyx_tuple__413; +static PyObject *__pyx_tuple__414; +static PyObject *__pyx_tuple__415; +static PyObject *__pyx_tuple__416; +static PyObject *__pyx_tuple__417; +static PyObject *__pyx_tuple__418; +static PyObject *__pyx_tuple__419; +static PyObject *__pyx_tuple__420; +static PyObject *__pyx_tuple__421; +static PyObject *__pyx_tuple__422; +static PyObject *__pyx_tuple__423; +static PyObject *__pyx_tuple__424; +static PyObject *__pyx_tuple__425; +static PyObject *__pyx_tuple__426; +static PyObject *__pyx_tuple__427; +static PyObject *__pyx_tuple__428; +static PyObject *__pyx_tuple__429; +static PyObject *__pyx_tuple__430; +static PyObject *__pyx_tuple__431; +static PyObject *__pyx_tuple__432; +static PyObject *__pyx_tuple__433; +static PyObject *__pyx_tuple__434; +static PyObject *__pyx_tuple__435; +static PyObject *__pyx_tuple__436; +static PyObject *__pyx_tuple__437; +static PyObject *__pyx_tuple__438; +static PyObject *__pyx_tuple__439; +static PyObject *__pyx_tuple__440; +static PyObject *__pyx_tuple__441; +static PyObject *__pyx_tuple__442; +static PyObject *__pyx_tuple__443; +static PyObject *__pyx_tuple__444; +static PyObject *__pyx_tuple__445; +static PyObject *__pyx_tuple__446; +static PyObject *__pyx_tuple__447; +static PyObject *__pyx_tuple__448; +static PyObject *__pyx_tuple__449; +static PyObject *__pyx_tuple__450; +static PyObject *__pyx_tuple__451; +static PyObject *__pyx_tuple__452; +static PyObject *__pyx_tuple__453; +static PyObject *__pyx_tuple__454; +static PyObject *__pyx_tuple__455; +static PyObject *__pyx_tuple__456; +static PyObject *__pyx_tuple__457; +static PyObject *__pyx_tuple__458; +static PyObject *__pyx_tuple__459; +static PyObject *__pyx_tuple__460; +static PyObject *__pyx_tuple__461; +static PyObject *__pyx_tuple__462; +static PyObject *__pyx_tuple__463; +static PyObject *__pyx_tuple__464; +static PyObject *__pyx_tuple__465; +static PyObject *__pyx_tuple__466; +static PyObject *__pyx_tuple__467; +static PyObject *__pyx_tuple__468; +static PyObject *__pyx_tuple__469; +static PyObject *__pyx_tuple__470; +static PyObject *__pyx_tuple__471; +static PyObject *__pyx_tuple__472; +static PyObject *__pyx_tuple__473; +static PyObject *__pyx_tuple__474; +static PyObject *__pyx_tuple__475; +static PyObject *__pyx_tuple__476; +static PyObject *__pyx_tuple__477; +static PyObject *__pyx_tuple__478; +static PyObject *__pyx_tuple__479; +static PyObject *__pyx_tuple__480; +static PyObject *__pyx_tuple__481; +static PyObject *__pyx_tuple__482; +static PyObject *__pyx_tuple__483; +static PyObject *__pyx_tuple__484; +static PyObject *__pyx_tuple__485; +static PyObject *__pyx_tuple__486; +static PyObject *__pyx_tuple__487; +static PyObject *__pyx_tuple__488; +static PyObject *__pyx_tuple__489; +static PyObject *__pyx_tuple__490; +static PyObject *__pyx_tuple__491; +static PyObject *__pyx_tuple__492; +static PyObject *__pyx_tuple__493; +static PyObject *__pyx_tuple__494; +static PyObject *__pyx_tuple__495; +static PyObject *__pyx_tuple__496; +static PyObject *__pyx_tuple__497; +static PyObject *__pyx_tuple__498; +static PyObject *__pyx_tuple__499; +static PyObject *__pyx_tuple__500; +static PyObject *__pyx_tuple__501; +static PyObject *__pyx_tuple__502; +static PyObject *__pyx_tuple__503; +static PyObject *__pyx_tuple__504; +static PyObject *__pyx_tuple__505; +static PyObject *__pyx_tuple__506; +static PyObject *__pyx_tuple__507; +static PyObject *__pyx_tuple__508; +static PyObject *__pyx_tuple__509; +static PyObject *__pyx_tuple__510; +static PyObject *__pyx_tuple__511; +static PyObject *__pyx_tuple__512; +static PyObject *__pyx_tuple__513; +static PyObject *__pyx_tuple__514; +static PyObject *__pyx_tuple__515; +static PyObject *__pyx_tuple__516; +static PyObject *__pyx_tuple__517; +static PyObject *__pyx_tuple__518; +static PyObject *__pyx_tuple__519; +static PyObject *__pyx_tuple__520; +static PyObject *__pyx_tuple__521; +static PyObject *__pyx_tuple__522; +static PyObject *__pyx_tuple__523; +static PyObject *__pyx_tuple__524; +static PyObject *__pyx_tuple__525; +static PyObject *__pyx_tuple__526; +static PyObject *__pyx_tuple__527; +static PyObject *__pyx_tuple__528; +static PyObject *__pyx_tuple__529; +static PyObject *__pyx_tuple__530; +static PyObject *__pyx_tuple__531; +static PyObject *__pyx_tuple__532; +static PyObject *__pyx_tuple__533; +static PyObject *__pyx_tuple__534; +static PyObject *__pyx_tuple__535; +static PyObject *__pyx_tuple__536; +static PyObject *__pyx_tuple__537; +static PyObject *__pyx_tuple__538; +static PyObject *__pyx_tuple__539; +static PyObject *__pyx_tuple__540; +static PyObject *__pyx_tuple__541; +static PyObject *__pyx_tuple__542; +static PyObject *__pyx_tuple__543; +static PyObject *__pyx_tuple__544; +static PyObject *__pyx_tuple__545; +static PyObject *__pyx_tuple__546; +static PyObject *__pyx_tuple__547; +static PyObject *__pyx_tuple__548; +static PyObject *__pyx_tuple__549; +static PyObject *__pyx_tuple__550; +static PyObject *__pyx_tuple__551; +static PyObject *__pyx_tuple__552; +static PyObject *__pyx_tuple__553; +static PyObject *__pyx_tuple__554; +static PyObject *__pyx_tuple__555; +static PyObject *__pyx_tuple__556; +static PyObject *__pyx_tuple__557; +static PyObject *__pyx_tuple__558; +static PyObject *__pyx_tuple__559; +static PyObject *__pyx_tuple__560; +static PyObject *__pyx_tuple__561; +static PyObject *__pyx_tuple__562; +static PyObject *__pyx_tuple__563; +static PyObject *__pyx_tuple__564; +static PyObject *__pyx_tuple__565; +static PyObject *__pyx_tuple__566; +static PyObject *__pyx_tuple__567; +static PyObject *__pyx_tuple__568; +static PyObject *__pyx_tuple__569; +static PyObject *__pyx_tuple__570; +static PyObject *__pyx_tuple__571; +static PyObject *__pyx_tuple__572; +static PyObject *__pyx_tuple__573; +static PyObject *__pyx_tuple__574; +static PyObject *__pyx_tuple__575; +static PyObject *__pyx_tuple__576; +static PyObject *__pyx_tuple__577; +static PyObject *__pyx_tuple__578; +static PyObject *__pyx_tuple__579; +static PyObject *__pyx_tuple__580; +static PyObject *__pyx_tuple__581; +static PyObject *__pyx_tuple__582; +static PyObject *__pyx_tuple__583; +static PyObject *__pyx_tuple__584; +static PyObject *__pyx_tuple__585; +static PyObject *__pyx_tuple__586; +static PyObject *__pyx_tuple__587; +static PyObject *__pyx_tuple__588; +static PyObject *__pyx_tuple__589; +static PyObject *__pyx_tuple__590; +static PyObject *__pyx_tuple__591; +static PyObject *__pyx_tuple__592; +static PyObject *__pyx_tuple__593; +static PyObject *__pyx_tuple__594; +static PyObject *__pyx_tuple__595; +static PyObject *__pyx_tuple__596; +static PyObject *__pyx_tuple__597; +static PyObject *__pyx_tuple__598; +static PyObject *__pyx_tuple__599; +static PyObject *__pyx_tuple__600; +static PyObject *__pyx_tuple__601; +static PyObject *__pyx_tuple__602; +static PyObject *__pyx_tuple__603; +static PyObject *__pyx_tuple__604; +static PyObject *__pyx_tuple__605; +static PyObject *__pyx_tuple__606; +static PyObject *__pyx_tuple__607; +static PyObject *__pyx_tuple__608; +static PyObject *__pyx_tuple__609; +static PyObject *__pyx_tuple__610; +static PyObject *__pyx_tuple__611; +static PyObject *__pyx_tuple__612; +static PyObject *__pyx_tuple__613; +static PyObject *__pyx_tuple__614; +static PyObject *__pyx_tuple__615; +static PyObject *__pyx_tuple__616; +static PyObject *__pyx_tuple__617; +static PyObject *__pyx_tuple__618; +static PyObject *__pyx_tuple__619; +static PyObject *__pyx_tuple__620; +static PyObject *__pyx_tuple__621; +static PyObject *__pyx_tuple__622; +static PyObject *__pyx_tuple__623; +static PyObject *__pyx_tuple__624; +static PyObject *__pyx_tuple__625; +static PyObject *__pyx_tuple__626; +static PyObject *__pyx_tuple__627; +static PyObject *__pyx_tuple__628; +static PyObject *__pyx_tuple__629; +static PyObject *__pyx_tuple__630; +static PyObject *__pyx_tuple__631; +static PyObject *__pyx_tuple__632; +static PyObject *__pyx_tuple__633; +static PyObject *__pyx_tuple__634; +static PyObject *__pyx_tuple__635; +static PyObject *__pyx_tuple__636; +static PyObject *__pyx_tuple__637; +static PyObject *__pyx_tuple__638; +static PyObject *__pyx_tuple__639; +static PyObject *__pyx_tuple__640; +static PyObject *__pyx_tuple__641; +static PyObject *__pyx_tuple__642; +static PyObject *__pyx_tuple__643; +static PyObject *__pyx_tuple__644; +static PyObject *__pyx_tuple__645; +static PyObject *__pyx_tuple__646; +static PyObject *__pyx_tuple__647; +static PyObject *__pyx_tuple__648; +static PyObject *__pyx_tuple__649; +static PyObject *__pyx_tuple__650; +static PyObject *__pyx_tuple__651; +static PyObject *__pyx_tuple__652; +static PyObject *__pyx_tuple__653; +static PyObject *__pyx_tuple__654; +static PyObject *__pyx_tuple__655; +static PyObject *__pyx_tuple__656; +static PyObject *__pyx_tuple__657; +static PyObject *__pyx_tuple__658; +static PyObject *__pyx_tuple__659; +static PyObject *__pyx_tuple__660; +static PyObject *__pyx_tuple__661; +static PyObject *__pyx_tuple__662; +static PyObject *__pyx_tuple__663; +static PyObject *__pyx_tuple__664; +static PyObject *__pyx_tuple__665; +static PyObject *__pyx_tuple__666; +static PyObject *__pyx_tuple__667; +static PyObject *__pyx_tuple__668; +static PyObject *__pyx_tuple__669; +static PyObject *__pyx_tuple__670; +static PyObject *__pyx_tuple__671; +static PyObject *__pyx_tuple__672; +static PyObject *__pyx_tuple__673; +static PyObject *__pyx_tuple__674; +static PyObject *__pyx_tuple__675; +static PyObject *__pyx_tuple__676; +static PyObject *__pyx_tuple__677; +static PyObject *__pyx_tuple__678; +static PyObject *__pyx_tuple__679; +static PyObject *__pyx_tuple__680; +static PyObject *__pyx_tuple__681; +static PyObject *__pyx_tuple__682; +static PyObject *__pyx_tuple__683; +static PyObject *__pyx_tuple__684; +static PyObject *__pyx_tuple__685; +static PyObject *__pyx_tuple__686; +static PyObject *__pyx_tuple__687; +static PyObject *__pyx_tuple__688; +static PyObject *__pyx_tuple__689; +static PyObject *__pyx_tuple__690; +static PyObject *__pyx_tuple__691; +static PyObject *__pyx_tuple__692; +static PyObject *__pyx_tuple__693; +static PyObject *__pyx_tuple__694; +static PyObject *__pyx_tuple__695; +static PyObject *__pyx_tuple__696; +static PyObject *__pyx_tuple__697; +static PyObject *__pyx_tuple__698; +static PyObject *__pyx_tuple__699; +static PyObject *__pyx_tuple__700; +static PyObject *__pyx_tuple__701; +static PyObject *__pyx_tuple__702; +static PyObject *__pyx_tuple__703; +static PyObject *__pyx_tuple__704; +static PyObject *__pyx_tuple__705; +static PyObject *__pyx_tuple__706; +static PyObject *__pyx_tuple__707; +static PyObject *__pyx_tuple__708; +static PyObject *__pyx_tuple__709; +static PyObject *__pyx_tuple__710; +static PyObject *__pyx_tuple__711; +static PyObject *__pyx_tuple__712; +static PyObject *__pyx_tuple__713; +static PyObject *__pyx_tuple__714; +static PyObject *__pyx_tuple__715; +static PyObject *__pyx_tuple__716; +static PyObject *__pyx_tuple__717; +static PyObject *__pyx_tuple__718; +static PyObject *__pyx_tuple__719; +static PyObject *__pyx_tuple__720; +static PyObject *__pyx_tuple__721; +static PyObject *__pyx_tuple__722; +static PyObject *__pyx_tuple__723; +static PyObject *__pyx_tuple__724; +static PyObject *__pyx_tuple__725; +static PyObject *__pyx_tuple__726; +static PyObject *__pyx_tuple__727; +static PyObject *__pyx_tuple__728; +static PyObject *__pyx_tuple__729; +static PyObject *__pyx_tuple__730; +static PyObject *__pyx_tuple__731; +static PyObject *__pyx_tuple__732; +static PyObject *__pyx_tuple__733; +static PyObject *__pyx_tuple__734; +static PyObject *__pyx_tuple__735; +static PyObject *__pyx_tuple__736; +static PyObject *__pyx_tuple__737; +static PyObject *__pyx_tuple__738; +static PyObject *__pyx_tuple__739; +static PyObject *__pyx_tuple__740; +static PyObject *__pyx_tuple__741; +static PyObject *__pyx_tuple__742; +static PyObject *__pyx_tuple__743; +static PyObject *__pyx_tuple__744; +static PyObject *__pyx_tuple__745; +static PyObject *__pyx_tuple__746; +static PyObject *__pyx_tuple__747; +static PyObject *__pyx_tuple__748; +static PyObject *__pyx_tuple__749; +static PyObject *__pyx_tuple__750; +static PyObject *__pyx_tuple__751; +static PyObject *__pyx_tuple__752; +static PyObject *__pyx_tuple__753; +static PyObject *__pyx_tuple__754; +static PyObject *__pyx_tuple__755; +static PyObject *__pyx_tuple__756; +static PyObject *__pyx_tuple__757; +static PyObject *__pyx_tuple__758; +static PyObject *__pyx_tuple__759; +static PyObject *__pyx_tuple__760; +static PyObject *__pyx_tuple__761; +static PyObject *__pyx_tuple__762; +static PyObject *__pyx_tuple__763; +static PyObject *__pyx_tuple__764; +static PyObject *__pyx_tuple__765; +static PyObject *__pyx_tuple__766; +static PyObject *__pyx_tuple__767; +static PyObject *__pyx_tuple__768; +static PyObject *__pyx_tuple__769; +static PyObject *__pyx_tuple__770; +static PyObject *__pyx_tuple__771; +static PyObject *__pyx_tuple__772; +static PyObject *__pyx_tuple__773; +static PyObject *__pyx_tuple__774; +static PyObject *__pyx_tuple__775; +static PyObject *__pyx_tuple__776; +static PyObject *__pyx_tuple__777; +static PyObject *__pyx_tuple__778; +static PyObject *__pyx_tuple__779; +static PyObject *__pyx_tuple__780; +static PyObject *__pyx_tuple__781; +static PyObject *__pyx_tuple__782; +static PyObject *__pyx_tuple__783; +static PyObject *__pyx_tuple__784; +static PyObject *__pyx_tuple__785; +static PyObject *__pyx_tuple__786; +static PyObject *__pyx_tuple__787; +static PyObject *__pyx_tuple__788; +static PyObject *__pyx_tuple__789; +static PyObject *__pyx_tuple__790; +static PyObject *__pyx_tuple__791; +static PyObject *__pyx_tuple__792; +static PyObject *__pyx_tuple__793; +static PyObject *__pyx_tuple__794; +static PyObject *__pyx_tuple__795; +static PyObject *__pyx_tuple__796; +static PyObject *__pyx_tuple__797; +static PyObject *__pyx_tuple__798; +static PyObject *__pyx_tuple__799; +static PyObject *__pyx_tuple__800; +static PyObject *__pyx_tuple__801; +static PyObject *__pyx_tuple__802; +static PyObject *__pyx_tuple__803; +static PyObject *__pyx_tuple__804; +static PyObject *__pyx_tuple__805; +static PyObject *__pyx_tuple__806; +static PyObject *__pyx_tuple__807; +static PyObject *__pyx_tuple__808; +static PyObject *__pyx_tuple__809; +static PyObject *__pyx_tuple__810; +static PyObject *__pyx_tuple__811; +static PyObject *__pyx_tuple__812; +static PyObject *__pyx_tuple__813; +static PyObject *__pyx_tuple__814; +static PyObject *__pyx_tuple__815; +static PyObject *__pyx_tuple__816; +static PyObject *__pyx_tuple__817; +static PyObject *__pyx_tuple__818; +static PyObject *__pyx_tuple__819; +static PyObject *__pyx_tuple__820; +static PyObject *__pyx_tuple__821; +static PyObject *__pyx_tuple__822; +static PyObject *__pyx_tuple__823; +static PyObject *__pyx_tuple__824; +static PyObject *__pyx_tuple__825; +static PyObject *__pyx_tuple__826; +static PyObject *__pyx_tuple__827; +static PyObject *__pyx_tuple__828; +static PyObject *__pyx_tuple__829; +static PyObject *__pyx_tuple__830; +static PyObject *__pyx_tuple__831; +static PyObject *__pyx_tuple__832; +static PyObject *__pyx_tuple__833; +static PyObject *__pyx_tuple__834; +static PyObject *__pyx_tuple__835; +static PyObject *__pyx_tuple__836; +static PyObject *__pyx_tuple__837; +static PyObject *__pyx_tuple__838; +static PyObject *__pyx_tuple__839; +static PyObject *__pyx_tuple__840; +static PyObject *__pyx_tuple__841; +static PyObject *__pyx_tuple__842; +static PyObject *__pyx_tuple__843; +static PyObject *__pyx_tuple__844; +static PyObject *__pyx_tuple__845; +static PyObject *__pyx_tuple__846; +static PyObject *__pyx_tuple__847; +static PyObject *__pyx_tuple__848; +static PyObject *__pyx_tuple__849; +static PyObject *__pyx_tuple__850; +static PyObject *__pyx_tuple__851; +static PyObject *__pyx_tuple__852; +static PyObject *__pyx_tuple__853; +static PyObject *__pyx_tuple__854; +static PyObject *__pyx_tuple__855; +static PyObject *__pyx_tuple__856; +static PyObject *__pyx_tuple__857; +static PyObject *__pyx_tuple__858; +static PyObject *__pyx_tuple__859; +static PyObject *__pyx_tuple__860; +static PyObject *__pyx_tuple__861; +static PyObject *__pyx_tuple__862; +static PyObject *__pyx_tuple__863; +static PyObject *__pyx_tuple__864; +static PyObject *__pyx_tuple__865; +static PyObject *__pyx_tuple__866; +static PyObject *__pyx_tuple__867; +static PyObject *__pyx_tuple__868; +static PyObject *__pyx_tuple__869; +static PyObject *__pyx_tuple__870; +static PyObject *__pyx_tuple__871; +static PyObject *__pyx_tuple__872; +static PyObject *__pyx_tuple__873; +static PyObject *__pyx_tuple__874; +static PyObject *__pyx_tuple__875; +static PyObject *__pyx_tuple__876; +static PyObject *__pyx_tuple__877; +static PyObject *__pyx_tuple__878; +static PyObject *__pyx_tuple__879; +static PyObject *__pyx_tuple__880; +static PyObject *__pyx_tuple__881; +static PyObject *__pyx_tuple__882; +static PyObject *__pyx_tuple__883; +static PyObject *__pyx_tuple__884; +static PyObject *__pyx_tuple__885; +static PyObject *__pyx_tuple__886; +static PyObject *__pyx_tuple__887; +static PyObject *__pyx_tuple__888; +static PyObject *__pyx_tuple__889; +static PyObject *__pyx_tuple__890; +static PyObject *__pyx_tuple__891; +static PyObject *__pyx_tuple__892; +static PyObject *__pyx_tuple__893; +static PyObject *__pyx_tuple__894; +static PyObject *__pyx_tuple__895; +static PyObject *__pyx_tuple__896; +static PyObject *__pyx_tuple__897; +static PyObject *__pyx_tuple__898; +static PyObject *__pyx_tuple__899; +static PyObject *__pyx_tuple__900; +static PyObject *__pyx_tuple__901; +static PyObject *__pyx_tuple__902; +static PyObject *__pyx_tuple__903; +static PyObject *__pyx_tuple__904; +static PyObject *__pyx_tuple__905; +static PyObject *__pyx_tuple__906; +static PyObject *__pyx_tuple__907; +static PyObject *__pyx_tuple__908; +static PyObject *__pyx_tuple__909; +static PyObject *__pyx_tuple__910; +static PyObject *__pyx_tuple__911; +static PyObject *__pyx_tuple__912; +static PyObject *__pyx_tuple__913; +static PyObject *__pyx_tuple__914; +static PyObject *__pyx_tuple__915; +static PyObject *__pyx_tuple__916; +static PyObject *__pyx_tuple__917; +static PyObject *__pyx_tuple__918; +static PyObject *__pyx_tuple__919; +static PyObject *__pyx_tuple__920; +static PyObject *__pyx_tuple__921; +static PyObject *__pyx_tuple__922; +static PyObject *__pyx_tuple__923; +static PyObject *__pyx_tuple__924; +static PyObject *__pyx_tuple__925; +static PyObject *__pyx_tuple__926; +static PyObject *__pyx_tuple__927; +static PyObject *__pyx_tuple__928; +static PyObject *__pyx_tuple__929; +static PyObject *__pyx_tuple__930; +static PyObject *__pyx_tuple__931; +static PyObject *__pyx_tuple__932; +static PyObject *__pyx_tuple__933; +static PyObject *__pyx_tuple__934; +static PyObject *__pyx_tuple__935; +static PyObject *__pyx_tuple__936; +static PyObject *__pyx_tuple__937; +static PyObject *__pyx_tuple__938; +static PyObject *__pyx_tuple__939; +static PyObject *__pyx_tuple__940; +static PyObject *__pyx_tuple__941; +static PyObject *__pyx_tuple__942; +static PyObject *__pyx_tuple__943; +static PyObject *__pyx_tuple__944; +static PyObject *__pyx_tuple__945; +static PyObject *__pyx_tuple__946; +static PyObject *__pyx_tuple__947; +static PyObject *__pyx_tuple__948; +static PyObject *__pyx_tuple__949; +static PyObject *__pyx_tuple__950; +static PyObject *__pyx_tuple__951; +static PyObject *__pyx_tuple__952; +static PyObject *__pyx_tuple__953; +static PyObject *__pyx_tuple__954; +static PyObject *__pyx_tuple__955; +static PyObject *__pyx_tuple__956; +static PyObject *__pyx_tuple__957; +static PyObject *__pyx_tuple__958; +static PyObject *__pyx_tuple__959; +static PyObject *__pyx_tuple__960; +static PyObject *__pyx_tuple__961; +static PyObject *__pyx_tuple__962; +static PyObject *__pyx_tuple__963; +static PyObject *__pyx_tuple__964; +static PyObject *__pyx_tuple__965; +static PyObject *__pyx_tuple__966; +static PyObject *__pyx_tuple__967; +static PyObject *__pyx_tuple__968; +static PyObject *__pyx_tuple__969; +static PyObject *__pyx_tuple__970; +static PyObject *__pyx_tuple__971; +static PyObject *__pyx_tuple__972; +static PyObject *__pyx_tuple__973; +static PyObject *__pyx_tuple__974; +static PyObject *__pyx_tuple__975; +static PyObject *__pyx_tuple__976; +static PyObject *__pyx_tuple__977; +static PyObject *__pyx_tuple__978; +static PyObject *__pyx_tuple__979; +static PyObject *__pyx_tuple__980; +static PyObject *__pyx_tuple__981; +static PyObject *__pyx_tuple__982; +static PyObject *__pyx_tuple__983; +static PyObject *__pyx_tuple__984; +static PyObject *__pyx_tuple__985; +static PyObject *__pyx_tuple__986; +static PyObject *__pyx_tuple__987; +static PyObject *__pyx_tuple__988; +static PyObject *__pyx_tuple__989; +static PyObject *__pyx_tuple__990; +static PyObject *__pyx_tuple__991; +static PyObject *__pyx_tuple__992; +static PyObject *__pyx_tuple__993; +static PyObject *__pyx_tuple__994; +static PyObject *__pyx_tuple__995; +static PyObject *__pyx_tuple__996; +static PyObject *__pyx_tuple__997; +static PyObject *__pyx_tuple__998; +static PyObject *__pyx_tuple__999; +static PyObject *__pyx_tuple__1000; +static PyObject *__pyx_tuple__1001; +static PyObject *__pyx_tuple__1002; +static PyObject *__pyx_tuple__1003; +static PyObject *__pyx_tuple__1004; +static PyObject *__pyx_tuple__1005; +static PyObject *__pyx_tuple__1006; +static PyObject *__pyx_tuple__1007; +static PyObject *__pyx_tuple__1008; +static PyObject *__pyx_tuple__1009; +static PyObject *__pyx_tuple__1010; +static PyObject *__pyx_tuple__1011; +static PyObject *__pyx_tuple__1012; +static PyObject *__pyx_tuple__1013; +static PyObject *__pyx_tuple__1014; +static PyObject *__pyx_tuple__1015; +static PyObject *__pyx_tuple__1016; +static PyObject *__pyx_tuple__1017; +static PyObject *__pyx_tuple__1018; +static PyObject *__pyx_tuple__1019; +static PyObject *__pyx_tuple__1020; +static PyObject *__pyx_tuple__1021; +static PyObject *__pyx_tuple__1022; +static PyObject *__pyx_tuple__1023; +static PyObject *__pyx_tuple__1024; +static PyObject *__pyx_tuple__1025; +static PyObject *__pyx_tuple__1026; +static PyObject *__pyx_tuple__1027; +static PyObject *__pyx_tuple__1028; +static PyObject *__pyx_tuple__1029; +static PyObject *__pyx_tuple__1030; +static PyObject *__pyx_tuple__1031; +static PyObject *__pyx_tuple__1032; +static PyObject *__pyx_tuple__1033; +static PyObject *__pyx_tuple__1034; +static PyObject *__pyx_tuple__1035; +static PyObject *__pyx_tuple__1036; +static PyObject *__pyx_tuple__1037; +static PyObject *__pyx_tuple__1038; +static PyObject *__pyx_tuple__1039; +static PyObject *__pyx_tuple__1040; +static PyObject *__pyx_tuple__1041; +static PyObject *__pyx_tuple__1042; +static PyObject *__pyx_tuple__1043; +static PyObject *__pyx_tuple__1044; +static PyObject *__pyx_tuple__1045; +static PyObject *__pyx_tuple__1046; +static PyObject *__pyx_tuple__1047; +static PyObject *__pyx_tuple__1048; +static PyObject *__pyx_tuple__1049; +static PyObject *__pyx_tuple__1050; +static PyObject *__pyx_tuple__1051; +static PyObject *__pyx_tuple__1052; +static PyObject *__pyx_tuple__1053; +static PyObject *__pyx_tuple__1054; +static PyObject *__pyx_tuple__1055; +static PyObject *__pyx_tuple__1056; +static PyObject *__pyx_tuple__1057; +static PyObject *__pyx_tuple__1058; +static PyObject *__pyx_tuple__1059; +static PyObject *__pyx_tuple__1060; +static PyObject *__pyx_tuple__1061; +static PyObject *__pyx_tuple__1062; +static PyObject *__pyx_tuple__1063; +static PyObject *__pyx_tuple__1064; +static PyObject *__pyx_tuple__1065; +static PyObject *__pyx_tuple__1066; +static PyObject *__pyx_tuple__1067; +static PyObject *__pyx_tuple__1068; +static PyObject *__pyx_tuple__1069; +static PyObject *__pyx_tuple__1070; +static PyObject *__pyx_tuple__1071; +static PyObject *__pyx_tuple__1072; +static PyObject *__pyx_tuple__1073; +static PyObject *__pyx_tuple__1074; +static PyObject *__pyx_tuple__1075; +static PyObject *__pyx_tuple__1076; +static PyObject *__pyx_tuple__1077; +static PyObject *__pyx_tuple__1078; +static PyObject *__pyx_tuple__1079; +static PyObject *__pyx_tuple__1080; +static PyObject *__pyx_tuple__1081; +static PyObject *__pyx_tuple__1082; +static PyObject *__pyx_tuple__1083; +static PyObject *__pyx_tuple__1084; +static PyObject *__pyx_tuple__1085; +static PyObject *__pyx_tuple__1086; +static PyObject *__pyx_tuple__1087; +static PyObject *__pyx_tuple__1088; +static PyObject *__pyx_tuple__1089; +static PyObject *__pyx_tuple__1090; +static PyObject *__pyx_tuple__1091; +static PyObject *__pyx_tuple__1092; +static PyObject *__pyx_tuple__1093; +static PyObject *__pyx_tuple__1094; +static PyObject *__pyx_tuple__1095; +static PyObject *__pyx_tuple__1096; +static PyObject *__pyx_tuple__1097; +static PyObject *__pyx_tuple__1098; +static PyObject *__pyx_tuple__1099; +static PyObject *__pyx_tuple__1100; +static PyObject *__pyx_tuple__1101; +static PyObject *__pyx_tuple__1102; +static PyObject *__pyx_tuple__1103; +static PyObject *__pyx_tuple__1104; +static PyObject *__pyx_tuple__1105; +static PyObject *__pyx_tuple__1106; +static PyObject *__pyx_tuple__1107; +static PyObject *__pyx_tuple__1108; +static PyObject *__pyx_tuple__1109; +static PyObject *__pyx_tuple__1110; +static PyObject *__pyx_tuple__1111; +static PyObject *__pyx_tuple__1112; +static PyObject *__pyx_tuple__1113; +static PyObject *__pyx_tuple__1114; +static PyObject *__pyx_tuple__1115; +static PyObject *__pyx_tuple__1116; +static PyObject *__pyx_tuple__1117; +static PyObject *__pyx_tuple__1118; +static PyObject *__pyx_tuple__1119; +static PyObject *__pyx_tuple__1120; +static PyObject *__pyx_tuple__1121; +static PyObject *__pyx_tuple__1122; +static PyObject *__pyx_tuple__1123; +static PyObject *__pyx_tuple__1124; +static PyObject *__pyx_tuple__1125; +static PyObject *__pyx_tuple__1126; +static PyObject *__pyx_tuple__1127; +static PyObject *__pyx_tuple__1128; +static PyObject *__pyx_tuple__1129; +static PyObject *__pyx_tuple__1130; +static PyObject *__pyx_tuple__1131; +static PyObject *__pyx_tuple__1132; +static PyObject *__pyx_tuple__1133; +static PyObject *__pyx_tuple__1134; +static PyObject *__pyx_tuple__1135; +static PyObject *__pyx_tuple__1136; +static PyObject *__pyx_tuple__1137; +static PyObject *__pyx_tuple__1138; +static PyObject *__pyx_tuple__1139; +static PyObject *__pyx_tuple__1140; +static PyObject *__pyx_tuple__1141; +static PyObject *__pyx_tuple__1142; +static PyObject *__pyx_tuple__1143; +static PyObject *__pyx_tuple__1144; +static PyObject *__pyx_tuple__1145; +static PyObject *__pyx_tuple__1146; +static PyObject *__pyx_tuple__1147; +static PyObject *__pyx_tuple__1148; +static PyObject *__pyx_tuple__1149; +static PyObject *__pyx_tuple__1150; +static PyObject *__pyx_tuple__1151; +static PyObject *__pyx_tuple__1152; +static PyObject *__pyx_tuple__1153; +static PyObject *__pyx_tuple__1154; +static PyObject *__pyx_tuple__1155; +static PyObject *__pyx_tuple__1156; +static PyObject *__pyx_tuple__1157; +static PyObject *__pyx_tuple__1158; +static PyObject *__pyx_tuple__1159; +static PyObject *__pyx_tuple__1160; +static PyObject *__pyx_tuple__1161; +static PyObject *__pyx_tuple__1162; +static PyObject *__pyx_tuple__1163; +static PyObject *__pyx_tuple__1164; +static PyObject *__pyx_tuple__1165; +static PyObject *__pyx_tuple__1166; +static PyObject *__pyx_tuple__1167; +static PyObject *__pyx_tuple__1168; +static PyObject *__pyx_tuple__1169; +static PyObject *__pyx_tuple__1170; +static PyObject *__pyx_tuple__1171; +static PyObject *__pyx_tuple__1172; +static PyObject *__pyx_tuple__1173; +static PyObject *__pyx_tuple__1174; +static PyObject *__pyx_tuple__1175; +static PyObject *__pyx_tuple__1176; +static PyObject *__pyx_tuple__1177; +static PyObject *__pyx_tuple__1178; +static PyObject *__pyx_tuple__1179; +static PyObject *__pyx_tuple__1180; +static PyObject *__pyx_tuple__1181; +static PyObject *__pyx_tuple__1182; +static PyObject *__pyx_tuple__1183; +static PyObject *__pyx_tuple__1184; +static PyObject *__pyx_tuple__1185; +static PyObject *__pyx_tuple__1186; +static PyObject *__pyx_tuple__1187; +static PyObject *__pyx_tuple__1188; +static PyObject *__pyx_tuple__1189; +static PyObject *__pyx_tuple__1190; +static PyObject *__pyx_tuple__1191; +static PyObject *__pyx_tuple__1192; +static PyObject *__pyx_tuple__1193; +static PyObject *__pyx_tuple__1194; +static PyObject *__pyx_tuple__1195; +static PyObject *__pyx_tuple__1196; +static PyObject *__pyx_tuple__1197; +static PyObject *__pyx_tuple__1198; +static PyObject *__pyx_tuple__1199; +static PyObject *__pyx_tuple__1200; +static PyObject *__pyx_tuple__1201; +static PyObject *__pyx_tuple__1202; +static PyObject *__pyx_tuple__1203; +static PyObject *__pyx_tuple__1204; +static PyObject *__pyx_tuple__1205; +static PyObject *__pyx_tuple__1206; +static PyObject *__pyx_tuple__1207; +static PyObject *__pyx_tuple__1208; +static PyObject *__pyx_tuple__1209; +static PyObject *__pyx_tuple__1210; +static PyObject *__pyx_tuple__1213; +static PyObject *__pyx_tuple__1218; +static PyObject *__pyx_tuple__1219; +static PyObject *__pyx_tuple__1220; +static PyObject *__pyx_tuple__1221; +static PyObject *__pyx_tuple__1222; +static PyObject *__pyx_tuple__1223; +static PyObject *__pyx_tuple__1224; +static PyObject *__pyx_tuple__1225; +static PyObject *__pyx_tuple__1226; +static PyObject *__pyx_tuple__1227; +static PyObject *__pyx_tuple__1228; +static PyObject *__pyx_tuple__1229; +static PyObject *__pyx_tuple__1230; +static PyObject *__pyx_tuple__1231; +static PyObject *__pyx_tuple__1232; +static PyObject *__pyx_tuple__1233; +static PyObject *__pyx_tuple__1234; +static PyObject *__pyx_tuple__1235; +static PyObject *__pyx_tuple__1236; +static PyObject *__pyx_tuple__1237; +static PyObject *__pyx_tuple__1238; +static PyObject *__pyx_tuple__1239; +static PyObject *__pyx_tuple__1240; +static PyObject *__pyx_tuple__1241; +static PyObject *__pyx_tuple__1242; +static PyObject *__pyx_tuple__1243; +static PyObject *__pyx_tuple__1244; +static PyObject *__pyx_tuple__1245; +static PyObject *__pyx_tuple__1246; +static PyObject *__pyx_tuple__1247; +static PyObject *__pyx_tuple__1248; +static PyObject *__pyx_tuple__1249; +static PyObject *__pyx_tuple__1250; +static PyObject *__pyx_tuple__1251; +static PyObject *__pyx_tuple__1252; +static PyObject *__pyx_tuple__1253; +static PyObject *__pyx_tuple__1254; +static PyObject *__pyx_tuple__1255; +static PyObject *__pyx_tuple__1256; +static PyObject *__pyx_tuple__1257; +static PyObject *__pyx_tuple__1258; +static PyObject *__pyx_tuple__1259; +static PyObject *__pyx_tuple__1260; +static PyObject *__pyx_tuple__1261; +static PyObject *__pyx_tuple__1262; +static PyObject *__pyx_tuple__1263; +static PyObject *__pyx_tuple__1264; +static PyObject *__pyx_tuple__1265; +static PyObject *__pyx_tuple__1266; +static PyObject *__pyx_tuple__1267; +static PyObject *__pyx_tuple__1268; +static PyObject *__pyx_tuple__1269; +static PyObject *__pyx_tuple__1270; +static PyObject *__pyx_tuple__1271; +static PyObject *__pyx_tuple__1272; +static PyObject *__pyx_tuple__1273; +static PyObject *__pyx_tuple__1274; +static PyObject *__pyx_tuple__1275; +static PyObject *__pyx_tuple__1276; +static PyObject *__pyx_tuple__1277; +static PyObject *__pyx_tuple__1278; +static PyObject *__pyx_tuple__1279; +static PyObject *__pyx_tuple__1280; +static PyObject *__pyx_tuple__1281; +static PyObject *__pyx_tuple__1282; +static PyObject *__pyx_tuple__1283; +static PyObject *__pyx_tuple__1284; +static PyObject *__pyx_tuple__1285; +static PyObject *__pyx_tuple__1286; +static PyObject *__pyx_tuple__1287; +static PyObject *__pyx_tuple__1288; +static PyObject *__pyx_tuple__1289; +static PyObject *__pyx_tuple__1290; +static PyObject *__pyx_tuple__1291; +static PyObject *__pyx_tuple__1292; +static PyObject *__pyx_tuple__1293; +static PyObject *__pyx_tuple__1294; +static PyObject *__pyx_tuple__1295; +static PyObject *__pyx_tuple__1296; +static PyObject *__pyx_tuple__1297; +static PyObject *__pyx_tuple__1298; +static PyObject *__pyx_tuple__1299; +static PyObject *__pyx_tuple__1300; +static PyObject *__pyx_tuple__1301; +static PyObject *__pyx_tuple__1302; +static PyObject *__pyx_tuple__1303; +static PyObject *__pyx_tuple__1304; +static PyObject *__pyx_tuple__1305; +static PyObject *__pyx_tuple__1306; +static PyObject *__pyx_tuple__1307; +static PyObject *__pyx_tuple__1308; +static PyObject *__pyx_tuple__1309; +static PyObject *__pyx_tuple__1310; +static PyObject *__pyx_tuple__1311; +static PyObject *__pyx_tuple__1312; +static PyObject *__pyx_tuple__1313; +static PyObject *__pyx_tuple__1314; +static PyObject *__pyx_tuple__1315; +static PyObject *__pyx_tuple__1316; +static PyObject *__pyx_tuple__1317; +static PyObject *__pyx_tuple__1318; +static PyObject *__pyx_tuple__1319; +static PyObject *__pyx_tuple__1320; +static PyObject *__pyx_tuple__1321; +static PyObject *__pyx_tuple__1322; +static PyObject *__pyx_tuple__1323; +static PyObject *__pyx_tuple__1324; +static PyObject *__pyx_tuple__1325; +static PyObject *__pyx_tuple__1326; +static PyObject *__pyx_tuple__1327; +static PyObject *__pyx_tuple__1328; +static PyObject *__pyx_tuple__1329; +static PyObject *__pyx_tuple__1330; +static PyObject *__pyx_tuple__1331; +static PyObject *__pyx_tuple__1332; +static PyObject *__pyx_tuple__1333; +static PyObject *__pyx_tuple__1334; +static PyObject *__pyx_tuple__1335; +static PyObject *__pyx_tuple__1336; +static PyObject *__pyx_tuple__1337; +static PyObject *__pyx_tuple__1338; +static PyObject *__pyx_tuple__1339; +static PyObject *__pyx_tuple__1340; +static PyObject *__pyx_tuple__1341; +static PyObject *__pyx_tuple__1342; +static PyObject *__pyx_tuple__1343; +static PyObject *__pyx_tuple__1344; +static PyObject *__pyx_tuple__1345; +static PyObject *__pyx_tuple__1346; +static PyObject *__pyx_tuple__1347; +static PyObject *__pyx_tuple__1348; +static PyObject *__pyx_tuple__1349; +static PyObject *__pyx_tuple__1350; +static PyObject *__pyx_tuple__1351; +static PyObject *__pyx_tuple__1352; +static PyObject *__pyx_tuple__1353; +static PyObject *__pyx_tuple__1354; +static PyObject *__pyx_tuple__1355; +static PyObject *__pyx_tuple__1356; +static PyObject *__pyx_tuple__1357; +static PyObject *__pyx_tuple__1358; +static PyObject *__pyx_tuple__1359; +static PyObject *__pyx_tuple__1360; +static PyObject *__pyx_tuple__1361; +static PyObject *__pyx_tuple__1362; +static PyObject *__pyx_tuple__1363; +static PyObject *__pyx_tuple__1364; +static PyObject *__pyx_tuple__1365; +static PyObject *__pyx_tuple__1366; +static PyObject *__pyx_tuple__1367; +static PyObject *__pyx_tuple__1368; +static PyObject *__pyx_tuple__1369; +static PyObject *__pyx_tuple__1370; +static PyObject *__pyx_tuple__1371; +static PyObject *__pyx_tuple__1372; +static PyObject *__pyx_tuple__1373; +static PyObject *__pyx_tuple__1374; +static PyObject *__pyx_tuple__1375; +static PyObject *__pyx_tuple__1376; +static PyObject *__pyx_tuple__1377; +static PyObject *__pyx_tuple__1378; +static PyObject *__pyx_tuple__1379; +static PyObject *__pyx_tuple__1380; +static PyObject *__pyx_tuple__1381; +static PyObject *__pyx_tuple__1382; +static PyObject *__pyx_tuple__1383; +static PyObject *__pyx_tuple__1384; +static PyObject *__pyx_tuple__1385; +static PyObject *__pyx_tuple__1386; +static PyObject *__pyx_tuple__1387; +static PyObject *__pyx_tuple__1388; +static PyObject *__pyx_tuple__1389; +static PyObject *__pyx_tuple__1390; +static PyObject *__pyx_tuple__1391; +static PyObject *__pyx_tuple__1392; +static PyObject *__pyx_tuple__1393; +static PyObject *__pyx_tuple__1394; +static PyObject *__pyx_tuple__1395; +static PyObject *__pyx_tuple__1396; +static PyObject *__pyx_tuple__1397; +static PyObject *__pyx_tuple__1398; +static PyObject *__pyx_tuple__1399; +static PyObject *__pyx_tuple__1400; +static PyObject *__pyx_tuple__1401; +static PyObject *__pyx_tuple__1402; +static PyObject *__pyx_tuple__1403; +static PyObject *__pyx_tuple__1404; +static PyObject *__pyx_tuple__1405; +static PyObject *__pyx_tuple__1406; +static PyObject *__pyx_tuple__1407; +static PyObject *__pyx_tuple__1408; +static PyObject *__pyx_tuple__1409; +static PyObject *__pyx_tuple__1410; +static PyObject *__pyx_tuple__1411; +static PyObject *__pyx_tuple__1412; +static PyObject *__pyx_tuple__1413; +static PyObject *__pyx_tuple__1414; +static PyObject *__pyx_tuple__1415; +static PyObject *__pyx_tuple__1416; +static PyObject *__pyx_tuple__1417; +static PyObject *__pyx_tuple__1418; +static PyObject *__pyx_tuple__1419; +static PyObject *__pyx_tuple__1420; +static PyObject *__pyx_tuple__1421; +static PyObject *__pyx_tuple__1422; +static PyObject *__pyx_tuple__1423; +static PyObject *__pyx_tuple__1424; +static PyObject *__pyx_tuple__1425; +static PyObject *__pyx_tuple__1426; +static PyObject *__pyx_tuple__1427; +static PyObject *__pyx_tuple__1428; +static PyObject *__pyx_tuple__1429; +static PyObject *__pyx_tuple__1430; +static PyObject *__pyx_tuple__1431; +static PyObject *__pyx_tuple__1432; +static PyObject *__pyx_tuple__1433; +static PyObject *__pyx_tuple__1434; +static PyObject *__pyx_tuple__1435; +static PyObject *__pyx_tuple__1436; +static PyObject *__pyx_tuple__1437; +static PyObject *__pyx_tuple__1438; +static PyObject *__pyx_tuple__1439; +static PyObject *__pyx_tuple__1440; +static PyObject *__pyx_tuple__1441; +static PyObject *__pyx_tuple__1442; +static PyObject *__pyx_tuple__1443; +static PyObject *__pyx_tuple__1444; +static PyObject *__pyx_tuple__1445; +static PyObject *__pyx_tuple__1446; +static PyObject *__pyx_tuple__1447; +static PyObject *__pyx_tuple__1448; +static PyObject *__pyx_tuple__1449; +static PyObject *__pyx_tuple__1450; +static PyObject *__pyx_tuple__1451; +static PyObject *__pyx_tuple__1452; +static PyObject *__pyx_tuple__1453; +static PyObject *__pyx_tuple__1454; +static PyObject *__pyx_tuple__1455; +static PyObject *__pyx_tuple__1456; +static PyObject *__pyx_tuple__1457; +static PyObject *__pyx_tuple__1458; +static PyObject *__pyx_tuple__1459; +static PyObject *__pyx_tuple__1460; +static PyObject *__pyx_tuple__1461; +static PyObject *__pyx_tuple__1462; +static PyObject *__pyx_tuple__1463; +static PyObject *__pyx_tuple__1464; +static PyObject *__pyx_tuple__1465; +static PyObject *__pyx_tuple__1466; +static PyObject *__pyx_tuple__1467; +static PyObject *__pyx_tuple__1468; +static PyObject *__pyx_tuple__1469; +static PyObject *__pyx_tuple__1470; +static PyObject *__pyx_tuple__1471; +static PyObject *__pyx_tuple__1472; +static PyObject *__pyx_tuple__1473; +static PyObject *__pyx_tuple__1474; +static PyObject *__pyx_tuple__1475; +static PyObject *__pyx_tuple__1476; +static PyObject *__pyx_tuple__1477; +static PyObject *__pyx_tuple__1478; +static PyObject *__pyx_tuple__1479; +static PyObject *__pyx_tuple__1480; +static PyObject *__pyx_tuple__1481; +static PyObject *__pyx_tuple__1482; +static PyObject *__pyx_tuple__1483; +static PyObject *__pyx_tuple__1484; +static PyObject *__pyx_tuple__1485; +static PyObject *__pyx_tuple__1486; +static PyObject *__pyx_tuple__1487; +static PyObject *__pyx_tuple__1488; +static PyObject *__pyx_tuple__1489; +static PyObject *__pyx_tuple__1490; +static PyObject *__pyx_tuple__1491; +static PyObject *__pyx_tuple__1492; +static PyObject *__pyx_tuple__1493; +static PyObject *__pyx_tuple__1494; +static PyObject *__pyx_tuple__1495; +static PyObject *__pyx_tuple__1496; +static PyObject *__pyx_tuple__1497; +static PyObject *__pyx_tuple__1498; +static PyObject *__pyx_tuple__1499; +static PyObject *__pyx_tuple__1500; +static PyObject *__pyx_tuple__1501; +static PyObject *__pyx_tuple__1502; +static PyObject *__pyx_tuple__1503; +static PyObject *__pyx_tuple__1504; +static PyObject *__pyx_tuple__1505; +static PyObject *__pyx_tuple__1506; +static PyObject *__pyx_tuple__1507; +static PyObject *__pyx_tuple__1508; +static PyObject *__pyx_tuple__1509; +static PyObject *__pyx_tuple__1510; +static PyObject *__pyx_tuple__1511; +static PyObject *__pyx_tuple__1512; +static PyObject *__pyx_tuple__1513; +static PyObject *__pyx_tuple__1514; +static PyObject *__pyx_tuple__1515; +static PyObject *__pyx_tuple__1516; +static PyObject *__pyx_tuple__1517; +static PyObject *__pyx_tuple__1518; +static PyObject *__pyx_tuple__1519; +static PyObject *__pyx_tuple__1520; +static PyObject *__pyx_tuple__1521; +static PyObject *__pyx_tuple__1522; +static PyObject *__pyx_tuple__1523; +static PyObject *__pyx_tuple__1524; +static PyObject *__pyx_tuple__1525; +static PyObject *__pyx_tuple__1526; +static PyObject *__pyx_tuple__1527; +static PyObject *__pyx_tuple__1528; +static PyObject *__pyx_tuple__1529; +static PyObject *__pyx_tuple__1530; +static PyObject *__pyx_tuple__1531; +static PyObject *__pyx_tuple__1532; +static PyObject *__pyx_tuple__1533; +static PyObject *__pyx_tuple__1534; +static PyObject *__pyx_tuple__1535; +static PyObject *__pyx_tuple__1536; +static PyObject *__pyx_tuple__1537; +static PyObject *__pyx_tuple__1538; +static PyObject *__pyx_tuple__1539; +static PyObject *__pyx_tuple__1540; +static PyObject *__pyx_tuple__1541; +static PyObject *__pyx_tuple__1542; +static PyObject *__pyx_tuple__1543; +static PyObject *__pyx_tuple__1544; +static PyObject *__pyx_tuple__1545; +static PyObject *__pyx_tuple__1546; +static PyObject *__pyx_tuple__1547; +static PyObject *__pyx_tuple__1548; +static PyObject *__pyx_tuple__1549; +static PyObject *__pyx_tuple__1550; +static PyObject *__pyx_tuple__1551; +static PyObject *__pyx_tuple__1552; +static PyObject *__pyx_tuple__1553; +static PyObject *__pyx_tuple__1554; +static PyObject *__pyx_tuple__1555; +static PyObject *__pyx_tuple__1556; +static PyObject *__pyx_tuple__1557; +static PyObject *__pyx_tuple__1558; +static PyObject *__pyx_tuple__1559; +static PyObject *__pyx_tuple__1560; +static PyObject *__pyx_tuple__1561; +static PyObject *__pyx_tuple__1562; +static PyObject *__pyx_tuple__1563; +static PyObject *__pyx_tuple__1564; +static PyObject *__pyx_tuple__1565; +static PyObject *__pyx_tuple__1566; +static PyObject *__pyx_tuple__1567; +static PyObject *__pyx_tuple__1568; +static PyObject *__pyx_tuple__1569; +static PyObject *__pyx_tuple__1570; +static PyObject *__pyx_tuple__1571; +static PyObject *__pyx_tuple__1572; +static PyObject *__pyx_tuple__1573; +static PyObject *__pyx_tuple__1574; +static PyObject *__pyx_tuple__1575; +static PyObject *__pyx_tuple__1576; +static PyObject *__pyx_tuple__1577; +static PyObject *__pyx_tuple__1578; +static PyObject *__pyx_tuple__1579; +static PyObject *__pyx_tuple__1580; +static PyObject *__pyx_tuple__1581; +static PyObject *__pyx_tuple__1582; +static PyObject *__pyx_tuple__1583; +static PyObject *__pyx_tuple__1584; +static PyObject *__pyx_tuple__1585; +static PyObject *__pyx_tuple__1586; +static PyObject *__pyx_tuple__1587; +static PyObject *__pyx_tuple__1588; +static PyObject *__pyx_tuple__1589; +static PyObject *__pyx_tuple__1590; +static PyObject *__pyx_tuple__1591; +static PyObject *__pyx_tuple__1592; +static PyObject *__pyx_tuple__1593; +static PyObject *__pyx_tuple__1594; +static PyObject *__pyx_tuple__1595; +static PyObject *__pyx_tuple__1596; +static PyObject *__pyx_tuple__1597; +static PyObject *__pyx_tuple__1598; +static PyObject *__pyx_tuple__1599; +static PyObject *__pyx_tuple__1600; +static PyObject *__pyx_tuple__1601; +static PyObject *__pyx_tuple__1602; +static PyObject *__pyx_tuple__1603; +static PyObject *__pyx_tuple__1604; +static PyObject *__pyx_tuple__1605; +static PyObject *__pyx_tuple__1606; +static PyObject *__pyx_tuple__1607; +static PyObject *__pyx_tuple__1608; +static PyObject *__pyx_tuple__1609; +static PyObject *__pyx_tuple__1610; +static PyObject *__pyx_tuple__1611; +static PyObject *__pyx_tuple__1612; +static PyObject *__pyx_tuple__1613; +static PyObject *__pyx_tuple__1614; +static PyObject *__pyx_tuple__1615; +static PyObject *__pyx_tuple__1616; +static PyObject *__pyx_tuple__1617; +static PyObject *__pyx_tuple__1618; +static PyObject *__pyx_tuple__1619; +static PyObject *__pyx_tuple__1620; +static PyObject *__pyx_tuple__1621; +static PyObject *__pyx_tuple__1622; +static PyObject *__pyx_tuple__1623; +static PyObject *__pyx_tuple__1624; +static PyObject *__pyx_tuple__1625; +static PyObject *__pyx_tuple__1626; +static PyObject *__pyx_tuple__1627; +static PyObject *__pyx_tuple__1628; +static PyObject *__pyx_tuple__1629; +static PyObject *__pyx_tuple__1630; +static PyObject *__pyx_tuple__1631; +static PyObject *__pyx_tuple__1632; +static PyObject *__pyx_tuple__1633; +static PyObject *__pyx_tuple__1634; +static PyObject *__pyx_tuple__1635; +static PyObject *__pyx_tuple__1636; +static PyObject *__pyx_tuple__1637; +static PyObject *__pyx_tuple__1638; +static PyObject *__pyx_tuple__1639; +static PyObject *__pyx_tuple__1640; +static PyObject *__pyx_tuple__1641; +static PyObject *__pyx_tuple__1642; +static PyObject *__pyx_tuple__1643; +static PyObject *__pyx_tuple__1644; +static PyObject *__pyx_tuple__1645; +static PyObject *__pyx_tuple__1646; +static PyObject *__pyx_tuple__1647; +static PyObject *__pyx_tuple__1648; +static PyObject *__pyx_tuple__1649; +static PyObject *__pyx_tuple__1650; +static PyObject *__pyx_tuple__1651; +static PyObject *__pyx_tuple__1652; +static PyObject *__pyx_tuple__1653; +static PyObject *__pyx_tuple__1654; +static PyObject *__pyx_tuple__1655; +static PyObject *__pyx_tuple__1656; +static PyObject *__pyx_tuple__1657; +static PyObject *__pyx_tuple__1658; +static PyObject *__pyx_tuple__1659; +static PyObject *__pyx_tuple__1660; +static PyObject *__pyx_tuple__1661; +static PyObject *__pyx_tuple__1662; +static PyObject *__pyx_tuple__1663; +static PyObject *__pyx_tuple__1664; +static PyObject *__pyx_tuple__1665; +static PyObject *__pyx_tuple__1666; +static PyObject *__pyx_tuple__1667; +static PyObject *__pyx_tuple__1668; +static PyObject *__pyx_tuple__1669; +static PyObject *__pyx_tuple__1670; +static PyObject *__pyx_tuple__1671; +static PyObject *__pyx_tuple__1672; +static PyObject *__pyx_tuple__1673; +static PyObject *__pyx_tuple__1674; +static PyObject *__pyx_tuple__1675; +static PyObject *__pyx_tuple__1676; +static PyObject *__pyx_tuple__1677; +static PyObject *__pyx_tuple__1678; +static PyObject *__pyx_tuple__1679; +static PyObject *__pyx_tuple__1680; +static PyObject *__pyx_tuple__1681; +static PyObject *__pyx_tuple__1682; +static PyObject *__pyx_tuple__1683; +static PyObject *__pyx_tuple__1684; +static PyObject *__pyx_tuple__1685; +static PyObject *__pyx_tuple__1686; +static PyObject *__pyx_tuple__1687; +static PyObject *__pyx_tuple__1688; +static PyObject *__pyx_tuple__1689; +static PyObject *__pyx_tuple__1690; +static PyObject *__pyx_tuple__1691; +static PyObject *__pyx_tuple__1692; +static PyObject *__pyx_tuple__1693; +static PyObject *__pyx_tuple__1694; +static PyObject *__pyx_tuple__1695; +static PyObject *__pyx_tuple__1696; +static PyObject *__pyx_tuple__1697; +static PyObject *__pyx_tuple__1698; +static PyObject *__pyx_tuple__1699; +static PyObject *__pyx_tuple__1700; +static PyObject *__pyx_tuple__1701; +static PyObject *__pyx_tuple__1702; +static PyObject *__pyx_tuple__1703; +static PyObject *__pyx_tuple__1704; +static PyObject *__pyx_tuple__1705; +static PyObject *__pyx_tuple__1706; +static PyObject *__pyx_tuple__1707; +static PyObject *__pyx_tuple__1708; +static PyObject *__pyx_tuple__1709; +static PyObject *__pyx_tuple__1710; +static PyObject *__pyx_tuple__1711; +static PyObject *__pyx_tuple__1712; +static PyObject *__pyx_tuple__1713; +static PyObject *__pyx_tuple__1714; +static PyObject *__pyx_tuple__1715; +static PyObject *__pyx_tuple__1716; +static PyObject *__pyx_tuple__1717; +static PyObject *__pyx_tuple__1718; +static PyObject *__pyx_tuple__1719; +static PyObject *__pyx_tuple__1720; +static PyObject *__pyx_tuple__1721; +static PyObject *__pyx_tuple__1722; +static PyObject *__pyx_tuple__1723; +static PyObject *__pyx_tuple__1724; +static PyObject *__pyx_tuple__1725; +static PyObject *__pyx_tuple__1726; +static PyObject *__pyx_tuple__1727; +static PyObject *__pyx_tuple__1728; +static PyObject *__pyx_tuple__1729; +static PyObject *__pyx_tuple__1730; +static PyObject *__pyx_tuple__1731; +static PyObject *__pyx_tuple__1732; +static PyObject *__pyx_tuple__1733; +static PyObject *__pyx_tuple__1734; +static PyObject *__pyx_tuple__1735; +static PyObject *__pyx_tuple__1736; +static PyObject *__pyx_tuple__1737; +static PyObject *__pyx_tuple__1738; +static PyObject *__pyx_tuple__1739; +static PyObject *__pyx_tuple__1740; +static PyObject *__pyx_tuple__1741; +static PyObject *__pyx_tuple__1742; +static PyObject *__pyx_tuple__1743; +static PyObject *__pyx_tuple__1744; +static PyObject *__pyx_tuple__1745; +static PyObject *__pyx_tuple__1746; +static PyObject *__pyx_tuple__1747; +static PyObject *__pyx_tuple__1748; +static PyObject *__pyx_tuple__1749; +static PyObject *__pyx_tuple__1750; +static PyObject *__pyx_tuple__1751; +static PyObject *__pyx_tuple__1752; +static PyObject *__pyx_tuple__1753; +static PyObject *__pyx_tuple__1754; +static PyObject *__pyx_tuple__1755; +static PyObject *__pyx_tuple__1756; +static PyObject *__pyx_tuple__1757; +static PyObject *__pyx_tuple__1758; +static PyObject *__pyx_tuple__1759; +static PyObject *__pyx_tuple__1760; +static PyObject *__pyx_tuple__1761; +static PyObject *__pyx_tuple__1762; +static PyObject *__pyx_tuple__1763; +static PyObject *__pyx_tuple__1764; +static PyObject *__pyx_tuple__1765; +static PyObject *__pyx_tuple__1766; +static PyObject *__pyx_tuple__1767; +static PyObject *__pyx_tuple__1768; +static PyObject *__pyx_tuple__1769; +static PyObject *__pyx_tuple__1770; +static PyObject *__pyx_tuple__1771; +static PyObject *__pyx_tuple__1772; +static PyObject *__pyx_tuple__1773; +static PyObject *__pyx_tuple__1774; +static PyObject *__pyx_tuple__1775; +static PyObject *__pyx_tuple__1776; +static PyObject *__pyx_tuple__1777; +static PyObject *__pyx_tuple__1778; +static PyObject *__pyx_tuple__1779; +static PyObject *__pyx_tuple__1780; +static PyObject *__pyx_tuple__1781; +static PyObject *__pyx_tuple__1782; +static PyObject *__pyx_tuple__1783; +static PyObject *__pyx_tuple__1784; +static PyObject *__pyx_tuple__1785; +static PyObject *__pyx_tuple__1786; +static PyObject *__pyx_tuple__1787; +static PyObject *__pyx_tuple__1788; +static PyObject *__pyx_tuple__1789; +static PyObject *__pyx_tuple__1790; +static PyObject *__pyx_tuple__1791; +static PyObject *__pyx_tuple__1792; +static PyObject *__pyx_tuple__1793; +static PyObject *__pyx_tuple__1794; +static PyObject *__pyx_tuple__1795; +static PyObject *__pyx_tuple__1796; +static PyObject *__pyx_tuple__1797; +static PyObject *__pyx_tuple__1798; +static PyObject *__pyx_tuple__1799; +static PyObject *__pyx_tuple__1800; +static PyObject *__pyx_tuple__1801; +static PyObject *__pyx_tuple__1802; +static PyObject *__pyx_tuple__1803; +static PyObject *__pyx_tuple__1804; +static PyObject *__pyx_tuple__1805; +static PyObject *__pyx_tuple__1806; +static PyObject *__pyx_tuple__1807; +static PyObject *__pyx_tuple__1808; +static PyObject *__pyx_tuple__1809; +static PyObject *__pyx_tuple__1810; +static PyObject *__pyx_tuple__1811; +static PyObject *__pyx_tuple__1812; +static PyObject *__pyx_tuple__1813; +static PyObject *__pyx_tuple__1814; +static PyObject *__pyx_tuple__1815; +static PyObject *__pyx_tuple__1816; +static PyObject *__pyx_tuple__1817; +static PyObject *__pyx_tuple__1818; +static PyObject *__pyx_tuple__1819; +static PyObject *__pyx_tuple__1820; +static PyObject *__pyx_tuple__1821; +static PyObject *__pyx_tuple__1822; +static PyObject *__pyx_tuple__1823; +static PyObject *__pyx_tuple__1824; +static PyObject *__pyx_tuple__1825; +static PyObject *__pyx_tuple__1826; +static PyObject *__pyx_tuple__1827; +static PyObject *__pyx_tuple__1828; +static PyObject *__pyx_tuple__1829; +static PyObject *__pyx_tuple__1830; +static PyObject *__pyx_tuple__1831; +static PyObject *__pyx_tuple__1832; +static PyObject *__pyx_tuple__1833; +static PyObject *__pyx_tuple__1834; +static PyObject *__pyx_tuple__1835; +static PyObject *__pyx_tuple__1836; +static PyObject *__pyx_tuple__1837; +static PyObject *__pyx_tuple__1838; +static PyObject *__pyx_tuple__1839; +static PyObject *__pyx_tuple__1840; +static PyObject *__pyx_tuple__1841; +static PyObject *__pyx_tuple__1842; +static PyObject *__pyx_tuple__1843; +static PyObject *__pyx_tuple__1844; +static PyObject *__pyx_tuple__1845; +static PyObject *__pyx_tuple__1846; +static PyObject *__pyx_tuple__1847; +static PyObject *__pyx_tuple__1848; +static PyObject *__pyx_tuple__1849; +static PyObject *__pyx_tuple__1850; +static PyObject *__pyx_tuple__1851; +static PyObject *__pyx_tuple__1852; +static PyObject *__pyx_tuple__1853; +static PyObject *__pyx_tuple__1854; +static PyObject *__pyx_tuple__1855; +static PyObject *__pyx_tuple__1856; +static PyObject *__pyx_tuple__1857; +static PyObject *__pyx_tuple__1858; +static PyObject *__pyx_tuple__1859; +static PyObject *__pyx_tuple__1860; +static PyObject *__pyx_tuple__1861; +static PyObject *__pyx_tuple__1862; +static PyObject *__pyx_tuple__1863; +static PyObject *__pyx_tuple__1864; +static PyObject *__pyx_tuple__1865; +static PyObject *__pyx_tuple__1866; +static PyObject *__pyx_tuple__1867; +static PyObject *__pyx_tuple__1868; +static PyObject *__pyx_tuple__1869; +static PyObject *__pyx_tuple__1870; +static PyObject *__pyx_tuple__1871; +static PyObject *__pyx_tuple__1872; +static PyObject *__pyx_tuple__1873; +static PyObject *__pyx_tuple__1874; +static PyObject *__pyx_tuple__1875; +static PyObject *__pyx_tuple__1876; +static PyObject *__pyx_tuple__1877; +static PyObject *__pyx_tuple__1878; +static PyObject *__pyx_tuple__1879; +static PyObject *__pyx_tuple__1880; +static PyObject *__pyx_tuple__1881; +static PyObject *__pyx_tuple__1882; +static PyObject *__pyx_tuple__1883; +static PyObject *__pyx_tuple__1884; +static PyObject *__pyx_tuple__1885; +static PyObject *__pyx_tuple__1886; +static PyObject *__pyx_tuple__1887; +static PyObject *__pyx_tuple__1888; +static PyObject *__pyx_tuple__1889; +static PyObject *__pyx_tuple__1890; +static PyObject *__pyx_tuple__1891; +static PyObject *__pyx_tuple__1892; +static PyObject *__pyx_tuple__1893; +static PyObject *__pyx_tuple__1894; +static PyObject *__pyx_tuple__1895; +static PyObject *__pyx_tuple__1896; +static PyObject *__pyx_tuple__1897; +static PyObject *__pyx_tuple__1898; +static PyObject *__pyx_tuple__1899; +static PyObject *__pyx_tuple__1900; +static PyObject *__pyx_tuple__1901; +static PyObject *__pyx_tuple__1902; +static PyObject *__pyx_tuple__1903; +static PyObject *__pyx_tuple__1904; +static PyObject *__pyx_tuple__1905; +static PyObject *__pyx_tuple__1906; +static PyObject *__pyx_tuple__1907; +static PyObject *__pyx_tuple__1908; +static PyObject *__pyx_tuple__1909; +static PyObject *__pyx_tuple__1910; +static PyObject *__pyx_tuple__1911; +static PyObject *__pyx_tuple__1912; +static PyObject *__pyx_tuple__1913; +static PyObject *__pyx_tuple__1914; +static PyObject *__pyx_tuple__1915; +static PyObject *__pyx_tuple__1916; +static PyObject *__pyx_tuple__1917; +static PyObject *__pyx_tuple__1918; +static PyObject *__pyx_tuple__1919; +static PyObject *__pyx_tuple__1920; +static PyObject *__pyx_tuple__1921; +static PyObject *__pyx_tuple__1922; +static PyObject *__pyx_tuple__1923; +static PyObject *__pyx_tuple__1924; +static PyObject *__pyx_tuple__1925; +static PyObject *__pyx_tuple__1926; +static PyObject *__pyx_tuple__1927; +static PyObject *__pyx_tuple__1928; +static PyObject *__pyx_tuple__1929; +static PyObject *__pyx_tuple__1930; +static PyObject *__pyx_tuple__1931; +static PyObject *__pyx_tuple__1932; +static PyObject *__pyx_tuple__1933; +static PyObject *__pyx_tuple__1934; +static PyObject *__pyx_tuple__1935; +static PyObject *__pyx_tuple__1936; +static PyObject *__pyx_tuple__1937; +static PyObject *__pyx_tuple__1938; +static PyObject *__pyx_tuple__1939; +static PyObject *__pyx_tuple__1940; +static PyObject *__pyx_tuple__1941; +static PyObject *__pyx_tuple__1942; +static PyObject *__pyx_tuple__1943; +static PyObject *__pyx_tuple__1944; +static PyObject *__pyx_tuple__1945; +static PyObject *__pyx_tuple__1946; +static PyObject *__pyx_tuple__1947; +static PyObject *__pyx_tuple__1948; +static PyObject *__pyx_tuple__1949; +static PyObject *__pyx_tuple__1950; +static PyObject *__pyx_tuple__1951; +static PyObject *__pyx_tuple__1952; +static PyObject *__pyx_tuple__1953; +static PyObject *__pyx_tuple__1954; +static PyObject *__pyx_tuple__1955; +static PyObject *__pyx_tuple__1956; +static PyObject *__pyx_tuple__1957; +static PyObject *__pyx_tuple__1958; +static PyObject *__pyx_tuple__1959; +static PyObject *__pyx_tuple__1960; +static PyObject *__pyx_tuple__1961; +static PyObject *__pyx_tuple__1962; +static PyObject *__pyx_tuple__1963; +static PyObject *__pyx_tuple__1964; +static PyObject *__pyx_tuple__1965; +static PyObject *__pyx_tuple__1966; +static PyObject *__pyx_tuple__1967; +static PyObject *__pyx_tuple__1968; +static PyObject *__pyx_tuple__1969; +static PyObject *__pyx_tuple__1970; +static PyObject *__pyx_tuple__1971; +static PyObject *__pyx_tuple__1972; +static PyObject *__pyx_tuple__1973; +static PyObject *__pyx_tuple__1974; +static PyObject *__pyx_tuple__1975; +static PyObject *__pyx_tuple__1976; +static PyObject *__pyx_tuple__1977; +static PyObject *__pyx_tuple__1978; +static PyObject *__pyx_tuple__1979; +static PyObject *__pyx_tuple__1980; +static PyObject *__pyx_tuple__1981; +static PyObject *__pyx_tuple__1982; +static PyObject *__pyx_tuple__1983; +static PyObject *__pyx_tuple__1984; +static PyObject *__pyx_tuple__1985; +static PyObject *__pyx_tuple__1986; +static PyObject *__pyx_tuple__1987; +static PyObject *__pyx_tuple__1988; +static PyObject *__pyx_tuple__1989; +static PyObject *__pyx_tuple__1990; +static PyObject *__pyx_tuple__1991; +static PyObject *__pyx_tuple__1992; +static PyObject *__pyx_tuple__1993; +static PyObject *__pyx_tuple__1994; +static PyObject *__pyx_tuple__1995; +static PyObject *__pyx_tuple__1996; +static PyObject *__pyx_tuple__1997; +static PyObject *__pyx_tuple__1998; +static PyObject *__pyx_tuple__1999; +static PyObject *__pyx_tuple__2000; +static PyObject *__pyx_tuple__2001; +static PyObject *__pyx_tuple__2002; +static PyObject *__pyx_tuple__2003; +static PyObject *__pyx_tuple__2004; +static PyObject *__pyx_tuple__2005; +static PyObject *__pyx_tuple__2006; +static PyObject *__pyx_tuple__2007; +static PyObject *__pyx_tuple__2008; +static PyObject *__pyx_tuple__2009; +static PyObject *__pyx_tuple__2010; +static PyObject *__pyx_tuple__2011; +static PyObject *__pyx_tuple__2012; +static PyObject *__pyx_tuple__2013; +static PyObject *__pyx_tuple__2014; +static PyObject *__pyx_tuple__2015; +static PyObject *__pyx_tuple__2016; +static PyObject *__pyx_tuple__2017; +static PyObject *__pyx_tuple__2018; +static PyObject *__pyx_tuple__2019; +static PyObject *__pyx_tuple__2020; +static PyObject *__pyx_tuple__2021; +static PyObject *__pyx_tuple__2022; +static PyObject *__pyx_tuple__2023; +static PyObject *__pyx_tuple__2024; +static PyObject *__pyx_tuple__2025; +static PyObject *__pyx_tuple__2026; +static PyObject *__pyx_tuple__2027; +static PyObject *__pyx_tuple__2028; +static PyObject *__pyx_tuple__2029; +static PyObject *__pyx_tuple__2030; +static PyObject *__pyx_tuple__2031; +static PyObject *__pyx_tuple__2032; +static PyObject *__pyx_tuple__2033; +static PyObject *__pyx_tuple__2034; +static PyObject *__pyx_tuple__2035; +static PyObject *__pyx_tuple__2036; +static PyObject *__pyx_tuple__2037; +static PyObject *__pyx_tuple__2038; +static PyObject *__pyx_tuple__2039; +static PyObject *__pyx_tuple__2040; +static PyObject *__pyx_tuple__2041; +static PyObject *__pyx_tuple__2042; +static PyObject *__pyx_tuple__2043; +static PyObject *__pyx_tuple__2044; +static PyObject *__pyx_tuple__2045; +static PyObject *__pyx_tuple__2046; +static PyObject *__pyx_tuple__2047; +static PyObject *__pyx_tuple__2048; +static PyObject *__pyx_tuple__2049; +static PyObject *__pyx_tuple__2050; +static PyObject *__pyx_tuple__2051; +static PyObject *__pyx_tuple__2052; +static PyObject *__pyx_tuple__2053; +static PyObject *__pyx_tuple__2054; +static PyObject *__pyx_tuple__2055; +static PyObject *__pyx_tuple__2056; +static PyObject *__pyx_tuple__2057; +static PyObject *__pyx_tuple__2058; +static PyObject *__pyx_tuple__2059; +static PyObject *__pyx_tuple__2060; +static PyObject *__pyx_tuple__2061; +static PyObject *__pyx_tuple__2062; +static PyObject *__pyx_tuple__2063; +static PyObject *__pyx_tuple__2064; +static PyObject *__pyx_tuple__2065; +static PyObject *__pyx_tuple__2066; +static PyObject *__pyx_tuple__2067; +static PyObject *__pyx_tuple__2068; +static PyObject *__pyx_tuple__2069; +static PyObject *__pyx_tuple__2070; +static PyObject *__pyx_tuple__2071; +static PyObject *__pyx_tuple__2072; +static PyObject *__pyx_tuple__2073; +static PyObject *__pyx_tuple__2074; +static PyObject *__pyx_tuple__2075; +static PyObject *__pyx_tuple__2076; +static PyObject *__pyx_tuple__2077; +static PyObject *__pyx_tuple__2078; +static PyObject *__pyx_tuple__2079; +static PyObject *__pyx_tuple__2080; +static PyObject *__pyx_tuple__2081; +static PyObject *__pyx_tuple__2082; +static PyObject *__pyx_tuple__2083; +static PyObject *__pyx_tuple__2084; +static PyObject *__pyx_tuple__2085; +static PyObject *__pyx_tuple__2086; +static PyObject *__pyx_tuple__2087; +static PyObject *__pyx_tuple__2088; +static PyObject *__pyx_tuple__2089; +static PyObject *__pyx_tuple__2090; +static PyObject *__pyx_tuple__2091; +static PyObject *__pyx_tuple__2092; +static PyObject *__pyx_tuple__2093; +static PyObject *__pyx_tuple__2094; +static PyObject *__pyx_tuple__2095; +static PyObject *__pyx_tuple__2096; +static PyObject *__pyx_tuple__2097; +static PyObject *__pyx_tuple__2098; +static PyObject *__pyx_tuple__2099; +static PyObject *__pyx_tuple__2100; +static PyObject *__pyx_tuple__2101; +static PyObject *__pyx_tuple__2102; +static PyObject *__pyx_tuple__2103; +static PyObject *__pyx_tuple__2104; +static PyObject *__pyx_tuple__2105; +static PyObject *__pyx_tuple__2106; +static PyObject *__pyx_tuple__2107; +static PyObject *__pyx_tuple__2108; +static PyObject *__pyx_tuple__2109; +static PyObject *__pyx_tuple__2110; +static PyObject *__pyx_tuple__2111; +static PyObject *__pyx_tuple__2112; +static PyObject *__pyx_tuple__2113; +static PyObject *__pyx_tuple__2114; +static PyObject *__pyx_tuple__2115; +static PyObject *__pyx_tuple__2116; +static PyObject *__pyx_tuple__2117; +static PyObject *__pyx_tuple__2118; +static PyObject *__pyx_tuple__2119; +static PyObject *__pyx_tuple__2120; +static PyObject *__pyx_tuple__2121; +static PyObject *__pyx_tuple__2122; +static PyObject *__pyx_tuple__2123; +static PyObject *__pyx_tuple__2124; +static PyObject *__pyx_tuple__2125; +static PyObject *__pyx_tuple__2126; +static PyObject *__pyx_tuple__2127; +static PyObject *__pyx_tuple__2128; +static PyObject *__pyx_tuple__2129; +static PyObject *__pyx_tuple__2130; +static PyObject *__pyx_tuple__2131; +static PyObject *__pyx_tuple__2132; +static PyObject *__pyx_tuple__2133; +static PyObject *__pyx_tuple__2134; +static PyObject *__pyx_tuple__2135; +static PyObject *__pyx_tuple__2136; +static PyObject *__pyx_tuple__2137; +static PyObject *__pyx_tuple__2138; +static PyObject *__pyx_tuple__2139; +static PyObject *__pyx_tuple__2140; +static PyObject *__pyx_tuple__2141; +static PyObject *__pyx_tuple__2142; +static PyObject *__pyx_tuple__2143; +static PyObject *__pyx_tuple__2144; +static PyObject *__pyx_tuple__2145; +static PyObject *__pyx_tuple__2146; +static PyObject *__pyx_tuple__2147; +static PyObject *__pyx_tuple__2148; +static PyObject *__pyx_tuple__2149; +static PyObject *__pyx_tuple__2150; +static PyObject *__pyx_tuple__2151; +static PyObject *__pyx_tuple__2152; +static PyObject *__pyx_tuple__2153; +static PyObject *__pyx_tuple__2154; +static PyObject *__pyx_tuple__2155; +static PyObject *__pyx_tuple__2156; +static PyObject *__pyx_tuple__2157; +static PyObject *__pyx_tuple__2158; +static PyObject *__pyx_tuple__2159; +static PyObject *__pyx_tuple__2160; +static PyObject *__pyx_tuple__2161; +static PyObject *__pyx_tuple__2162; +static PyObject *__pyx_tuple__2163; +static PyObject *__pyx_tuple__2164; +static PyObject *__pyx_tuple__2165; +static PyObject *__pyx_tuple__2166; +static PyObject *__pyx_tuple__2167; +static PyObject *__pyx_tuple__2168; +static PyObject *__pyx_tuple__2169; +static PyObject *__pyx_tuple__2170; +static PyObject *__pyx_tuple__2171; +static PyObject *__pyx_tuple__2172; +static PyObject *__pyx_tuple__2173; +static PyObject *__pyx_tuple__2174; +static PyObject *__pyx_tuple__2175; +static PyObject *__pyx_tuple__2176; +static PyObject *__pyx_tuple__2177; +static PyObject *__pyx_tuple__2178; +static PyObject *__pyx_tuple__2179; +static PyObject *__pyx_tuple__2180; +static PyObject *__pyx_tuple__2181; +static PyObject *__pyx_tuple__2182; +static PyObject *__pyx_tuple__2183; +static PyObject *__pyx_tuple__2184; +static PyObject *__pyx_tuple__2185; +static PyObject *__pyx_tuple__2186; +static PyObject *__pyx_tuple__2187; +static PyObject *__pyx_tuple__2188; +static PyObject *__pyx_tuple__2189; +static PyObject *__pyx_tuple__2190; +static PyObject *__pyx_tuple__2191; +static PyObject *__pyx_tuple__2192; +static PyObject *__pyx_tuple__2193; +static PyObject *__pyx_tuple__2194; +static PyObject *__pyx_tuple__2195; +static PyObject *__pyx_tuple__2196; +static PyObject *__pyx_tuple__2197; +static PyObject *__pyx_tuple__2198; +static PyObject *__pyx_tuple__2199; +static PyObject *__pyx_tuple__2200; +static PyObject *__pyx_tuple__2201; +static PyObject *__pyx_tuple__2202; +static PyObject *__pyx_tuple__2203; +static PyObject *__pyx_tuple__2204; +static PyObject *__pyx_tuple__2205; +static PyObject *__pyx_tuple__2206; +static PyObject *__pyx_tuple__2207; +static PyObject *__pyx_tuple__2208; +static PyObject *__pyx_tuple__2209; +static PyObject *__pyx_tuple__2210; +static PyObject *__pyx_tuple__2211; +static PyObject *__pyx_tuple__2212; +static PyObject *__pyx_tuple__2213; +static PyObject *__pyx_tuple__2214; +static PyObject *__pyx_tuple__2215; +static PyObject *__pyx_tuple__2216; +static PyObject *__pyx_tuple__2217; +static PyObject *__pyx_tuple__2218; +static PyObject *__pyx_tuple__2219; +static PyObject *__pyx_tuple__2220; +static PyObject *__pyx_tuple__2221; +static PyObject *__pyx_tuple__2222; +static PyObject *__pyx_tuple__2223; +static PyObject *__pyx_tuple__2224; +static PyObject *__pyx_tuple__2225; +static PyObject *__pyx_tuple__2226; +static PyObject *__pyx_tuple__2227; +static PyObject *__pyx_tuple__2228; +static PyObject *__pyx_tuple__2229; +static PyObject *__pyx_tuple__2230; +static PyObject *__pyx_tuple__2231; +static PyObject *__pyx_tuple__2232; +static PyObject *__pyx_tuple__2233; +static PyObject *__pyx_tuple__2234; +static PyObject *__pyx_tuple__2235; +static PyObject *__pyx_tuple__2236; +static PyObject *__pyx_tuple__2237; +static PyObject *__pyx_tuple__2238; +static PyObject *__pyx_tuple__2239; +static PyObject *__pyx_tuple__2240; +static PyObject *__pyx_tuple__2241; +static PyObject *__pyx_tuple__2242; +static PyObject *__pyx_tuple__2243; +static PyObject *__pyx_tuple__2244; +static PyObject *__pyx_tuple__2245; +static PyObject *__pyx_tuple__2246; +static PyObject *__pyx_tuple__2247; +static PyObject *__pyx_tuple__2248; +static PyObject *__pyx_tuple__2249; +static PyObject *__pyx_tuple__2250; +static PyObject *__pyx_tuple__2251; +static PyObject *__pyx_tuple__2252; +static PyObject *__pyx_tuple__2253; +static PyObject *__pyx_tuple__2254; +static PyObject *__pyx_tuple__2255; +static PyObject *__pyx_tuple__2256; +static PyObject *__pyx_tuple__2257; +static PyObject *__pyx_tuple__2258; +static PyObject *__pyx_tuple__2259; +static PyObject *__pyx_tuple__2260; +static PyObject *__pyx_tuple__2261; +static PyObject *__pyx_tuple__2262; +static PyObject *__pyx_tuple__2263; +static PyObject *__pyx_tuple__2264; +static PyObject *__pyx_tuple__2265; +static PyObject *__pyx_tuple__2266; +static PyObject *__pyx_tuple__2267; +static PyObject *__pyx_tuple__2268; +static PyObject *__pyx_tuple__2269; +static PyObject *__pyx_tuple__2270; +static PyObject *__pyx_tuple__2271; +static PyObject *__pyx_tuple__2272; +static PyObject *__pyx_tuple__2274; +static PyObject *__pyx_tuple__2276; +static PyObject *__pyx_tuple__2277; +static PyObject *__pyx_tuple__2279; +static PyObject *__pyx_tuple__2281; +static PyObject *__pyx_tuple__2283; +static PyObject *__pyx_tuple__2285; +static PyObject *__pyx_tuple__2287; +static PyObject *__pyx_tuple__2289; +static PyObject *__pyx_tuple__2291; +static PyObject *__pyx_tuple__2293; +static PyObject *__pyx_tuple__2295; +static PyObject *__pyx_tuple__2297; +static PyObject *__pyx_tuple__2299; +static PyObject *__pyx_tuple__2301; +static PyObject *__pyx_tuple__2303; +static PyObject *__pyx_tuple__2305; +static PyObject *__pyx_tuple__2307; +static PyObject *__pyx_tuple__2309; +static PyObject *__pyx_tuple__2311; +static PyObject *__pyx_tuple__2313; +static PyObject *__pyx_tuple__2315; +static PyObject *__pyx_tuple__2317; +static PyObject *__pyx_tuple__2319; +static PyObject *__pyx_tuple__2321; +static PyObject *__pyx_tuple__2323; +static PyObject *__pyx_tuple__2325; +static PyObject *__pyx_tuple__2327; +static PyObject *__pyx_tuple__2329; +static PyObject *__pyx_tuple__2331; +static PyObject *__pyx_tuple__2333; +static PyObject *__pyx_tuple__2335; +static PyObject *__pyx_tuple__2337; +static PyObject *__pyx_tuple__2339; +static PyObject *__pyx_tuple__2341; +static PyObject *__pyx_tuple__2343; +static PyObject *__pyx_tuple__2345; +static PyObject *__pyx_tuple__2347; +static PyObject *__pyx_tuple__2349; +static PyObject *__pyx_tuple__2351; +static PyObject *__pyx_tuple__2353; +static PyObject *__pyx_tuple__2355; +static PyObject *__pyx_tuple__2357; +static PyObject *__pyx_tuple__2359; +static PyObject *__pyx_tuple__2361; +static PyObject *__pyx_tuple__2363; +static PyObject *__pyx_tuple__2365; +static PyObject *__pyx_tuple__2367; +static PyObject *__pyx_tuple__2369; +static PyObject *__pyx_tuple__2371; +static PyObject *__pyx_tuple__2373; +static PyObject *__pyx_tuple__2375; +static PyObject *__pyx_tuple__2377; +static PyObject *__pyx_tuple__2379; +static PyObject *__pyx_tuple__2381; +static PyObject *__pyx_tuple__2383; +static PyObject *__pyx_tuple__2385; +static PyObject *__pyx_tuple__2387; +static PyObject *__pyx_tuple__2389; +static PyObject *__pyx_tuple__2391; +static PyObject *__pyx_tuple__2393; +static PyObject *__pyx_tuple__2395; +static PyObject *__pyx_tuple__2397; +static PyObject *__pyx_tuple__2399; +static PyObject *__pyx_tuple__2401; +static PyObject *__pyx_tuple__2403; +static PyObject *__pyx_tuple__2405; +static PyObject *__pyx_tuple__2407; +static PyObject *__pyx_tuple__2409; +static PyObject *__pyx_tuple__2411; +static PyObject *__pyx_tuple__2413; +static PyObject *__pyx_tuple__2415; +static PyObject *__pyx_tuple__2417; +static PyObject *__pyx_tuple__2419; +static PyObject *__pyx_tuple__2421; +static PyObject *__pyx_tuple__2423; +static PyObject *__pyx_tuple__2425; +static PyObject *__pyx_tuple__2427; +static PyObject *__pyx_tuple__2429; +static PyObject *__pyx_tuple__2431; +static PyObject *__pyx_tuple__2433; +static PyObject *__pyx_tuple__2435; +static PyObject *__pyx_tuple__2437; +static PyObject *__pyx_tuple__2439; +static PyObject *__pyx_tuple__2441; +static PyObject *__pyx_tuple__2443; +static PyObject *__pyx_tuple__2445; +static PyObject *__pyx_tuple__2447; +static PyObject *__pyx_tuple__2449; +static PyObject *__pyx_tuple__2451; +static PyObject *__pyx_tuple__2453; +static PyObject *__pyx_tuple__2455; +static PyObject *__pyx_tuple__2457; +static PyObject *__pyx_tuple__2459; +static PyObject *__pyx_tuple__2461; +static PyObject *__pyx_tuple__2463; +static PyObject *__pyx_tuple__2465; +static PyObject *__pyx_tuple__2467; +static PyObject *__pyx_tuple__2469; +static PyObject *__pyx_tuple__2471; +static PyObject *__pyx_tuple__2473; +static PyObject *__pyx_tuple__2475; +static PyObject *__pyx_tuple__2477; +static PyObject *__pyx_tuple__2479; +static PyObject *__pyx_tuple__2481; +static PyObject *__pyx_tuple__2483; +static PyObject *__pyx_tuple__2485; +static PyObject *__pyx_tuple__2487; +static PyObject *__pyx_tuple__2489; +static PyObject *__pyx_tuple__2491; +static PyObject *__pyx_tuple__2493; +static PyObject *__pyx_tuple__2495; +static PyObject *__pyx_tuple__2497; +static PyObject *__pyx_tuple__2499; +static PyObject *__pyx_tuple__2501; +static PyObject *__pyx_tuple__2503; +static PyObject *__pyx_tuple__2505; +static PyObject *__pyx_tuple__2507; +static PyObject *__pyx_tuple__2509; +static PyObject *__pyx_tuple__2511; +static PyObject *__pyx_tuple__2513; +static PyObject *__pyx_tuple__2515; +static PyObject *__pyx_tuple__2517; +static PyObject *__pyx_tuple__2519; +static PyObject *__pyx_tuple__2521; +static PyObject *__pyx_tuple__2523; +static PyObject *__pyx_tuple__2525; +static PyObject *__pyx_tuple__2527; +static PyObject *__pyx_tuple__2529; +static PyObject *__pyx_tuple__2531; +static PyObject *__pyx_tuple__2533; +static PyObject *__pyx_tuple__2535; +static PyObject *__pyx_tuple__2537; +static PyObject *__pyx_tuple__2539; +static PyObject *__pyx_tuple__2541; +static PyObject *__pyx_tuple__2543; +static PyObject *__pyx_tuple__2545; +static PyObject *__pyx_tuple__2547; +static PyObject *__pyx_tuple__2549; +static PyObject *__pyx_tuple__2551; +static PyObject *__pyx_tuple__2553; +static PyObject *__pyx_tuple__2555; +static PyObject *__pyx_tuple__2557; +static PyObject *__pyx_tuple__2559; +static PyObject *__pyx_tuple__2561; +static PyObject *__pyx_tuple__2563; +static PyObject *__pyx_tuple__2565; +static PyObject *__pyx_tuple__2567; +static PyObject *__pyx_tuple__2569; +static PyObject *__pyx_tuple__2571; +static PyObject *__pyx_tuple__2573; +static PyObject *__pyx_tuple__2575; +static PyObject *__pyx_tuple__2577; +static PyObject *__pyx_tuple__2579; +static PyObject *__pyx_tuple__2581; +static PyObject *__pyx_tuple__2583; +static PyObject *__pyx_tuple__2585; +static PyObject *__pyx_tuple__2587; +static PyObject *__pyx_tuple__2589; +static PyObject *__pyx_tuple__2591; +static PyObject *__pyx_tuple__2593; +static PyObject *__pyx_tuple__2595; +static PyObject *__pyx_tuple__2597; +static PyObject *__pyx_tuple__2599; +static PyObject *__pyx_tuple__2601; +static PyObject *__pyx_tuple__2603; +static PyObject *__pyx_tuple__2605; +static PyObject *__pyx_tuple__2607; +static PyObject *__pyx_tuple__2609; +static PyObject *__pyx_tuple__2611; +static PyObject *__pyx_tuple__2613; +static PyObject *__pyx_tuple__2615; +static PyObject *__pyx_tuple__2617; +static PyObject *__pyx_tuple__2619; +static PyObject *__pyx_tuple__2621; +static PyObject *__pyx_tuple__2623; +static PyObject *__pyx_tuple__2625; +static PyObject *__pyx_tuple__2627; +static PyObject *__pyx_tuple__2629; +static PyObject *__pyx_tuple__2631; +static PyObject *__pyx_tuple__2633; +static PyObject *__pyx_tuple__2635; +static PyObject *__pyx_tuple__2637; +static PyObject *__pyx_tuple__2639; +static PyObject *__pyx_tuple__2641; +static PyObject *__pyx_tuple__2642; +static PyObject *__pyx_tuple__2644; +static PyObject *__pyx_tuple__2646; +static PyObject *__pyx_tuple__2648; +static PyObject *__pyx_tuple__2650; +static PyObject *__pyx_tuple__2652; +static PyObject *__pyx_tuple__2654; +static PyObject *__pyx_tuple__2656; +static PyObject *__pyx_tuple__2658; +static PyObject *__pyx_tuple__2660; +static PyObject *__pyx_tuple__2662; +static PyObject *__pyx_tuple__2664; +static PyObject *__pyx_tuple__2666; +static PyObject *__pyx_tuple__2668; +static PyObject *__pyx_tuple__2670; +static PyObject *__pyx_tuple__2672; +static PyObject *__pyx_tuple__2674; +static PyObject *__pyx_tuple__2676; +static PyObject *__pyx_tuple__2678; +static PyObject *__pyx_tuple__2680; +static PyObject *__pyx_tuple__2682; +static PyObject *__pyx_tuple__2684; +static PyObject *__pyx_tuple__2686; +static PyObject *__pyx_tuple__2688; +static PyObject *__pyx_tuple__2690; +static PyObject *__pyx_tuple__2692; +static PyObject *__pyx_tuple__2694; +static PyObject *__pyx_tuple__2696; +static PyObject *__pyx_tuple__2698; +static PyObject *__pyx_tuple__2700; +static PyObject *__pyx_tuple__2702; +static PyObject *__pyx_tuple__2704; +static PyObject *__pyx_tuple__2706; +static PyObject *__pyx_tuple__2708; +static PyObject *__pyx_tuple__2710; +static PyObject *__pyx_tuple__2712; +static PyObject *__pyx_tuple__2714; +static PyObject *__pyx_tuple__2716; +static PyObject *__pyx_tuple__2718; +static PyObject *__pyx_tuple__2720; +static PyObject *__pyx_tuple__2722; +static PyObject *__pyx_tuple__2724; +static PyObject *__pyx_tuple__2726; +static PyObject *__pyx_tuple__2728; +static PyObject *__pyx_tuple__2730; +static PyObject *__pyx_tuple__2732; +static PyObject *__pyx_tuple__2734; +static PyObject *__pyx_tuple__2736; +static PyObject *__pyx_tuple__2738; +static PyObject *__pyx_tuple__2740; +static PyObject *__pyx_tuple__2742; +static PyObject *__pyx_tuple__2744; +static PyObject *__pyx_tuple__2746; +static PyObject *__pyx_tuple__2748; +static PyObject *__pyx_tuple__2750; +static PyObject *__pyx_tuple__2752; +static PyObject *__pyx_tuple__2754; +static PyObject *__pyx_tuple__2756; +static PyObject *__pyx_tuple__2758; +static PyObject *__pyx_tuple__2760; +static PyObject *__pyx_tuple__2762; +static PyObject *__pyx_tuple__2764; +static PyObject *__pyx_tuple__2766; +static PyObject *__pyx_tuple__2768; +static PyObject *__pyx_tuple__2770; +static PyObject *__pyx_tuple__2772; +static PyObject *__pyx_tuple__2774; +static PyObject *__pyx_tuple__2776; +static PyObject *__pyx_tuple__2778; +static PyObject *__pyx_tuple__2780; +static PyObject *__pyx_tuple__2782; +static PyObject *__pyx_tuple__2784; +static PyObject *__pyx_tuple__2786; +static PyObject *__pyx_tuple__2788; +static PyObject *__pyx_tuple__2790; +static PyObject *__pyx_tuple__2792; +static PyObject *__pyx_tuple__2794; +static PyObject *__pyx_tuple__2796; +static PyObject *__pyx_tuple__2798; +static PyObject *__pyx_tuple__2800; +static PyObject *__pyx_tuple__2802; +static PyObject *__pyx_tuple__2804; +static PyObject *__pyx_tuple__2806; +static PyObject *__pyx_tuple__2808; +static PyObject *__pyx_tuple__2810; +static PyObject *__pyx_tuple__2812; +static PyObject *__pyx_tuple__2814; +static PyObject *__pyx_tuple__2816; +static PyObject *__pyx_tuple__2818; +static PyObject *__pyx_tuple__2820; +static PyObject *__pyx_tuple__2822; +static PyObject *__pyx_tuple__2824; +static PyObject *__pyx_tuple__2826; +static PyObject *__pyx_tuple__2828; +static PyObject *__pyx_tuple__2830; +static PyObject *__pyx_tuple__2832; +static PyObject *__pyx_tuple__2834; +static PyObject *__pyx_tuple__2836; +static PyObject *__pyx_tuple__2838; +static PyObject *__pyx_tuple__2840; +static PyObject *__pyx_tuple__2842; +static PyObject *__pyx_tuple__2844; +static PyObject *__pyx_tuple__2846; +static PyObject *__pyx_tuple__2848; +static PyObject *__pyx_tuple__2850; +static PyObject *__pyx_tuple__2852; +static PyObject *__pyx_tuple__2854; +static PyObject *__pyx_tuple__2856; +static PyObject *__pyx_tuple__2858; +static PyObject *__pyx_tuple__2860; +static PyObject *__pyx_tuple__2862; +static PyObject *__pyx_tuple__2864; +static PyObject *__pyx_tuple__2866; +static PyObject *__pyx_tuple__2868; +static PyObject *__pyx_tuple__2870; +static PyObject *__pyx_tuple__2872; +static PyObject *__pyx_tuple__2874; +static PyObject *__pyx_tuple__2876; +static PyObject *__pyx_tuple__2878; +static PyObject *__pyx_tuple__2880; +static PyObject *__pyx_tuple__2882; +static PyObject *__pyx_tuple__2884; +static PyObject *__pyx_tuple__2886; +static PyObject *__pyx_tuple__2888; +static PyObject *__pyx_tuple__2890; +static PyObject *__pyx_tuple__2892; +static PyObject *__pyx_tuple__2894; +static PyObject *__pyx_tuple__2896; +static PyObject *__pyx_tuple__2898; +static PyObject *__pyx_tuple__2900; +static PyObject *__pyx_tuple__2902; +static PyObject *__pyx_tuple__2904; +static PyObject *__pyx_tuple__2906; +static PyObject *__pyx_tuple__2908; +static PyObject *__pyx_tuple__2910; +static PyObject *__pyx_tuple__2912; +static PyObject *__pyx_tuple__2914; +static PyObject *__pyx_tuple__2916; +static PyObject *__pyx_tuple__2918; +static PyObject *__pyx_tuple__2920; +static PyObject *__pyx_tuple__2922; +static PyObject *__pyx_tuple__2924; +static PyObject *__pyx_tuple__2926; +static PyObject *__pyx_tuple__2928; +static PyObject *__pyx_tuple__2930; +static PyObject *__pyx_tuple__2932; +static PyObject *__pyx_tuple__2934; +static PyObject *__pyx_tuple__2936; +static PyObject *__pyx_tuple__2938; +static PyObject *__pyx_tuple__2940; +static PyObject *__pyx_tuple__2942; +static PyObject *__pyx_tuple__2944; +static PyObject *__pyx_tuple__2946; +static PyObject *__pyx_tuple__2948; +static PyObject *__pyx_tuple__2950; +static PyObject *__pyx_tuple__2952; +static PyObject *__pyx_tuple__2954; +static PyObject *__pyx_tuple__2956; +static PyObject *__pyx_tuple__2958; +static PyObject *__pyx_tuple__2960; +static PyObject *__pyx_tuple__2962; +static PyObject *__pyx_tuple__2964; +static PyObject *__pyx_tuple__2966; +static PyObject *__pyx_tuple__2968; +static PyObject *__pyx_tuple__2970; +static PyObject *__pyx_tuple__2972; +static PyObject *__pyx_tuple__2974; +static PyObject *__pyx_tuple__2976; +static PyObject *__pyx_tuple__2978; +static PyObject *__pyx_tuple__2980; +static PyObject *__pyx_tuple__2982; +static PyObject *__pyx_tuple__2984; +static PyObject *__pyx_tuple__2986; +static PyObject *__pyx_codeobj__2273; +static PyObject *__pyx_codeobj__2275; +static PyObject *__pyx_codeobj__2278; +static PyObject *__pyx_codeobj__2280; +static PyObject *__pyx_codeobj__2282; +static PyObject *__pyx_codeobj__2284; +static PyObject *__pyx_codeobj__2286; +static PyObject *__pyx_codeobj__2288; +static PyObject *__pyx_codeobj__2290; +static PyObject *__pyx_codeobj__2292; +static PyObject *__pyx_codeobj__2294; +static PyObject *__pyx_codeobj__2296; +static PyObject *__pyx_codeobj__2298; +static PyObject *__pyx_codeobj__2300; +static PyObject *__pyx_codeobj__2302; +static PyObject *__pyx_codeobj__2304; +static PyObject *__pyx_codeobj__2306; +static PyObject *__pyx_codeobj__2308; +static PyObject *__pyx_codeobj__2310; +static PyObject *__pyx_codeobj__2312; +static PyObject *__pyx_codeobj__2314; +static PyObject *__pyx_codeobj__2316; +static PyObject *__pyx_codeobj__2318; +static PyObject *__pyx_codeobj__2320; +static PyObject *__pyx_codeobj__2322; +static PyObject *__pyx_codeobj__2324; +static PyObject *__pyx_codeobj__2326; +static PyObject *__pyx_codeobj__2328; +static PyObject *__pyx_codeobj__2330; +static PyObject *__pyx_codeobj__2332; +static PyObject *__pyx_codeobj__2334; +static PyObject *__pyx_codeobj__2336; +static PyObject *__pyx_codeobj__2338; +static PyObject *__pyx_codeobj__2340; +static PyObject *__pyx_codeobj__2342; +static PyObject *__pyx_codeobj__2344; +static PyObject *__pyx_codeobj__2346; +static PyObject *__pyx_codeobj__2348; +static PyObject *__pyx_codeobj__2350; +static PyObject *__pyx_codeobj__2352; +static PyObject *__pyx_codeobj__2354; +static PyObject *__pyx_codeobj__2356; +static PyObject *__pyx_codeobj__2358; +static PyObject *__pyx_codeobj__2360; +static PyObject *__pyx_codeobj__2362; +static PyObject *__pyx_codeobj__2364; +static PyObject *__pyx_codeobj__2366; +static PyObject *__pyx_codeobj__2368; +static PyObject *__pyx_codeobj__2370; +static PyObject *__pyx_codeobj__2372; +static PyObject *__pyx_codeobj__2374; +static PyObject *__pyx_codeobj__2376; +static PyObject *__pyx_codeobj__2378; +static PyObject *__pyx_codeobj__2380; +static PyObject *__pyx_codeobj__2382; +static PyObject *__pyx_codeobj__2384; +static PyObject *__pyx_codeobj__2386; +static PyObject *__pyx_codeobj__2388; +static PyObject *__pyx_codeobj__2390; +static PyObject *__pyx_codeobj__2392; +static PyObject *__pyx_codeobj__2394; +static PyObject *__pyx_codeobj__2396; +static PyObject *__pyx_codeobj__2398; +static PyObject *__pyx_codeobj__2400; +static PyObject *__pyx_codeobj__2402; +static PyObject *__pyx_codeobj__2404; +static PyObject *__pyx_codeobj__2406; +static PyObject *__pyx_codeobj__2408; +static PyObject *__pyx_codeobj__2410; +static PyObject *__pyx_codeobj__2412; +static PyObject *__pyx_codeobj__2414; +static PyObject *__pyx_codeobj__2416; +static PyObject *__pyx_codeobj__2418; +static PyObject *__pyx_codeobj__2420; +static PyObject *__pyx_codeobj__2422; +static PyObject *__pyx_codeobj__2424; +static PyObject *__pyx_codeobj__2426; +static PyObject *__pyx_codeobj__2428; +static PyObject *__pyx_codeobj__2430; +static PyObject *__pyx_codeobj__2432; +static PyObject *__pyx_codeobj__2434; +static PyObject *__pyx_codeobj__2436; +static PyObject *__pyx_codeobj__2438; +static PyObject *__pyx_codeobj__2440; +static PyObject *__pyx_codeobj__2442; +static PyObject *__pyx_codeobj__2444; +static PyObject *__pyx_codeobj__2446; +static PyObject *__pyx_codeobj__2448; +static PyObject *__pyx_codeobj__2450; +static PyObject *__pyx_codeobj__2452; +static PyObject *__pyx_codeobj__2454; +static PyObject *__pyx_codeobj__2456; +static PyObject *__pyx_codeobj__2458; +static PyObject *__pyx_codeobj__2460; +static PyObject *__pyx_codeobj__2462; +static PyObject *__pyx_codeobj__2464; +static PyObject *__pyx_codeobj__2466; +static PyObject *__pyx_codeobj__2468; +static PyObject *__pyx_codeobj__2470; +static PyObject *__pyx_codeobj__2472; +static PyObject *__pyx_codeobj__2474; +static PyObject *__pyx_codeobj__2476; +static PyObject *__pyx_codeobj__2478; +static PyObject *__pyx_codeobj__2480; +static PyObject *__pyx_codeobj__2482; +static PyObject *__pyx_codeobj__2484; +static PyObject *__pyx_codeobj__2486; +static PyObject *__pyx_codeobj__2488; +static PyObject *__pyx_codeobj__2490; +static PyObject *__pyx_codeobj__2492; +static PyObject *__pyx_codeobj__2494; +static PyObject *__pyx_codeobj__2496; +static PyObject *__pyx_codeobj__2498; +static PyObject *__pyx_codeobj__2500; +static PyObject *__pyx_codeobj__2502; +static PyObject *__pyx_codeobj__2504; +static PyObject *__pyx_codeobj__2506; +static PyObject *__pyx_codeobj__2508; +static PyObject *__pyx_codeobj__2510; +static PyObject *__pyx_codeobj__2512; +static PyObject *__pyx_codeobj__2514; +static PyObject *__pyx_codeobj__2516; +static PyObject *__pyx_codeobj__2518; +static PyObject *__pyx_codeobj__2520; +static PyObject *__pyx_codeobj__2522; +static PyObject *__pyx_codeobj__2524; +static PyObject *__pyx_codeobj__2526; +static PyObject *__pyx_codeobj__2528; +static PyObject *__pyx_codeobj__2530; +static PyObject *__pyx_codeobj__2532; +static PyObject *__pyx_codeobj__2534; +static PyObject *__pyx_codeobj__2536; +static PyObject *__pyx_codeobj__2538; +static PyObject *__pyx_codeobj__2540; +static PyObject *__pyx_codeobj__2542; +static PyObject *__pyx_codeobj__2544; +static PyObject *__pyx_codeobj__2546; +static PyObject *__pyx_codeobj__2548; +static PyObject *__pyx_codeobj__2550; +static PyObject *__pyx_codeobj__2552; +static PyObject *__pyx_codeobj__2554; +static PyObject *__pyx_codeobj__2556; +static PyObject *__pyx_codeobj__2558; +static PyObject *__pyx_codeobj__2560; +static PyObject *__pyx_codeobj__2562; +static PyObject *__pyx_codeobj__2564; +static PyObject *__pyx_codeobj__2566; +static PyObject *__pyx_codeobj__2568; +static PyObject *__pyx_codeobj__2570; +static PyObject *__pyx_codeobj__2572; +static PyObject *__pyx_codeobj__2574; +static PyObject *__pyx_codeobj__2576; +static PyObject *__pyx_codeobj__2578; +static PyObject *__pyx_codeobj__2580; +static PyObject *__pyx_codeobj__2582; +static PyObject *__pyx_codeobj__2584; +static PyObject *__pyx_codeobj__2586; +static PyObject *__pyx_codeobj__2588; +static PyObject *__pyx_codeobj__2590; +static PyObject *__pyx_codeobj__2592; +static PyObject *__pyx_codeobj__2594; +static PyObject *__pyx_codeobj__2596; +static PyObject *__pyx_codeobj__2598; +static PyObject *__pyx_codeobj__2600; +static PyObject *__pyx_codeobj__2602; +static PyObject *__pyx_codeobj__2604; +static PyObject *__pyx_codeobj__2606; +static PyObject *__pyx_codeobj__2608; +static PyObject *__pyx_codeobj__2610; +static PyObject *__pyx_codeobj__2612; +static PyObject *__pyx_codeobj__2614; +static PyObject *__pyx_codeobj__2616; +static PyObject *__pyx_codeobj__2618; +static PyObject *__pyx_codeobj__2620; +static PyObject *__pyx_codeobj__2622; +static PyObject *__pyx_codeobj__2624; +static PyObject *__pyx_codeobj__2626; +static PyObject *__pyx_codeobj__2628; +static PyObject *__pyx_codeobj__2630; +static PyObject *__pyx_codeobj__2632; +static PyObject *__pyx_codeobj__2634; +static PyObject *__pyx_codeobj__2636; +static PyObject *__pyx_codeobj__2638; +static PyObject *__pyx_codeobj__2640; +static PyObject *__pyx_codeobj__2643; +static PyObject *__pyx_codeobj__2645; +static PyObject *__pyx_codeobj__2647; +static PyObject *__pyx_codeobj__2649; +static PyObject *__pyx_codeobj__2651; +static PyObject *__pyx_codeobj__2653; +static PyObject *__pyx_codeobj__2655; +static PyObject *__pyx_codeobj__2657; +static PyObject *__pyx_codeobj__2659; +static PyObject *__pyx_codeobj__2661; +static PyObject *__pyx_codeobj__2663; +static PyObject *__pyx_codeobj__2665; +static PyObject *__pyx_codeobj__2667; +static PyObject *__pyx_codeobj__2669; +static PyObject *__pyx_codeobj__2671; +static PyObject *__pyx_codeobj__2673; +static PyObject *__pyx_codeobj__2675; +static PyObject *__pyx_codeobj__2677; +static PyObject *__pyx_codeobj__2679; +static PyObject *__pyx_codeobj__2681; +static PyObject *__pyx_codeobj__2683; +static PyObject *__pyx_codeobj__2685; +static PyObject *__pyx_codeobj__2687; +static PyObject *__pyx_codeobj__2689; +static PyObject *__pyx_codeobj__2691; +static PyObject *__pyx_codeobj__2693; +static PyObject *__pyx_codeobj__2695; +static PyObject *__pyx_codeobj__2697; +static PyObject *__pyx_codeobj__2699; +static PyObject *__pyx_codeobj__2701; +static PyObject *__pyx_codeobj__2703; +static PyObject *__pyx_codeobj__2705; +static PyObject *__pyx_codeobj__2707; +static PyObject *__pyx_codeobj__2709; +static PyObject *__pyx_codeobj__2711; +static PyObject *__pyx_codeobj__2713; +static PyObject *__pyx_codeobj__2715; +static PyObject *__pyx_codeobj__2717; +static PyObject *__pyx_codeobj__2719; +static PyObject *__pyx_codeobj__2721; +static PyObject *__pyx_codeobj__2723; +static PyObject *__pyx_codeobj__2725; +static PyObject *__pyx_codeobj__2727; +static PyObject *__pyx_codeobj__2729; +static PyObject *__pyx_codeobj__2731; +static PyObject *__pyx_codeobj__2733; +static PyObject *__pyx_codeobj__2735; +static PyObject *__pyx_codeobj__2737; +static PyObject *__pyx_codeobj__2739; +static PyObject *__pyx_codeobj__2741; +static PyObject *__pyx_codeobj__2743; +static PyObject *__pyx_codeobj__2745; +static PyObject *__pyx_codeobj__2747; +static PyObject *__pyx_codeobj__2749; +static PyObject *__pyx_codeobj__2751; +static PyObject *__pyx_codeobj__2753; +static PyObject *__pyx_codeobj__2755; +static PyObject *__pyx_codeobj__2757; +static PyObject *__pyx_codeobj__2759; +static PyObject *__pyx_codeobj__2761; +static PyObject *__pyx_codeobj__2763; +static PyObject *__pyx_codeobj__2765; +static PyObject *__pyx_codeobj__2767; +static PyObject *__pyx_codeobj__2769; +static PyObject *__pyx_codeobj__2771; +static PyObject *__pyx_codeobj__2773; +static PyObject *__pyx_codeobj__2775; +static PyObject *__pyx_codeobj__2777; +static PyObject *__pyx_codeobj__2779; +static PyObject *__pyx_codeobj__2781; +static PyObject *__pyx_codeobj__2783; +static PyObject *__pyx_codeobj__2785; +static PyObject *__pyx_codeobj__2787; +static PyObject *__pyx_codeobj__2789; +static PyObject *__pyx_codeobj__2791; +static PyObject *__pyx_codeobj__2793; +static PyObject *__pyx_codeobj__2795; +static PyObject *__pyx_codeobj__2797; +static PyObject *__pyx_codeobj__2799; +static PyObject *__pyx_codeobj__2801; +static PyObject *__pyx_codeobj__2803; +static PyObject *__pyx_codeobj__2805; +static PyObject *__pyx_codeobj__2807; +static PyObject *__pyx_codeobj__2809; +static PyObject *__pyx_codeobj__2811; +static PyObject *__pyx_codeobj__2813; +static PyObject *__pyx_codeobj__2815; +static PyObject *__pyx_codeobj__2817; +static PyObject *__pyx_codeobj__2819; +static PyObject *__pyx_codeobj__2821; +static PyObject *__pyx_codeobj__2823; +static PyObject *__pyx_codeobj__2825; +static PyObject *__pyx_codeobj__2827; +static PyObject *__pyx_codeobj__2829; +static PyObject *__pyx_codeobj__2831; +static PyObject *__pyx_codeobj__2833; +static PyObject *__pyx_codeobj__2835; +static PyObject *__pyx_codeobj__2837; +static PyObject *__pyx_codeobj__2839; +static PyObject *__pyx_codeobj__2841; +static PyObject *__pyx_codeobj__2843; +static PyObject *__pyx_codeobj__2845; +static PyObject *__pyx_codeobj__2847; +static PyObject *__pyx_codeobj__2849; +static PyObject *__pyx_codeobj__2851; +static PyObject *__pyx_codeobj__2853; +static PyObject *__pyx_codeobj__2855; +static PyObject *__pyx_codeobj__2857; +static PyObject *__pyx_codeobj__2859; +static PyObject *__pyx_codeobj__2861; +static PyObject *__pyx_codeobj__2863; +static PyObject *__pyx_codeobj__2865; +static PyObject *__pyx_codeobj__2867; +static PyObject *__pyx_codeobj__2869; +static PyObject *__pyx_codeobj__2871; +static PyObject *__pyx_codeobj__2873; +static PyObject *__pyx_codeobj__2875; +static PyObject *__pyx_codeobj__2877; +static PyObject *__pyx_codeobj__2879; +static PyObject *__pyx_codeobj__2881; +static PyObject *__pyx_codeobj__2883; +static PyObject *__pyx_codeobj__2885; +static PyObject *__pyx_codeobj__2887; +static PyObject *__pyx_codeobj__2889; +static PyObject *__pyx_codeobj__2891; +static PyObject *__pyx_codeobj__2893; +static PyObject *__pyx_codeobj__2895; +static PyObject *__pyx_codeobj__2897; +static PyObject *__pyx_codeobj__2899; +static PyObject *__pyx_codeobj__2901; +static PyObject *__pyx_codeobj__2903; +static PyObject *__pyx_codeobj__2905; +static PyObject *__pyx_codeobj__2907; +static PyObject *__pyx_codeobj__2909; +static PyObject *__pyx_codeobj__2911; +static PyObject *__pyx_codeobj__2913; +static PyObject *__pyx_codeobj__2915; +static PyObject *__pyx_codeobj__2917; +static PyObject *__pyx_codeobj__2919; +static PyObject *__pyx_codeobj__2921; +static PyObject *__pyx_codeobj__2923; +static PyObject *__pyx_codeobj__2925; +static PyObject *__pyx_codeobj__2927; +static PyObject *__pyx_codeobj__2929; +static PyObject *__pyx_codeobj__2931; +static PyObject *__pyx_codeobj__2933; +static PyObject *__pyx_codeobj__2935; +static PyObject *__pyx_codeobj__2937; +static PyObject *__pyx_codeobj__2939; +static PyObject *__pyx_codeobj__2941; +static PyObject *__pyx_codeobj__2943; +static PyObject *__pyx_codeobj__2945; +static PyObject *__pyx_codeobj__2947; +static PyObject *__pyx_codeobj__2949; +static PyObject *__pyx_codeobj__2951; +static PyObject *__pyx_codeobj__2953; +static PyObject *__pyx_codeobj__2955; +static PyObject *__pyx_codeobj__2957; +static PyObject *__pyx_codeobj__2959; +static PyObject *__pyx_codeobj__2961; +static PyObject *__pyx_codeobj__2963; +static PyObject *__pyx_codeobj__2965; +static PyObject *__pyx_codeobj__2967; +static PyObject *__pyx_codeobj__2969; +static PyObject *__pyx_codeobj__2971; +static PyObject *__pyx_codeobj__2973; +static PyObject *__pyx_codeobj__2975; +static PyObject *__pyx_codeobj__2977; +static PyObject *__pyx_codeobj__2979; +static PyObject *__pyx_codeobj__2981; +static PyObject *__pyx_codeobj__2983; +static PyObject *__pyx_codeobj__2985; +static PyObject *__pyx_codeobj__2987; + +/* "talib/_common.pxi":6 + * __ta_version__ = lib.TA_GetVersionString() + * + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): # <<<<<<<<<<<<<< + * if ret_code == lib.TA_SUCCESS: + * return True + */ + +static PyObject *__pyx_pw_5talib_7_ta_lib_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_5talib_7_ta_lib__ta_check_success(PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_ta_errors = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ta_check_success", 0); + + /* "talib/_common.pxi":7 + * + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): + * if ret_code == lib.TA_SUCCESS: # <<<<<<<<<<<<<< + * return True + * ta_errors = { + */ + __pyx_t_1 = ((__pyx_v_ret_code == TA_SUCCESS) != 0); + if (__pyx_t_1) { + + /* "talib/_common.pxi":8 + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): + * if ret_code == lib.TA_SUCCESS: + * return True # <<<<<<<<<<<<<< + * ta_errors = { + * 0: 'Success', + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "talib/_common.pxi":7 + * + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): + * if ret_code == lib.TA_SUCCESS: # <<<<<<<<<<<<<< + * return True + * ta_errors = { + */ + } + + /* "talib/_common.pxi":10 + * return True + * ta_errors = { + * 0: 'Success', # <<<<<<<<<<<<<< + * 1: 'Library Not Initialized (TA_LIB_NOT_INITIALIZE)', + * 2: 'Bad Parameter (TA_BAD_PARAM)', + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_int_0, __pyx_n_s_Success) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_kp_s_Library_Not_Initialized_TA_LIB_N) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_kp_s_Bad_Parameter_TA_BAD_PARAM) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_kp_s_Allocation_Error_TA_ALLOC_ERR) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_5, __pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_6, __pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_7, __pyx_kp_s_Invalid_Parameter_Holder_TA_INVA) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_kp_s_Invalid_Parameter_Holder_Type_TA) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_9, __pyx_kp_s_Invalid_Parameter_Function_TA_IN) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_10, __pyx_kp_s_Input_Not_All_Initialized_TA_INP) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_11, __pyx_kp_s_Output_Not_All_Initialized_TA_OU) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_12, __pyx_kp_s_Out_of_Range_Start_Index_TA_OUT) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_13, __pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_14, __pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15, __pyx_kp_s_Bad_Object_TA_BAD_OBJECT) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_5000, __pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_int_65535, __pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_v_ta_errors = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_common.pxi":31 + * } + * raise Exception('%s function failed with error code %s: %s' % ( + * function_name, ret_code, ta_errors[ret_code])) # <<<<<<<<<<<<<< + * + * def _ta_initialize(): + */ + __pyx_t_2 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_ret_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_ret_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_ta_errors, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_function_name); + __Pyx_GIVEREF(__pyx_v_function_name); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function_name); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + + /* "talib/_common.pxi":30 + * 65535: 'Unknown Error (TA_UNKNOWN_ERR)', + * } + * raise Exception('%s function failed with error code %s: %s' % ( # <<<<<<<<<<<<<< + * function_name, ret_code, ta_errors[ret_code])) + * + */ + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_function_failed_with_error_co, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 30, __pyx_L1_error) + + /* "talib/_common.pxi":6 + * __ta_version__ = lib.TA_GetVersionString() + * + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): # <<<<<<<<<<<<<< + * if ret_code == lib.TA_SUCCESS: + * return True + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ta_errors); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_5talib_7_ta_lib_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_function_name = 0; + TA_RetCode __pyx_v_ret_code; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_check_success (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_ret_code,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ret_code)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_ta_check_success", 1, 2, 2, 1); __PYX_ERR(0, 6, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_check_success") < 0)) __PYX_ERR(0, 6, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function_name = ((PyObject*)values[0]); + __pyx_v_ret_code = __Pyx_PyInt_As_TA_RetCode(values[1]); if (unlikely((__pyx_v_ret_code == (TA_RetCode)-1) && PyErr_Occurred())) __PYX_ERR(0, 6, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ta_check_success", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_function_name), (&PyString_Type), 1, "function_name", 1))) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib__ta_check_success(__pyx_self, __pyx_v_function_name, __pyx_v_ret_code); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib__ta_check_success(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_ta_check_success", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_v_function_name, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("talib._ta_lib._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":33 + * function_name, ret_code, ta_errors[ret_code])) + * + * def _ta_initialize(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_3_ta_initialize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_3_ta_initialize = {"_ta_initialize", (PyCFunction)__pyx_pw_5talib_7_ta_lib_3_ta_initialize, METH_NOARGS, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_3_ta_initialize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_initialize (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_2_ta_initialize(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_2_ta_initialize(CYTHON_UNUSED PyObject *__pyx_self) { + TA_RetCode __pyx_v_ret_code; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_ta_initialize", 0); + + /* "talib/_common.pxi":35 + * def _ta_initialize(): + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() # <<<<<<<<<<<<<< + * _ta_check_success('TA_Initialize', ret_code) + * + */ + __pyx_v_ret_code = TA_Initialize(); + + /* "talib/_common.pxi":36 + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() + * _ta_check_success('TA_Initialize', ret_code) # <<<<<<<<<<<<<< + * + * def _ta_shutdown(): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_Initialize, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":33 + * function_name, ret_code, ta_errors[ret_code])) + * + * def _ta_initialize(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("talib._ta_lib._ta_initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":38 + * _ta_check_success('TA_Initialize', ret_code) + * + * def _ta_shutdown(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_5_ta_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_5_ta_shutdown = {"_ta_shutdown", (PyCFunction)__pyx_pw_5talib_7_ta_lib_5_ta_shutdown, METH_NOARGS, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_5_ta_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_shutdown (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_4_ta_shutdown(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_4_ta_shutdown(CYTHON_UNUSED PyObject *__pyx_self) { + TA_RetCode __pyx_v_ret_code; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_ta_shutdown", 0); + + /* "talib/_common.pxi":40 + * def _ta_shutdown(): + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() # <<<<<<<<<<<<<< + * _ta_check_success('TA_Shutdown', ret_code) + * + */ + __pyx_v_ret_code = TA_Shutdown(); + + /* "talib/_common.pxi":41 + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() + * _ta_check_success('TA_Shutdown', ret_code) # <<<<<<<<<<<<<< + * + * class MA_Type(object): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_Shutdown, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":38 + * _ta_check_success('TA_Initialize', ret_code) + * + * def _ta_shutdown(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("talib._ta_lib._ta_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":46 + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + * def __init__(self): # <<<<<<<<<<<<<< + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_7MA_Type_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_7MA_Type_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_7MA_Type_1__init__, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_7MA_Type_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_7MA_Type___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_7MA_Type___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "talib/_common.pxi":48 + * def __init__(self): + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', # <<<<<<<<<<<<<< + * MA_Type.EMA: 'Exponential Moving Average', + * MA_Type.WMA: 'Weighted Moving Average', + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SMA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Simple_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_common.pxi":49 + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', + * MA_Type.EMA: 'Exponential Moving Average', # <<<<<<<<<<<<<< + * MA_Type.WMA: 'Weighted Moving Average', + * MA_Type.DEMA: 'Double Exponential Moving Average', + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_EMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Exponential_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":50 + * MA_Type.SMA: 'Simple Moving Average', + * MA_Type.EMA: 'Exponential Moving Average', + * MA_Type.WMA: 'Weighted Moving Average', # <<<<<<<<<<<<<< + * MA_Type.DEMA: 'Double Exponential Moving Average', + * MA_Type.TEMA: 'Triple Exponential Moving Average', + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_WMA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Weighted_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_common.pxi":51 + * MA_Type.EMA: 'Exponential Moving Average', + * MA_Type.WMA: 'Weighted Moving Average', + * MA_Type.DEMA: 'Double Exponential Moving Average', # <<<<<<<<<<<<<< + * MA_Type.TEMA: 'Triple Exponential Moving Average', + * MA_Type.TRIMA: 'Triangular Moving Average', + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DEMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Double_Exponential_Moving_Averag) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":52 + * MA_Type.WMA: 'Weighted Moving Average', + * MA_Type.DEMA: 'Double Exponential Moving Average', + * MA_Type.TEMA: 'Triple Exponential Moving Average', # <<<<<<<<<<<<<< + * MA_Type.TRIMA: 'Triangular Moving Average', + * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TEMA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Triple_Exponential_Moving_Averag) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_common.pxi":53 + * MA_Type.DEMA: 'Double Exponential Moving Average', + * MA_Type.TEMA: 'Triple Exponential Moving Average', + * MA_Type.TRIMA: 'Triangular Moving Average', # <<<<<<<<<<<<<< + * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', + * MA_Type.MAMA: 'MESA Adaptive Moving Average', + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TRIMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Triangular_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":54 + * MA_Type.TEMA: 'Triple Exponential Moving Average', + * MA_Type.TRIMA: 'Triangular Moving Average', + * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', # <<<<<<<<<<<<<< + * MA_Type.MAMA: 'MESA Adaptive Moving Average', + * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_KAMA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Kaufman_Adaptive_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_common.pxi":55 + * MA_Type.TRIMA: 'Triangular Moving Average', + * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', + * MA_Type.MAMA: 'MESA Adaptive Moving Average', # <<<<<<<<<<<<<< + * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', + * } + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MAMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_MESA_Adaptive_Moving_Average) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":56 + * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', + * MA_Type.MAMA: 'MESA Adaptive Moving Average', + * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_T3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Triple_Generalized_Double_Expone) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_common.pxi":47 + * + * def __init__(self): + * self._lookup = { # <<<<<<<<<<<<<< + * MA_Type.SMA: 'Simple Moving Average', + * MA_Type.EMA: 'Exponential Moving Average', + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lookup, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":46 + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + * def __init__(self): # <<<<<<<<<<<<<< + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.MA_Type.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":59 + * } + * + * def __getitem__(self, type_): # <<<<<<<<<<<<<< + * return self._lookup[type_] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_7MA_Type_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_7MA_Type_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_7MA_Type_3__getitem__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_7MA_Type_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_type_ = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 59, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_type_ = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MA_Type.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_7MA_Type_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_type_); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_7MA_Type_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "talib/_common.pxi":60 + * + * def __getitem__(self, type_): + * return self._lookup[type_] # <<<<<<<<<<<<<< + * + * MA_Type = MA_Type() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_type_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_common.pxi":59 + * } + * + * def __getitem__(self, type_): # <<<<<<<<<<<<<< + * return self._lookup[type_] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MA_Type.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":73 + * _ta_func_unst_ids[name] = i + * + * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_7_ta_set_unstable_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_7_ta_set_unstable_period = {"_ta_set_unstable_period", (PyCFunction)__pyx_pw_5talib_7_ta_lib_7_ta_set_unstable_period, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_7_ta_set_unstable_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_period = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_set_unstable_period (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_period,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_ta_set_unstable_period", 1, 2, 2, 1); __PYX_ERR(0, 73, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_set_unstable_period") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_name = values[0]; + __pyx_v_period = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ta_set_unstable_period", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_set_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_6_ta_set_unstable_period(__pyx_self, __pyx_v_name, __pyx_v_period); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_6_ta_set_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_period) { + TA_RetCode __pyx_v_ret_code; + TA_FuncUnstId __pyx_v_id; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + TA_FuncUnstId __pyx_t_3; + unsigned int __pyx_t_4; + __Pyx_RefNannySetupContext("_ta_set_unstable_period", 0); + + /* "talib/_common.pxi":75 + * def _ta_set_unstable_period(name, period): + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] # <<<<<<<<<<<<<< + * ret_code = lib.TA_SetUnstablePeriod(id, period) + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_TA_FuncUnstId(__pyx_t_2); if (unlikely((__pyx_t_3 == (TA_FuncUnstId)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_id = __pyx_t_3; + + /* "talib/_common.pxi":76 + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + * ret_code = lib.TA_SetUnstablePeriod(id, period) # <<<<<<<<<<<<<< + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + * + */ + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_period); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_v_ret_code = TA_SetUnstablePeriod(__pyx_v_id, __pyx_t_4); + + /* "talib/_common.pxi":77 + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + * ret_code = lib.TA_SetUnstablePeriod(id, period) + * _ta_check_success('TA_SetUnstablePeriod', ret_code) # <<<<<<<<<<<<<< + * + * def _ta_get_unstable_period(name): + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SetUnstablePeriod, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":73 + * _ta_func_unst_ids[name] = i + * + * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib._ta_set_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_common.pxi":79 + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + * + * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_9_ta_get_unstable_period(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_9_ta_get_unstable_period = {"_ta_get_unstable_period", (PyCFunction)__pyx_pw_5talib_7_ta_lib_9_ta_get_unstable_period, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_9_ta_get_unstable_period(PyObject *__pyx_self, PyObject *__pyx_v_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_get_unstable_period (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8_ta_get_unstable_period(__pyx_self, ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8_ta_get_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { + unsigned int __pyx_v_period; + TA_FuncUnstId __pyx_v_id; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + TA_FuncUnstId __pyx_t_3; + __Pyx_RefNannySetupContext("_ta_get_unstable_period", 0); + + /* "talib/_common.pxi":81 + * def _ta_get_unstable_period(name): + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] # <<<<<<<<<<<<<< + * period = lib.TA_GetUnstablePeriod(id) + * return period + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_TA_FuncUnstId(__pyx_t_2); if (unlikely((__pyx_t_3 == (TA_FuncUnstId)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_id = __pyx_t_3; + + /* "talib/_common.pxi":82 + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + * period = lib.TA_GetUnstablePeriod(id) # <<<<<<<<<<<<<< + * return period + */ + __pyx_v_period = TA_GetUnstablePeriod(__pyx_v_id); + + /* "talib/_common.pxi":83 + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + * period = lib.TA_GetUnstablePeriod(id) + * return period # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_period); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_common.pxi":79 + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + * + * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib._ta_get_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":24 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_11ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_10ACOS[] = " ACOS(real)\n\n Vector Trigonometric ACos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_11ACOS = {"ACOS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_11ACOS, METH_O, __pyx_doc_5talib_7_ta_lib_10ACOS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_11ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ACOS (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 24, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_10ACOS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_10ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ACOS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":44 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":45 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 45, __pyx_L1_error) + + /* "talib/_func.pxi":44 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":46 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":47 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 47, __pyx_L1_error) + + /* "talib/_func.pxi":46 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":48 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":49 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 49, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":48 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":50 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":51 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":52 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":53 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":54 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":55 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":56 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":55 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":57 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":58 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":60 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ACOS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 60, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":61 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ACOS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":62 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ACOS_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ACOS_Lookback()); + + /* "talib/_func.pxi":63 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ACOS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 63, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":64 + * lookback = begidx + lib.TA_ACOS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":65 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":66 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ACOS", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":67 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ACOS", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ACOS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":68 + * outreal_data[i] = NaN + * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ACOS", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ACOS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":69 + * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ACOS", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":24 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ACOS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":73 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_13AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_12AD[] = " AD(high, low, close, volume)\n\n Chaikin A/D Line (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_13AD = {"AD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_13AD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_12AD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_13AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("AD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 1); __PYX_ERR(2, 73, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 2); __PYX_ERR(2, 73, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 3); __PYX_ERR(2, 73, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AD") < 0)) __PYX_ERR(2, 73, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 73, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(2, 73, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_12AD(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_12AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("AD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_func.pxi":96 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":97 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 97, __pyx_L1_error) + + /* "talib/_func.pxi":96 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":98 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":99 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 99, __pyx_L1_error) + + /* "talib/_func.pxi":98 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":100 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":101 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 101, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":100 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":102 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":103 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":104 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 104, __pyx_L1_error) + + /* "talib/_func.pxi":103 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":105 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":106 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 106, __pyx_L1_error) + + /* "talib/_func.pxi":105 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":107 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":108 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 108, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":107 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":109 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":110 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":111 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 111, __pyx_L1_error) + + /* "talib/_func.pxi":110 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":112 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":113 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 113, __pyx_L1_error) + + /* "talib/_func.pxi":112 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":114 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":115 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 115, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":114 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":116 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":117 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":118 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 118, __pyx_L1_error) + + /* "talib/_func.pxi":117 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_func.pxi":119 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":120 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 120, __pyx_L1_error) + + /* "talib/_func.pxi":119 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":121 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":122 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 122, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":121 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_func.pxi":123 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_func.pxi":124 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":125 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":126 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 126, __pyx_L1_error) + + /* "talib/_func.pxi":125 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":127 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":128 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 128, __pyx_L1_error) + + /* "talib/_func.pxi":127 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_func.pxi":129 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":130 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 130, __pyx_L1_error) + + /* "talib/_func.pxi":129 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":131 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":132 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":133 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":134 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":135 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":134 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":136 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":137 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":138 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":137 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":139 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":140 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":141 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = volume_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":140 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + } + + /* "talib/_func.pxi":142 + * if val != val: + * continue + * val = volume_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); + + /* "talib/_func.pxi":143 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":144 + * val = volume_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":143 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":145 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":146 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":148 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AD_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 148, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":149 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_AD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":150 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AD_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_AD_Lookback()); + + /* "talib/_func.pxi":151 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":152 + * lookback = begidx + lib.TA_AD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":153 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":154 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AD", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":155 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AD(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":156 + * outreal_data[i] = NaN + * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":157 + * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":73 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":161 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_15ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_14ADD[] = " ADD(real0, real1)\n\n Vector Arithmetic Add (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_15ADD = {"ADD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_15ADD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_14ADD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_15ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ADD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, 1); __PYX_ERR(2, 161, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADD") < 0)) __PYX_ERR(2, 161, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 161, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 161, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 161, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_14ADD(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_14ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ADD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":183 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":184 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 184, __pyx_L1_error) + + /* "talib/_func.pxi":183 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":185 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":186 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 186, __pyx_L1_error) + + /* "talib/_func.pxi":185 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":187 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":188 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 188, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":187 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":189 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":190 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":191 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 191, __pyx_L1_error) + + /* "talib/_func.pxi":190 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":192 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":193 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 193, __pyx_L1_error) + + /* "talib/_func.pxi":192 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":194 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":195 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 195, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":194 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":196 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":197 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":198 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":199 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 199, __pyx_L1_error) + + /* "talib/_func.pxi":198 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":200 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":201 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":202 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":203 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":204 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":203 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":205 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":206 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":207 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":206 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":208 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":209 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":211 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADD_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 211, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":212 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ADD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":213 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADD_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ADD_Lookback()); + + /* "talib/_func.pxi":214 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 214, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":215 + * lookback = begidx + lib.TA_ADD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":216 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":217 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADD", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":218 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADD(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":219 + * outreal_data[i] = NaN + * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":220 + * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":161 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":224 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_17ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_16ADOSC[] = " ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?])\n\n Chaikin A/D Oscillator (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n fastperiod: 3\n slowperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_17ADOSC = {"ADOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_17ADOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_16ADOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_17ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ADOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 1); __PYX_ERR(2, 224, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 2); __PYX_ERR(2, 224, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 3); __PYX_ERR(2, 224, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADOSC") < 0)) __PYX_ERR(2, 224, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 224, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 224, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 224, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 224, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 224, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 224, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(2, 224, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_16ADOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_fastperiod, __pyx_v_slowperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_16ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ADOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_func.pxi":250 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":251 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 251, __pyx_L1_error) + + /* "talib/_func.pxi":250 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":252 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":253 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 253, __pyx_L1_error) + + /* "talib/_func.pxi":252 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":254 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":255 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 255, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":254 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":256 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":257 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":258 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 258, __pyx_L1_error) + + /* "talib/_func.pxi":257 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":259 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":260 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 260, __pyx_L1_error) + + /* "talib/_func.pxi":259 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":261 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":262 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 262, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":261 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":263 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":264 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":265 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 265, __pyx_L1_error) + + /* "talib/_func.pxi":264 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":266 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":267 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 267, __pyx_L1_error) + + /* "talib/_func.pxi":266 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":268 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":269 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 269, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":268 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":270 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":271 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":272 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 272, __pyx_L1_error) + + /* "talib/_func.pxi":271 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_func.pxi":273 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":274 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 274, __pyx_L1_error) + + /* "talib/_func.pxi":273 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":275 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":276 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 276, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":275 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_func.pxi":277 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_func.pxi":278 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":279 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":280 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 280, __pyx_L1_error) + + /* "talib/_func.pxi":279 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":281 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":282 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 282, __pyx_L1_error) + + /* "talib/_func.pxi":281 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_func.pxi":283 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":284 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 284, __pyx_L1_error) + + /* "talib/_func.pxi":283 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":285 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":286 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":287 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":288 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":289 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":288 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":290 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":291 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":292 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":291 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":293 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":294 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":295 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = volume_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":294 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + } + + /* "talib/_func.pxi":296 + * if val != val: + * continue + * val = volume_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); + + /* "talib/_func.pxi":297 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":298 + * val = volume_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":297 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":299 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":300 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":302 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 302, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":303 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":304 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ADOSC_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod)); + + /* "talib/_func.pxi":305 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 305, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":306 + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":307 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":308 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADOSC", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":309 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":310 + * outreal_data[i] = NaN + * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":311 + * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":224 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":315 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_19ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_18ADX[] = " ADX(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_19ADX = {"ADX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_19ADX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_18ADX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_19ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ADX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 1); __PYX_ERR(2, 315, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 2); __PYX_ERR(2, 315, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADX") < 0)) __PYX_ERR(2, 315, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 315, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 315, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 315, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 315, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 315, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_18ADX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_18ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ADX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":339 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":340 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 340, __pyx_L1_error) + + /* "talib/_func.pxi":339 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":341 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":342 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 342, __pyx_L1_error) + + /* "talib/_func.pxi":341 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":343 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":344 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 344, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":343 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":345 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":346 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":347 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 347, __pyx_L1_error) + + /* "talib/_func.pxi":346 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":348 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":349 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 349, __pyx_L1_error) + + /* "talib/_func.pxi":348 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":350 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":351 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 351, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":350 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":352 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":353 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":354 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 354, __pyx_L1_error) + + /* "talib/_func.pxi":353 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":355 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":356 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 356, __pyx_L1_error) + + /* "talib/_func.pxi":355 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":357 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":358 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 358, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":357 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":359 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":360 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":361 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":362 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 362, __pyx_L1_error) + + /* "talib/_func.pxi":361 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":363 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":364 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 364, __pyx_L1_error) + + /* "talib/_func.pxi":363 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":365 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":366 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":367 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":368 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":369 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":368 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":370 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":371 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":372 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":371 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":373 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":374 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":375 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":374 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":376 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":377 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":379 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 379, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":380 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":381 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ADX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":382 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 382, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":383 + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":384 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":385 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADX", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":386 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADX(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":387 + * outreal_data[i] = NaN + * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":388 + * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":315 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":392 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_21ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_20ADXR[] = " ADXR(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index Rating (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_21ADXR = {"ADXR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_21ADXR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_20ADXR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_21ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ADXR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 1); __PYX_ERR(2, 392, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 2); __PYX_ERR(2, 392, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADXR") < 0)) __PYX_ERR(2, 392, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 392, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 392, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 392, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 392, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 392, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_20ADXR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_20ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ADXR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":416 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":417 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 417, __pyx_L1_error) + + /* "talib/_func.pxi":416 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":418 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":419 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 419, __pyx_L1_error) + + /* "talib/_func.pxi":418 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":420 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":421 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 421, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":420 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":422 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":423 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":424 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 424, __pyx_L1_error) + + /* "talib/_func.pxi":423 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":425 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":426 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 426, __pyx_L1_error) + + /* "talib/_func.pxi":425 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":427 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":428 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 428, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":427 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":429 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":430 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":431 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 431, __pyx_L1_error) + + /* "talib/_func.pxi":430 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":432 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":433 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 433, __pyx_L1_error) + + /* "talib/_func.pxi":432 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":434 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":435 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 435, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":434 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":436 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":437 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":438 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":439 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 439, __pyx_L1_error) + + /* "talib/_func.pxi":438 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":440 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":441 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 441, __pyx_L1_error) + + /* "talib/_func.pxi":440 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":442 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":443 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":444 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":445 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":446 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":445 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":447 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":448 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":449 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":448 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":450 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":451 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":452 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":451 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":453 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":454 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":456 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 456, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":457 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":458 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ADXR_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":459 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 459, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":460 + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":461 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":462 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADXR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":463 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADXR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADXR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":464 + * outreal_data[i] = NaN + * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADXR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADXR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":465 + * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ADXR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":392 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":469 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_23APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_22APO[] = " APO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Absolute Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_23APO = {"APO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_23APO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_22APO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_23APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("APO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "APO") < 0)) __PYX_ERR(2, 469, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 469, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 469, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 469, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("APO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 469, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 469, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_22APO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_22APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("APO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":493 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":494 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 494, __pyx_L1_error) + + /* "talib/_func.pxi":493 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":495 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":496 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 496, __pyx_L1_error) + + /* "talib/_func.pxi":495 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":497 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":498 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 498, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":497 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":499 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":500 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":501 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":502 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":503 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":504 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":505 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":504 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":506 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":507 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":509 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 509, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":510 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":511 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_APO_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype)); + + /* "talib/_func.pxi":512 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":513 + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":514 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":515 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_APO", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":516 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_APO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_APO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":517 + * outreal_data[i] = NaN + * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_APO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_APO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":518 + * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_APO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":469 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_25AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_24AROON[] = " AROON(high, low[, timeperiod=?])\n\n Aroon (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n aroondown\n aroonup\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_25AROON = {"AROON", (PyCFunction)__pyx_pw_5talib_7_ta_lib_25AROON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_24AROON}; +static PyObject *__pyx_pw_5talib_7_ta_lib_25AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("AROON (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, 1); __PYX_ERR(2, 522, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROON") < 0)) __PYX_ERR(2, 522, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 522, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 522, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 522, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 522, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_24AROON(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_24AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outaroondown = 0; + double *__pyx_v_outaroondown_data; + PyArrayObject *__pyx_v_outaroonup = 0; + double *__pyx_v_outaroonup_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("AROON", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":548 + * np.ndarray outaroonup + * double* outaroonup_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":549 + * double* outaroonup_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 549, __pyx_L1_error) + + /* "talib/_func.pxi":548 + * np.ndarray outaroonup + * double* outaroonup_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":550 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":551 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 551, __pyx_L1_error) + + /* "talib/_func.pxi":550 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":552 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":553 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 553, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":552 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":554 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":555 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":556 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) + + /* "talib/_func.pxi":555 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":557 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":558 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 558, __pyx_L1_error) + + /* "talib/_func.pxi":557 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":559 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":560 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 560, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":559 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":561 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":562 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":563 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":564 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 564, __pyx_L1_error) + + /* "talib/_func.pxi":563 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":565 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":566 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":567 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":568 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":569 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":568 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":570 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":571 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":572 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":571 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":573 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":574 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":576 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 576, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":577 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) + * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":578 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroondown_data = outaroondown.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_AROON_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":579 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) + * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outaroondown_data = outaroondown.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_v_outaroondown = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":580 + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) + * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroondown_data = outaroondown.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outaroondown_data[i] = NaN + */ + __pyx_v_outaroondown_data = ((double *)__pyx_v_outaroondown->data); + + /* "talib/_func.pxi":581 + * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroondown_data = outaroondown.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outaroondown_data[i] = NaN + * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":582 + * outaroondown_data = outaroondown.data + * for i from 0 <= i < min(lookback, length): + * outaroondown_data[i] = NaN # <<<<<<<<<<<<<< + * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroonup_data = outaroonup.data + */ + (__pyx_v_outaroondown_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":583 + * for i from 0 <= i < min(lookback, length): + * outaroondown_data[i] = NaN + * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outaroonup_data = outaroonup.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 583, __pyx_L1_error) + __pyx_v_outaroonup = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":584 + * outaroondown_data[i] = NaN + * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroonup_data = outaroonup.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outaroonup_data[i] = NaN + */ + __pyx_v_outaroonup_data = ((double *)__pyx_v_outaroonup->data); + + /* "talib/_func.pxi":585 + * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outaroonup_data = outaroonup.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outaroonup_data[i] = NaN + * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":586 + * outaroonup_data = outaroonup.data + * for i from 0 <= i < min(lookback, length): + * outaroonup_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) + * _ta_check_success("TA_AROON", retCode) + */ + (__pyx_v_outaroonup_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":587 + * for i from 0 <= i < min(lookback, length): + * outaroonup_data[i] = NaN + * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AROON", retCode) + * return outaroondown , outaroonup + */ + __pyx_v_retCode = TA_AROON(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outaroondown_data + __pyx_v_lookback)), ((double *)(__pyx_v_outaroonup_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":588 + * outaroonup_data[i] = NaN + * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) + * _ta_check_success("TA_AROON", retCode) # <<<<<<<<<<<<<< + * return outaroondown , outaroonup + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AROON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":589 + * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) + * _ta_check_success("TA_AROON", retCode) + * return outaroondown , outaroonup # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outaroondown)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outaroondown)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outaroondown)); + __Pyx_INCREF(((PyObject *)__pyx_v_outaroonup)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outaroonup)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outaroonup)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outaroondown); + __Pyx_XDECREF((PyObject *)__pyx_v_outaroonup); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":593 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_27AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_26AROONOSC[] = " AROONOSC(high, low[, timeperiod=?])\n\n Aroon Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_27AROONOSC = {"AROONOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_27AROONOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_26AROONOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_27AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("AROONOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, 1); __PYX_ERR(2, 593, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROONOSC") < 0)) __PYX_ERR(2, 593, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 593, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 593, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 593, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 593, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_26AROONOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_26AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("AROONOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":616 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":617 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 617, __pyx_L1_error) + + /* "talib/_func.pxi":616 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":618 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":619 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 619, __pyx_L1_error) + + /* "talib/_func.pxi":618 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":620 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":621 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 621, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":620 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":622 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":623 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":624 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 624, __pyx_L1_error) + + /* "talib/_func.pxi":623 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":625 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":626 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 626, __pyx_L1_error) + + /* "talib/_func.pxi":625 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":627 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":628 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 628, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":627 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":629 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":630 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":631 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":632 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 632, __pyx_L1_error) + + /* "talib/_func.pxi":631 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":633 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":634 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":635 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":636 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":637 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":636 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":638 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":639 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":640 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":639 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":641 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":642 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":644 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 644, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":645 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":646 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_AROONOSC_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":647 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 647, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":648 + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":649 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":650 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AROONOSC", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":651 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AROONOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AROONOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":652 + * outreal_data[i] = NaN + * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AROONOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AROONOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":653 + * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AROONOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":593 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":657 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_29ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_28ASIN[] = " ASIN(real)\n\n Vector Trigonometric ASin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_29ASIN = {"ASIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_29ASIN, METH_O, __pyx_doc_5talib_7_ta_lib_28ASIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_29ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ASIN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 657, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_28ASIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_28ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ASIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":677 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":678 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 678, __pyx_L1_error) + + /* "talib/_func.pxi":677 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":679 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":680 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 680, __pyx_L1_error) + + /* "talib/_func.pxi":679 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":681 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":682 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":681 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":683 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":684 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":685 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":686 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":687 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":688 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":689 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":688 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":690 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":691 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":693 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ASIN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 693, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":694 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ASIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":695 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ASIN_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ASIN_Lookback()); + + /* "talib/_func.pxi":696 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ASIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":697 + * lookback = begidx + lib.TA_ASIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":698 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":699 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ASIN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":700 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ASIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ASIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":701 + * outreal_data[i] = NaN + * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ASIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ASIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":702 + * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ASIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":657 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ASIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":706 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_31ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_30ATAN[] = " ATAN(real)\n\n Vector Trigonometric ATan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_31ATAN = {"ATAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_31ATAN, METH_O, __pyx_doc_5talib_7_ta_lib_30ATAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_31ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ATAN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 706, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_30ATAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_30ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ATAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":726 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":727 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 727, __pyx_L1_error) + + /* "talib/_func.pxi":726 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":728 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":729 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 729, __pyx_L1_error) + + /* "talib/_func.pxi":728 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":730 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":731 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 731, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":730 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":732 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":733 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":734 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":735 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":736 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":737 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":738 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":737 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":739 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":740 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":742 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATAN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 742, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":743 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ATAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":744 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATAN_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ATAN_Lookback()); + + /* "talib/_func.pxi":745 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 745, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":746 + * lookback = begidx + lib.TA_ATAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":747 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":748 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATAN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":749 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ATAN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ATAN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":750 + * outreal_data[i] = NaN + * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATAN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ATAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":751 + * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATAN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":706 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ATAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":755 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_33ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_32ATR[] = " ATR(high, low, close[, timeperiod=?])\n\n Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_33ATR = {"ATR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_33ATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_32ATR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_33ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ATR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 1); __PYX_ERR(2, 755, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 2); __PYX_ERR(2, 755, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ATR") < 0)) __PYX_ERR(2, 755, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 755, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 755, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 755, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 755, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 755, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_32ATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_32ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ATR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":779 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":780 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 780, __pyx_L1_error) + + /* "talib/_func.pxi":779 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":781 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":782 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 782, __pyx_L1_error) + + /* "talib/_func.pxi":781 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":783 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":784 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 784, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":783 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":785 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":786 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":787 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 787, __pyx_L1_error) + + /* "talib/_func.pxi":786 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":788 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":789 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 789, __pyx_L1_error) + + /* "talib/_func.pxi":788 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":790 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":791 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 791, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":790 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":792 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":793 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":794 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 794, __pyx_L1_error) + + /* "talib/_func.pxi":793 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":795 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":796 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 796, __pyx_L1_error) + + /* "talib/_func.pxi":795 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":797 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":798 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":797 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":799 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":800 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":801 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":802 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 802, __pyx_L1_error) + + /* "talib/_func.pxi":801 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":803 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":804 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 804, __pyx_L1_error) + + /* "talib/_func.pxi":803 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":805 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":806 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":807 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":808 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":809 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":808 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":810 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":811 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":812 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":811 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":813 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":814 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":815 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":814 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":816 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":817 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":819 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 819, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":820 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":821 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ATR_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":822 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 822, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":823 + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":824 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":825 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":826 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ATR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ATR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":827 + * outreal_data[i] = NaN + * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":828 + * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ATR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":755 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":832 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_35AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_34AVGPRICE[] = " AVGPRICE(open, high, low, close)\n\n Average Price (Price Transform)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_35AVGPRICE = {"AVGPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_35AVGPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_34AVGPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_35AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("AVGPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 1); __PYX_ERR(2, 832, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 2); __PYX_ERR(2, 832, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 3); __PYX_ERR(2, 832, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AVGPRICE") < 0)) __PYX_ERR(2, 832, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 832, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 832, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 832, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 832, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_34AVGPRICE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_34AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("AVGPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":855 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":856 + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 856, __pyx_L1_error) + + /* "talib/_func.pxi":855 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":857 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":858 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 858, __pyx_L1_error) + + /* "talib/_func.pxi":857 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":859 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":860 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 860, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":859 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":861 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":862 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":863 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 863, __pyx_L1_error) + + /* "talib/_func.pxi":862 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":864 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":865 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 865, __pyx_L1_error) + + /* "talib/_func.pxi":864 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":866 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":867 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 867, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":866 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":868 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":869 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":870 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 870, __pyx_L1_error) + + /* "talib/_func.pxi":869 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":871 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":872 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 872, __pyx_L1_error) + + /* "talib/_func.pxi":871 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":873 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":874 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 874, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":873 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":875 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":876 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":877 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 877, __pyx_L1_error) + + /* "talib/_func.pxi":876 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":878 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":879 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 879, __pyx_L1_error) + + /* "talib/_func.pxi":878 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":880 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":881 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 881, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":880 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":882 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":883 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":884 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":885 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 885, __pyx_L1_error) + + /* "talib/_func.pxi":884 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":886 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":887 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 887, __pyx_L1_error) + + /* "talib/_func.pxi":886 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":888 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":889 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 889, __pyx_L1_error) + + /* "talib/_func.pxi":888 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":890 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":891 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":892 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":893 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":894 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":893 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":895 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":896 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":897 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":896 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":898 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":899 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":900 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":899 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":901 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":902 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":903 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":902 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":904 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":905 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":907 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 907, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":908 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":909 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_AVGPRICE_Lookback()); + + /* "talib/_func.pxi":910 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 910, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":911 + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":912 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":913 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AVGPRICE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":914 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AVGPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AVGPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":915 + * outreal_data[i] = NaN + * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AVGPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AVGPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":916 + * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_AVGPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":832 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":920 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_37BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_36BBANDS[] = " BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?])\n\n Bollinger Bands (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdevup: 2\n nbdevdn: 2\n matype: 0 (Simple Moving Average)\n Outputs:\n upperband\n middleband\n lowerband\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_37BBANDS = {"BBANDS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_37BBANDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_36BBANDS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_37BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdevup; + double __pyx_v_nbdevdn; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("BBANDS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdevup,&__pyx_n_s_nbdevdn,&__pyx_n_s_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevup); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevdn); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BBANDS") < 0)) __PYX_ERR(2, 920, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 920, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdevup = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdevup == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 920, __pyx_L3_error) + } else { + __pyx_v_nbdevup = ((double)-4e37); + } + if (values[3]) { + __pyx_v_nbdevdn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_nbdevdn == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 920, __pyx_L3_error) + } else { + __pyx_v_nbdevdn = ((double)-4e37); + } + if (values[4]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 920, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("BBANDS", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 920, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 920, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_36BBANDS(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_36BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outrealupperband = 0; + double *__pyx_v_outrealupperband_data; + PyArrayObject *__pyx_v_outrealmiddleband = 0; + double *__pyx_v_outrealmiddleband_data; + PyArrayObject *__pyx_v_outreallowerband = 0; + double *__pyx_v_outreallowerband_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("BBANDS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":951 + * np.ndarray outreallowerband + * double* outreallowerband_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":952 + * double* outreallowerband_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 952, __pyx_L1_error) + + /* "talib/_func.pxi":951 + * np.ndarray outreallowerband + * double* outreallowerband_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":953 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":954 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 954, __pyx_L1_error) + + /* "talib/_func.pxi":953 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":955 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":956 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 956, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":955 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":957 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":958 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":959 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":960 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":961 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":962 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":963 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":962 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":964 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":965 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":967 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 967, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":968 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) + * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":969 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) # <<<<<<<<<<<<<< + * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealupperband_data = outrealupperband.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_BBANDS_Lookback(__pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype)); + + /* "talib/_func.pxi":970 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) + * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outrealupperband_data = outrealupperband.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 970, __pyx_L1_error) + __pyx_v_outrealupperband = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":971 + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) + * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealupperband_data = outrealupperband.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outrealupperband_data[i] = NaN + */ + __pyx_v_outrealupperband_data = ((double *)__pyx_v_outrealupperband->data); + + /* "talib/_func.pxi":972 + * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealupperband_data = outrealupperband.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outrealupperband_data[i] = NaN + * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":973 + * outrealupperband_data = outrealupperband.data + * for i from 0 <= i < min(lookback, length): + * outrealupperband_data[i] = NaN # <<<<<<<<<<<<<< + * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealmiddleband_data = outrealmiddleband.data + */ + (__pyx_v_outrealupperband_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":974 + * for i from 0 <= i < min(lookback, length): + * outrealupperband_data[i] = NaN + * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outrealmiddleband_data = outrealmiddleband.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 974, __pyx_L1_error) + __pyx_v_outrealmiddleband = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":975 + * outrealupperband_data[i] = NaN + * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealmiddleband_data = outrealmiddleband.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outrealmiddleband_data[i] = NaN + */ + __pyx_v_outrealmiddleband_data = ((double *)__pyx_v_outrealmiddleband->data); + + /* "talib/_func.pxi":976 + * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outrealmiddleband_data = outrealmiddleband.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outrealmiddleband_data[i] = NaN + * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":977 + * outrealmiddleband_data = outrealmiddleband.data + * for i from 0 <= i < min(lookback, length): + * outrealmiddleband_data[i] = NaN # <<<<<<<<<<<<<< + * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreallowerband_data = outreallowerband.data + */ + (__pyx_v_outrealmiddleband_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":978 + * for i from 0 <= i < min(lookback, length): + * outrealmiddleband_data[i] = NaN + * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreallowerband_data = outreallowerband.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 978, __pyx_L1_error) + __pyx_v_outreallowerband = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":979 + * outrealmiddleband_data[i] = NaN + * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreallowerband_data = outreallowerband.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreallowerband_data[i] = NaN + */ + __pyx_v_outreallowerband_data = ((double *)__pyx_v_outreallowerband->data); + + /* "talib/_func.pxi":980 + * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreallowerband_data = outreallowerband.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreallowerband_data[i] = NaN + * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":981 + * outreallowerband_data = outreallowerband.data + * for i from 0 <= i < min(lookback, length): + * outreallowerband_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) + * _ta_check_success("TA_BBANDS", retCode) + */ + (__pyx_v_outreallowerband_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":982 + * for i from 0 <= i < min(lookback, length): + * outreallowerband_data[i] = NaN + * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BBANDS", retCode) + * return outrealupperband , outrealmiddleband , outreallowerband + */ + __pyx_v_retCode = TA_BBANDS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outrealupperband_data + __pyx_v_lookback)), ((double *)(__pyx_v_outrealmiddleband_data + __pyx_v_lookback)), ((double *)(__pyx_v_outreallowerband_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":983 + * outreallowerband_data[i] = NaN + * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) + * _ta_check_success("TA_BBANDS", retCode) # <<<<<<<<<<<<<< + * return outrealupperband , outrealmiddleband , outreallowerband + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BBANDS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":984 + * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) + * _ta_check_success("TA_BBANDS", retCode) + * return outrealupperband , outrealmiddleband , outreallowerband # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outrealupperband)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outrealupperband)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outrealupperband)); + __Pyx_INCREF(((PyObject *)__pyx_v_outrealmiddleband)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outrealmiddleband)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outrealmiddleband)); + __Pyx_INCREF(((PyObject *)__pyx_v_outreallowerband)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outreallowerband)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outreallowerband)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":920 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outrealupperband); + __Pyx_XDECREF((PyObject *)__pyx_v_outrealmiddleband); + __Pyx_XDECREF((PyObject *)__pyx_v_outreallowerband); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":988 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_39BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_38BETA[] = " BETA(real0, real1[, timeperiod=?])\n\n Beta (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 5\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_39BETA = {"BETA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_39BETA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_38BETA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_39BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("BETA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, 1); __PYX_ERR(2, 988, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BETA") < 0)) __PYX_ERR(2, 988, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 988, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 988, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 988, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 988, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_38BETA(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_38BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("BETA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":1012 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1013 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1013, __pyx_L1_error) + + /* "talib/_func.pxi":1012 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":1014 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1015 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1015, __pyx_L1_error) + + /* "talib/_func.pxi":1014 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1016 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1017 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1017, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1016 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":1018 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":1019 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1020 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1020, __pyx_L1_error) + + /* "talib/_func.pxi":1019 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":1021 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1022 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1022, __pyx_L1_error) + + /* "talib/_func.pxi":1021 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1023 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1024 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1024, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1023 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":1025 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":1026 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":1027 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1028 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1028, __pyx_L1_error) + + /* "talib/_func.pxi":1027 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1029 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1030 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1031 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":1032 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1033 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":1032 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":1034 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":1035 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1036 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":1035 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1037 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1038 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1040 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1040, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":1041 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1042 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_BETA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":1043 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1043, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1044 + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":1045 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1046 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BETA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":1047 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BETA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_BETA(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1048 + * outreal_data[i] = NaN + * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BETA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BETA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1049 + * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BETA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":988 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_41BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_40BOP[] = " BOP(open, high, low, close)\n\n Balance Of Power (Momentum Indicators)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_41BOP = {"BOP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_41BOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_40BOP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_41BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("BOP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 1); __PYX_ERR(2, 1053, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 2); __PYX_ERR(2, 1053, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 3); __PYX_ERR(2, 1053, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BOP") < 0)) __PYX_ERR(2, 1053, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1053, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1053, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_40BOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_40BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("BOP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1076 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1077 + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1077, __pyx_L1_error) + + /* "talib/_func.pxi":1076 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1078 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1079 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1079, __pyx_L1_error) + + /* "talib/_func.pxi":1078 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1080 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1081 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1081, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1080 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1082 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1083 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1084 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1084, __pyx_L1_error) + + /* "talib/_func.pxi":1083 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1085 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1086 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1086, __pyx_L1_error) + + /* "talib/_func.pxi":1085 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1087 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1088 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1088, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1087 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1089 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1090 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1091 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1091, __pyx_L1_error) + + /* "talib/_func.pxi":1090 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1092 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1093 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1093, __pyx_L1_error) + + /* "talib/_func.pxi":1092 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1094 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1095 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1095, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1094 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1096 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1097 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1098 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1098, __pyx_L1_error) + + /* "talib/_func.pxi":1097 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1099 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1100 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1100, __pyx_L1_error) + + /* "talib/_func.pxi":1099 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1101 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1102 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1102, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1101 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1103 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1104 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1105 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1106 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1106, __pyx_L1_error) + + /* "talib/_func.pxi":1105 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1107 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1108 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1108, __pyx_L1_error) + + /* "talib/_func.pxi":1107 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1109 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1110 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1110, __pyx_L1_error) + + /* "talib/_func.pxi":1109 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1111 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1112 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1113 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1114 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1115 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1114 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1116 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1117 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1118 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1117 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1119 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1120 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1121 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1120 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1122 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1123 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1124 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1123 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1125 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1126 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1128 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BOP_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1128, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1129 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_BOP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1130 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BOP_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_BOP_Lookback()); + + /* "talib/_func.pxi":1131 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BOP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1131, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1132 + * lookback = begidx + lib.TA_BOP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":1133 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1134 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BOP", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":1135 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BOP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_BOP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1136 + * outreal_data[i] = NaN + * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BOP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1137 + * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_BOP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":1053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_43CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_42CCI[] = " CCI(high, low, close[, timeperiod=?])\n\n Commodity Channel Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_43CCI = {"CCI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_43CCI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_42CCI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_43CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CCI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 1); __PYX_ERR(2, 1141, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 2); __PYX_ERR(2, 1141, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CCI") < 0)) __PYX_ERR(2, 1141, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1141, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1141, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1141, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_42CCI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_42CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CCI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1165 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1166 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1166, __pyx_L1_error) + + /* "talib/_func.pxi":1165 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1167 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1168 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1168, __pyx_L1_error) + + /* "talib/_func.pxi":1167 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1169 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1170 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1170, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1169 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1171 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1172 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1173 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1173, __pyx_L1_error) + + /* "talib/_func.pxi":1172 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1174 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1175 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1175, __pyx_L1_error) + + /* "talib/_func.pxi":1174 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1176 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1177 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1177, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1176 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1178 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1179 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1180 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1180, __pyx_L1_error) + + /* "talib/_func.pxi":1179 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1181 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1182 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1182, __pyx_L1_error) + + /* "talib/_func.pxi":1181 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1183 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1184 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1184, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1183 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1185 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1186 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":1187 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1188 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1188, __pyx_L1_error) + + /* "talib/_func.pxi":1187 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1189 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1190 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1190, __pyx_L1_error) + + /* "talib/_func.pxi":1189 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1191 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1192 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1193 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1194 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1195 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":1194 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1196 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1197 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1198 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":1197 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1199 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1200 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1201 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":1200 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1202 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1203 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1205 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1205, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":1206 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1207 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CCI_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":1208 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1208, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1209 + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":1210 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1211 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CCI", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":1212 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CCI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CCI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1213 + * outreal_data[i] = NaN + * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CCI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CCI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1214 + * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CCI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":1141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_45CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_44CDL2CROWS[] = " CDL2CROWS(open, high, low, close)\n\n Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_45CDL2CROWS = {"CDL2CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_45CDL2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_44CDL2CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_45CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL2CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 1); __PYX_ERR(2, 1218, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 2); __PYX_ERR(2, 1218, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 3); __PYX_ERR(2, 1218, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL2CROWS") < 0)) __PYX_ERR(2, 1218, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1218, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1218, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_44CDL2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_44CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL2CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1241 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1242 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "talib/_func.pxi":1241 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1243 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1244 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1244, __pyx_L1_error) + + /* "talib/_func.pxi":1243 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1245 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1246 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1246, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1245 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1247 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1248 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1249 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1249, __pyx_L1_error) + + /* "talib/_func.pxi":1248 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1251, __pyx_L1_error) + + /* "talib/_func.pxi":1250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1253 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1253, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1254 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1256, __pyx_L1_error) + + /* "talib/_func.pxi":1255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1258, __pyx_L1_error) + + /* "talib/_func.pxi":1257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1260 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1260, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1261 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1263, __pyx_L1_error) + + /* "talib/_func.pxi":1262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1265, __pyx_L1_error) + + /* "talib/_func.pxi":1264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1267 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1267, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1268 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1269 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1270 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1271 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1271, __pyx_L1_error) + + /* "talib/_func.pxi":1270 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1272 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1273 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1273, __pyx_L1_error) + + /* "talib/_func.pxi":1272 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1275, __pyx_L1_error) + + /* "talib/_func.pxi":1274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1276 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1277 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1278 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1279 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1280 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1279 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1281 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1282 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1283 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1282 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1284 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1285 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1286 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1285 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1287 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1288 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1289 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1288 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1290 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1291 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1293 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1293, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1294 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1295 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL2CROWS_Lookback()); + + /* "talib/_func.pxi":1296 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1296, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1297 + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1298 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1299 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL2CROWS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1300 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL2CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL2CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1301 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL2CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1302 + * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL2CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_47CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_46CDL3BLACKCROWS[] = " CDL3BLACKCROWS(open, high, low, close)\n\n Three Black Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_47CDL3BLACKCROWS = {"CDL3BLACKCROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_47CDL3BLACKCROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_46CDL3BLACKCROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_47CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3BLACKCROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 1); __PYX_ERR(2, 1306, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 2); __PYX_ERR(2, 1306, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 3); __PYX_ERR(2, 1306, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3BLACKCROWS") < 0)) __PYX_ERR(2, 1306, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1306, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1306, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_46CDL3BLACKCROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_46CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3BLACKCROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1329 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1330 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1330, __pyx_L1_error) + + /* "talib/_func.pxi":1329 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1331 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1332 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1332, __pyx_L1_error) + + /* "talib/_func.pxi":1331 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1333 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1334 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1334, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1333 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1335 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1336 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1337 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1337, __pyx_L1_error) + + /* "talib/_func.pxi":1336 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1338 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1339 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1339, __pyx_L1_error) + + /* "talib/_func.pxi":1338 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1340 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1341 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1341, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1340 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1342 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1343 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1344 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1344, __pyx_L1_error) + + /* "talib/_func.pxi":1343 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1345 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1346 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1346, __pyx_L1_error) + + /* "talib/_func.pxi":1345 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1347 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1348 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1348, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1347 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1349 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1350 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1351 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1351, __pyx_L1_error) + + /* "talib/_func.pxi":1350 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1352 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1353 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1353, __pyx_L1_error) + + /* "talib/_func.pxi":1352 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1354 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1355 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1355, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1354 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1356 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1357 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1358 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1359 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1359, __pyx_L1_error) + + /* "talib/_func.pxi":1358 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1360 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1361 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1361, __pyx_L1_error) + + /* "talib/_func.pxi":1360 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1362 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1363 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1363, __pyx_L1_error) + + /* "talib/_func.pxi":1362 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1364 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1365 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1366 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1367 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1368 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1367 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1369 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1370 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1371 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1370 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1372 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1373 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1374 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1373 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1375 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1376 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1377 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1376 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1378 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1379 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1381 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1381, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1382 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1383 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3BLACKCROWS_Lookback()); + + /* "talib/_func.pxi":1384 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1384, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1385 + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1386 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1387 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1388 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3BLACKCROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1389 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1390 + * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_49CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_48CDL3INSIDE[] = " CDL3INSIDE(open, high, low, close)\n\n Three Inside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_49CDL3INSIDE = {"CDL3INSIDE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_49CDL3INSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_48CDL3INSIDE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_49CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3INSIDE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 1); __PYX_ERR(2, 1394, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 2); __PYX_ERR(2, 1394, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 3); __PYX_ERR(2, 1394, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3INSIDE") < 0)) __PYX_ERR(2, 1394, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1394, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1394, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_48CDL3INSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_48CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3INSIDE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1417 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1418 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1418, __pyx_L1_error) + + /* "talib/_func.pxi":1417 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1419 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1420 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1420, __pyx_L1_error) + + /* "talib/_func.pxi":1419 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1421 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1422 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1422, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1421 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1423 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1424 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1425 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1425, __pyx_L1_error) + + /* "talib/_func.pxi":1424 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1426 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1427 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1427, __pyx_L1_error) + + /* "talib/_func.pxi":1426 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1428 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1429 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1429, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1428 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1430 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1431 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1432 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1432, __pyx_L1_error) + + /* "talib/_func.pxi":1431 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1433 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1434 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1434, __pyx_L1_error) + + /* "talib/_func.pxi":1433 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1435 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1436 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1436, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1435 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1437 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1438 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1439 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1439, __pyx_L1_error) + + /* "talib/_func.pxi":1438 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1440 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1441 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1441, __pyx_L1_error) + + /* "talib/_func.pxi":1440 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1442 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1443 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1443, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1442 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1444 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1445 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1446 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1447 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1447, __pyx_L1_error) + + /* "talib/_func.pxi":1446 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1448 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1449 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1449, __pyx_L1_error) + + /* "talib/_func.pxi":1448 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1450 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1451 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1451, __pyx_L1_error) + + /* "talib/_func.pxi":1450 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1452 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1453 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1454 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1455 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1456 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1455 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1457 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1458 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1459 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1458 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1460 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1461 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1462 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1461 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1463 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1464 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1465 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1464 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1466 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1467 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1469 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1469, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1470 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1471 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3INSIDE_Lookback()); + + /* "talib/_func.pxi":1472 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1472, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1473 + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1474 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1475 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3INSIDE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1476 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3INSIDE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3INSIDE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1477 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3INSIDE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3INSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1478 + * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3INSIDE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_51CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_50CDL3LINESTRIKE[] = " CDL3LINESTRIKE(open, high, low, close)\n\n Three-Line Strike (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_51CDL3LINESTRIKE = {"CDL3LINESTRIKE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_51CDL3LINESTRIKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_50CDL3LINESTRIKE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_51CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3LINESTRIKE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 1); __PYX_ERR(2, 1482, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 2); __PYX_ERR(2, 1482, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 3); __PYX_ERR(2, 1482, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3LINESTRIKE") < 0)) __PYX_ERR(2, 1482, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1482, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1482, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_50CDL3LINESTRIKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_50CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3LINESTRIKE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1505 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1506 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1506, __pyx_L1_error) + + /* "talib/_func.pxi":1505 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1507 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1508 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1508, __pyx_L1_error) + + /* "talib/_func.pxi":1507 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1509 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1510 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1510, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1509 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1511 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1512 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1513 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1513, __pyx_L1_error) + + /* "talib/_func.pxi":1512 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1514 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1515 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1515, __pyx_L1_error) + + /* "talib/_func.pxi":1514 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1516 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1517 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1517, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1516 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1518 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1519 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1520 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1520, __pyx_L1_error) + + /* "talib/_func.pxi":1519 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1521 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1522 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1522, __pyx_L1_error) + + /* "talib/_func.pxi":1521 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1523 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1524 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1524, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1523 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1525 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1526 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1527 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1527, __pyx_L1_error) + + /* "talib/_func.pxi":1526 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1528 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1529 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1529, __pyx_L1_error) + + /* "talib/_func.pxi":1528 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1530 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1531 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1531, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1530 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1532 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1533 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1534 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1535 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1535, __pyx_L1_error) + + /* "talib/_func.pxi":1534 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1536 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1537 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1537, __pyx_L1_error) + + /* "talib/_func.pxi":1536 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1538 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1539 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1539, __pyx_L1_error) + + /* "talib/_func.pxi":1538 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1540 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1541 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1542 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1543 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1544 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1543 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1545 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1546 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1547 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1546 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1548 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1549 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1550 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1549 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1551 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1552 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1553 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1552 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1554 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1555 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1557 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1557, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1558 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1559 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3LINESTRIKE_Lookback()); + + /* "talib/_func.pxi":1560 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1560, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1561 + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1562 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1563 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1564 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3LINESTRIKE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1565 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1566 + * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_53CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_52CDL3OUTSIDE[] = " CDL3OUTSIDE(open, high, low, close)\n\n Three Outside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_53CDL3OUTSIDE = {"CDL3OUTSIDE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_53CDL3OUTSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_52CDL3OUTSIDE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_53CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3OUTSIDE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 1); __PYX_ERR(2, 1570, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 2); __PYX_ERR(2, 1570, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 3); __PYX_ERR(2, 1570, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3OUTSIDE") < 0)) __PYX_ERR(2, 1570, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1570, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1570, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_52CDL3OUTSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_52CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3OUTSIDE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1593 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1594 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1594, __pyx_L1_error) + + /* "talib/_func.pxi":1593 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1596, __pyx_L1_error) + + /* "talib/_func.pxi":1595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1598 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1598, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1599 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1601, __pyx_L1_error) + + /* "talib/_func.pxi":1600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1603, __pyx_L1_error) + + /* "talib/_func.pxi":1602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1605 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1605, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1606 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1608, __pyx_L1_error) + + /* "talib/_func.pxi":1607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1610, __pyx_L1_error) + + /* "talib/_func.pxi":1609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1612 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1612, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1613 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1615, __pyx_L1_error) + + /* "talib/_func.pxi":1614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1617, __pyx_L1_error) + + /* "talib/_func.pxi":1616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1619 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1619, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1620 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1621 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1623, __pyx_L1_error) + + /* "talib/_func.pxi":1622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1625, __pyx_L1_error) + + /* "talib/_func.pxi":1624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1627, __pyx_L1_error) + + /* "talib/_func.pxi":1626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1628 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1629 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1630 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1631 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1632 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1631 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1633 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1634 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1635 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1634 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1636 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1637 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1638 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1637 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1639 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1640 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1641 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1640 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1642 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1643 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1645 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1645, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1646 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1647 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3OUTSIDE_Lookback()); + + /* "talib/_func.pxi":1648 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1648, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1649 + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1650 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1651 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1652 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3OUTSIDE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1653 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3OUTSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1654 + * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_55CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_54CDL3STARSINSOUTH[] = " CDL3STARSINSOUTH(open, high, low, close)\n\n Three Stars In The South (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_55CDL3STARSINSOUTH = {"CDL3STARSINSOUTH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_55CDL3STARSINSOUTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_54CDL3STARSINSOUTH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_55CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3STARSINSOUTH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 1); __PYX_ERR(2, 1658, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 2); __PYX_ERR(2, 1658, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 3); __PYX_ERR(2, 1658, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3STARSINSOUTH") < 0)) __PYX_ERR(2, 1658, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1658, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1658, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_54CDL3STARSINSOUTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_54CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3STARSINSOUTH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1681 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1682 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1682, __pyx_L1_error) + + /* "talib/_func.pxi":1681 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1683 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1684 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1684, __pyx_L1_error) + + /* "talib/_func.pxi":1683 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1685 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1686 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1686, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1685 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1687 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1688 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1689 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1689, __pyx_L1_error) + + /* "talib/_func.pxi":1688 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1690 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1691 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1691, __pyx_L1_error) + + /* "talib/_func.pxi":1690 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1692 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1693 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1693, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1692 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1694 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1695 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1696 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1696, __pyx_L1_error) + + /* "talib/_func.pxi":1695 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1697 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1698 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1698, __pyx_L1_error) + + /* "talib/_func.pxi":1697 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1699 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1700 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1700, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1699 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1701 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1702 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1703 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1703, __pyx_L1_error) + + /* "talib/_func.pxi":1702 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1704 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1705 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1705, __pyx_L1_error) + + /* "talib/_func.pxi":1704 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1706 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1707 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1707, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1706 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1708 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1709 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1710 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1711 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1711, __pyx_L1_error) + + /* "talib/_func.pxi":1710 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1712 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1713 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1713, __pyx_L1_error) + + /* "talib/_func.pxi":1712 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1714 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1715 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1715, __pyx_L1_error) + + /* "talib/_func.pxi":1714 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1716 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1717 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1718 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1719 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1720 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1719 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1721 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1722 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1723 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1722 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1724 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1725 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1726 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1725 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1727 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1728 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1729 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1728 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1730 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1731 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1733 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1733, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1734 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1735 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3STARSINSOUTH_Lookback()); + + /* "talib/_func.pxi":1736 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1736, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1737 + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1738 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1739 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1740 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3STARSINSOUTH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1741 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1742 + * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_57CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_56CDL3WHITESOLDIERS[] = " CDL3WHITESOLDIERS(open, high, low, close)\n\n Three Advancing White Soldiers (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_57CDL3WHITESOLDIERS = {"CDL3WHITESOLDIERS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_57CDL3WHITESOLDIERS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_56CDL3WHITESOLDIERS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_57CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 1); __PYX_ERR(2, 1746, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 2); __PYX_ERR(2, 1746, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 3); __PYX_ERR(2, 1746, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3WHITESOLDIERS") < 0)) __PYX_ERR(2, 1746, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1746, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1746, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_56CDL3WHITESOLDIERS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_56CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1769 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1770 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1770, __pyx_L1_error) + + /* "talib/_func.pxi":1769 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1771 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1772 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1772, __pyx_L1_error) + + /* "talib/_func.pxi":1771 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1773 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1774 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1774, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1773 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1775 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1776 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1777 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1777, __pyx_L1_error) + + /* "talib/_func.pxi":1776 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1778 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1779 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1779, __pyx_L1_error) + + /* "talib/_func.pxi":1778 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1780 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1781 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1781, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1780 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1782 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1783 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1784 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1784, __pyx_L1_error) + + /* "talib/_func.pxi":1783 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1785 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1786 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1786, __pyx_L1_error) + + /* "talib/_func.pxi":1785 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1787 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1788 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1788, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1787 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1789 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1790 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1791 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1791, __pyx_L1_error) + + /* "talib/_func.pxi":1790 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1792 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1793 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1793, __pyx_L1_error) + + /* "talib/_func.pxi":1792 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1794 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1795 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1795, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1794 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1796 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1797 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1798 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1799 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1799, __pyx_L1_error) + + /* "talib/_func.pxi":1798 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1800 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1801 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1801, __pyx_L1_error) + + /* "talib/_func.pxi":1800 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1802 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1803 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1803, __pyx_L1_error) + + /* "talib/_func.pxi":1802 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1804 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1805 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1806 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1807 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1808 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1807 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1809 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1810 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1811 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1810 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1812 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1813 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1814 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1813 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1815 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1816 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1817 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1816 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1818 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1819 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1821 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1821, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1822 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1823 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3WHITESOLDIERS_Lookback()); + + /* "talib/_func.pxi":1824 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1824, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1825 + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1826 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1827 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1828 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3WHITESOLDIERS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1829 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1830 + * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_59CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_58CDLABANDONEDBABY[] = " CDLABANDONEDBABY(open, high, low, close[, penetration=?])\n\n Abandoned Baby (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_59CDLABANDONEDBABY = {"CDLABANDONEDBABY", (PyCFunction)__pyx_pw_5talib_7_ta_lib_59CDLABANDONEDBABY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_58CDLABANDONEDBABY}; +static PyObject *__pyx_pw_5talib_7_ta_lib_59CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLABANDONEDBABY (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 1); __PYX_ERR(2, 1834, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 2); __PYX_ERR(2, 1834, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 3); __PYX_ERR(2, 1834, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLABANDONEDBABY") < 0)) __PYX_ERR(2, 1834, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 1834, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1834, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1834, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_58CDLABANDONEDBABY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_58CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLABANDONEDBABY", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1859 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1860 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1860, __pyx_L1_error) + + /* "talib/_func.pxi":1859 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1861 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1862 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1862, __pyx_L1_error) + + /* "talib/_func.pxi":1861 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1863 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1864 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1864, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1863 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1865 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1866 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1867 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1867, __pyx_L1_error) + + /* "talib/_func.pxi":1866 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1868 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1869 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1869, __pyx_L1_error) + + /* "talib/_func.pxi":1868 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1870 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1871 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1871, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1870 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1872 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1873 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1874 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1874, __pyx_L1_error) + + /* "talib/_func.pxi":1873 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1875 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1876 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1876, __pyx_L1_error) + + /* "talib/_func.pxi":1875 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1877 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1878 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1878, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1877 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1879 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1880 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1881 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1881, __pyx_L1_error) + + /* "talib/_func.pxi":1880 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1882 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1883 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1883, __pyx_L1_error) + + /* "talib/_func.pxi":1882 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1884 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1885 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1885, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1884 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1886 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1887 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1888 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1889 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1889, __pyx_L1_error) + + /* "talib/_func.pxi":1888 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1890 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1891 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1891, __pyx_L1_error) + + /* "talib/_func.pxi":1890 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1892 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1893 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1893, __pyx_L1_error) + + /* "talib/_func.pxi":1892 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1894 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1895 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1896 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1897 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1898 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1897 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1899 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1900 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1901 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1900 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1902 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1903 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1904 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1903 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1905 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1906 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1907 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1906 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1908 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1909 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1911 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1911, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":1912 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":1913 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLABANDONEDBABY_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":1914 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1914, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1915 + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":1916 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1917 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":1918 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLABANDONEDBABY(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":1919 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":1920 + * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":1924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_61CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_60CDLADVANCEBLOCK[] = " CDLADVANCEBLOCK(open, high, low, close)\n\n Advance Block (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_61CDLADVANCEBLOCK = {"CDLADVANCEBLOCK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_61CDLADVANCEBLOCK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_60CDLADVANCEBLOCK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_61CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLADVANCEBLOCK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 1); __PYX_ERR(2, 1924, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 2); __PYX_ERR(2, 1924, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 3); __PYX_ERR(2, 1924, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLADVANCEBLOCK") < 0)) __PYX_ERR(2, 1924, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1924, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 1924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 1924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 1924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 1924, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_60CDLADVANCEBLOCK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_60CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLADVANCEBLOCK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":1947 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1948 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1948, __pyx_L1_error) + + /* "talib/_func.pxi":1947 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":1949 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1950 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1950, __pyx_L1_error) + + /* "talib/_func.pxi":1949 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1951 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1952 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1952, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1951 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":1953 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":1954 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1955 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1955, __pyx_L1_error) + + /* "talib/_func.pxi":1954 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":1956 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1957 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1957, __pyx_L1_error) + + /* "talib/_func.pxi":1956 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1958 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1959 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1959, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1958 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":1960 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":1961 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1962 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1962, __pyx_L1_error) + + /* "talib/_func.pxi":1961 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":1963 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1964 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1964, __pyx_L1_error) + + /* "talib/_func.pxi":1963 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1965 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1966 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1966, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1965 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":1967 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":1968 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1969 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1969, __pyx_L1_error) + + /* "talib/_func.pxi":1968 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":1970 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1971 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1971, __pyx_L1_error) + + /* "talib/_func.pxi":1970 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":1972 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1973 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 1973, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":1972 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":1974 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":1975 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":1976 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1977 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1977, __pyx_L1_error) + + /* "talib/_func.pxi":1976 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":1978 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1979 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1979, __pyx_L1_error) + + /* "talib/_func.pxi":1978 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":1980 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1981 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1981, __pyx_L1_error) + + /* "talib/_func.pxi":1980 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":1982 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":1983 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":1984 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":1985 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1986 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1985 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":1987 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":1988 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1989 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1988 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":1990 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":1991 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1992 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1991 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":1993 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":1994 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":1995 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":1994 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":1996 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":1997 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":1999 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1999, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2000 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2001 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLADVANCEBLOCK_Lookback()); + + /* "talib/_func.pxi":2002 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2002, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2003 + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2004 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2005 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2006 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLADVANCEBLOCK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2007 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2008 + * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":1924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2012 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_63CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_62CDLBELTHOLD[] = " CDLBELTHOLD(open, high, low, close)\n\n Belt-hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_63CDLBELTHOLD = {"CDLBELTHOLD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_63CDLBELTHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_62CDLBELTHOLD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_63CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLBELTHOLD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 1); __PYX_ERR(2, 2012, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 2); __PYX_ERR(2, 2012, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 3); __PYX_ERR(2, 2012, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBELTHOLD") < 0)) __PYX_ERR(2, 2012, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2012, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2012, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2012, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2012, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2012, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_62CDLBELTHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_62CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLBELTHOLD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2035 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2036 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2036, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2036, __pyx_L1_error) + + /* "talib/_func.pxi":2035 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2037 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2038 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2038, __pyx_L1_error) + + /* "talib/_func.pxi":2037 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2039 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2040 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2040, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2039 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2041 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2042 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2043 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__234, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2043, __pyx_L1_error) + + /* "talib/_func.pxi":2042 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2044 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2045 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2045, __pyx_L1_error) + + /* "talib/_func.pxi":2044 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2046 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2047 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2047, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2046 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2048 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2049 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2050 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2050, __pyx_L1_error) + + /* "talib/_func.pxi":2049 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2051 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2052 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2052, __pyx_L1_error) + + /* "talib/_func.pxi":2051 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2053 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2054 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2054, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2053 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2055 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2056 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2057 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2057, __pyx_L1_error) + + /* "talib/_func.pxi":2056 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2058 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2059 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2059, __pyx_L1_error) + + /* "talib/_func.pxi":2058 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2060 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2061 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2061, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2060 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2062 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2063 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2064 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2065 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__240, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2065, __pyx_L1_error) + + /* "talib/_func.pxi":2064 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2066 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2067 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__241, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2067, __pyx_L1_error) + + /* "talib/_func.pxi":2066 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2068 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2069 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__242, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2069, __pyx_L1_error) + + /* "talib/_func.pxi":2068 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2070 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2071 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2072 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2073 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2074 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2073 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2075 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2076 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2077 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2076 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2078 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2079 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2080 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2079 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2081 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2082 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2083 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2082 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2084 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2085 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2087 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__243, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2087, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2088 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2089 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLBELTHOLD_Lookback()); + + /* "talib/_func.pxi":2090 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2090, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2091 + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2092 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2093 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2094 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLBELTHOLD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLBELTHOLD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2095 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLBELTHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2096 + * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2012 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2100 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_65CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_64CDLBREAKAWAY[] = " CDLBREAKAWAY(open, high, low, close)\n\n Breakaway (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_65CDLBREAKAWAY = {"CDLBREAKAWAY", (PyCFunction)__pyx_pw_5talib_7_ta_lib_65CDLBREAKAWAY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_64CDLBREAKAWAY}; +static PyObject *__pyx_pw_5talib_7_ta_lib_65CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLBREAKAWAY (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 1); __PYX_ERR(2, 2100, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 2); __PYX_ERR(2, 2100, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 3); __PYX_ERR(2, 2100, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBREAKAWAY") < 0)) __PYX_ERR(2, 2100, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2100, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2100, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2100, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2100, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2100, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_64CDLBREAKAWAY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_64CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLBREAKAWAY", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2123 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2124 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__244, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2124, __pyx_L1_error) + + /* "talib/_func.pxi":2123 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2125 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2126 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__245, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2126, __pyx_L1_error) + + /* "talib/_func.pxi":2125 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2127 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2128 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2128, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2127 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2129 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2130 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2131 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__246, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2131, __pyx_L1_error) + + /* "talib/_func.pxi":2130 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2132 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2133 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__247, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2133, __pyx_L1_error) + + /* "talib/_func.pxi":2132 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2134 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2135 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2135, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2134 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2136 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2137 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2138 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__248, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2138, __pyx_L1_error) + + /* "talib/_func.pxi":2137 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2139 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2140 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2140, __pyx_L1_error) + + /* "talib/_func.pxi":2139 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2141 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2142 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2142, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2141 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2143 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2144 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2145 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__250, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2145, __pyx_L1_error) + + /* "talib/_func.pxi":2144 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2146 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2147 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__251, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2147, __pyx_L1_error) + + /* "talib/_func.pxi":2146 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2148 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2149 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2149, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2148 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2150 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2151 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2152 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2153 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__252, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2153, __pyx_L1_error) + + /* "talib/_func.pxi":2152 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2154 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2155 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__253, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2155, __pyx_L1_error) + + /* "talib/_func.pxi":2154 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2156 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2157 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2157, __pyx_L1_error) + + /* "talib/_func.pxi":2156 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2158 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2159 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2160 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2161 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2162 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2161 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2163 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2164 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2165 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2164 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2166 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2167 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2168 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2167 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2169 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2170 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2171 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2170 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2172 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2173 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2175 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2175, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2176 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2177 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLBREAKAWAY_Lookback()); + + /* "talib/_func.pxi":2178 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2178, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2179 + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2180 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2181 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2182 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLBREAKAWAY(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2183 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLBREAKAWAY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2184 + * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2100 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2188 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_67CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_66CDLCLOSINGMARUBOZU[] = " CDLCLOSINGMARUBOZU(open, high, low, close)\n\n Closing Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_67CDLCLOSINGMARUBOZU = {"CDLCLOSINGMARUBOZU", (PyCFunction)__pyx_pw_5talib_7_ta_lib_67CDLCLOSINGMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_66CDLCLOSINGMARUBOZU}; +static PyObject *__pyx_pw_5talib_7_ta_lib_67CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 1); __PYX_ERR(2, 2188, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 2); __PYX_ERR(2, 2188, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 3); __PYX_ERR(2, 2188, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCLOSINGMARUBOZU") < 0)) __PYX_ERR(2, 2188, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2188, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2188, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_66CDLCLOSINGMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_66CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2211 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2212 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2212, __pyx_L1_error) + + /* "talib/_func.pxi":2211 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2213 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2214 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2214, __pyx_L1_error) + + /* "talib/_func.pxi":2213 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2215 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2216 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2216, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2215 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2217 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2218 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2219 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2219, __pyx_L1_error) + + /* "talib/_func.pxi":2218 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2220 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2221 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2221, __pyx_L1_error) + + /* "talib/_func.pxi":2220 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2222 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2223 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2223, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2222 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2224 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2225 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2226 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2226, __pyx_L1_error) + + /* "talib/_func.pxi":2225 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2227 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2228 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2228, __pyx_L1_error) + + /* "talib/_func.pxi":2227 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2229 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2230 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2230, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2229 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2231 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2232 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2233 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2233, __pyx_L1_error) + + /* "talib/_func.pxi":2232 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2234 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2235 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2235, __pyx_L1_error) + + /* "talib/_func.pxi":2234 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2236 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2237 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2237, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2236 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2238 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2239 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2240 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2241 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2241, __pyx_L1_error) + + /* "talib/_func.pxi":2240 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2242 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2243 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__265, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2243, __pyx_L1_error) + + /* "talib/_func.pxi":2242 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2244 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2245 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__266, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2245, __pyx_L1_error) + + /* "talib/_func.pxi":2244 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2246 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2247 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2248 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2249 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2250 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2249 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2251 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2252 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2253 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2252 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2254 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2255 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2256 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2255 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2257 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2258 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2259 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2258 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2260 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2261 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2263 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__267, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2263, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2264 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2265 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCLOSINGMARUBOZU_Lookback()); + + /* "talib/_func.pxi":2266 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2266, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2267 + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2268 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2269 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2270 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCLOSINGMARUBOZU(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2271 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2272 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2188 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_69CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_68CDLCONCEALBABYSWALL[] = " CDLCONCEALBABYSWALL(open, high, low, close)\n\n Concealing Baby Swallow (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_69CDLCONCEALBABYSWALL = {"CDLCONCEALBABYSWALL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_69CDLCONCEALBABYSWALL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_68CDLCONCEALBABYSWALL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_69CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 1); __PYX_ERR(2, 2276, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 2); __PYX_ERR(2, 2276, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 3); __PYX_ERR(2, 2276, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCONCEALBABYSWALL") < 0)) __PYX_ERR(2, 2276, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2276, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2276, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_68CDLCONCEALBABYSWALL(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_68CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2299 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2300 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__268, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2300, __pyx_L1_error) + + /* "talib/_func.pxi":2299 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2301 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2302 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__269, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2302, __pyx_L1_error) + + /* "talib/_func.pxi":2301 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2303 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2304 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2304, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2303 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2305 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2306 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2307 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__270, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2307, __pyx_L1_error) + + /* "talib/_func.pxi":2306 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2308 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2309 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__271, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2309, __pyx_L1_error) + + /* "talib/_func.pxi":2308 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2310 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2311 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2311, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2310 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2312 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2313 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2314 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__272, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2314, __pyx_L1_error) + + /* "talib/_func.pxi":2313 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2315 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2316 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__273, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2316, __pyx_L1_error) + + /* "talib/_func.pxi":2315 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2317 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2318 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2318, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2317 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2319 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2320 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2321 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__274, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2321, __pyx_L1_error) + + /* "talib/_func.pxi":2320 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2322 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2323 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__275, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2323, __pyx_L1_error) + + /* "talib/_func.pxi":2322 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2324 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2325 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2325, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2324 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2326 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2327 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2328 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2329 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__276, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2329, __pyx_L1_error) + + /* "talib/_func.pxi":2328 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2330 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2331 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__277, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2331, __pyx_L1_error) + + /* "talib/_func.pxi":2330 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2332 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2333 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__278, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2333, __pyx_L1_error) + + /* "talib/_func.pxi":2332 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2334 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2335 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2336 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2337 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2338 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2337 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2339 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2340 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2341 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2340 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2342 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2343 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2344 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2343 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2345 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2346 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2347 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2346 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2348 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2349 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2351 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__279, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2351, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2352 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2353 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCONCEALBABYSWALL_Lookback()); + + /* "talib/_func.pxi":2354 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2354, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2355 + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2356 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2357 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2358 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCONCEALBABYSWALL(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2359 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2360 + * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2364 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_71CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_70CDLCOUNTERATTACK[] = " CDLCOUNTERATTACK(open, high, low, close)\n\n Counterattack (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_71CDLCOUNTERATTACK = {"CDLCOUNTERATTACK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_71CDLCOUNTERATTACK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_70CDLCOUNTERATTACK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_71CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLCOUNTERATTACK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 1); __PYX_ERR(2, 2364, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 2); __PYX_ERR(2, 2364, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 3); __PYX_ERR(2, 2364, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCOUNTERATTACK") < 0)) __PYX_ERR(2, 2364, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2364, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2364, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2364, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2364, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2364, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_70CDLCOUNTERATTACK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_70CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLCOUNTERATTACK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2387 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2388 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__280, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2388, __pyx_L1_error) + + /* "talib/_func.pxi":2387 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2389 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2390 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__281, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2390, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2390, __pyx_L1_error) + + /* "talib/_func.pxi":2389 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2391 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2392 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2392, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2391 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2393 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2394 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2395 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__282, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2395, __pyx_L1_error) + + /* "talib/_func.pxi":2394 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2396 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2397 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__283, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2397, __pyx_L1_error) + + /* "talib/_func.pxi":2396 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2398 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2399 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2399, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2398 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2400 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2401 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2402 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2402, __pyx_L1_error) + + /* "talib/_func.pxi":2401 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2403 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2404 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__285, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2404, __pyx_L1_error) + + /* "talib/_func.pxi":2403 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2405 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2406 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2406, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2405 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2407 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2408 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2409 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__286, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2409, __pyx_L1_error) + + /* "talib/_func.pxi":2408 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2410 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2411 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__287, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2411, __pyx_L1_error) + + /* "talib/_func.pxi":2410 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2412 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2413 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2413, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2412 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2414 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2415 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2416 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2417 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2417, __pyx_L1_error) + + /* "talib/_func.pxi":2416 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2418 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2419 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2419, __pyx_L1_error) + + /* "talib/_func.pxi":2418 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2420 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2421 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__290, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2421, __pyx_L1_error) + + /* "talib/_func.pxi":2420 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2422 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2423 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2424 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2425 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2426 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2425 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2427 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2428 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2429 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2428 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2430 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2431 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2432 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2431 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2433 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2434 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2435 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2434 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2436 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2437 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2439 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2439, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2440 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2441 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCOUNTERATTACK_Lookback()); + + /* "talib/_func.pxi":2442 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2442, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2443 + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2444 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2445 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2446 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCOUNTERATTACK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2447 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2448 + * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2364 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2452 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_73CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_72CDLDARKCLOUDCOVER[] = " CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?])\n\n Dark Cloud Cover (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_73CDLDARKCLOUDCOVER = {"CDLDARKCLOUDCOVER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_73CDLDARKCLOUDCOVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_72CDLDARKCLOUDCOVER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_73CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 1); __PYX_ERR(2, 2452, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 2); __PYX_ERR(2, 2452, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 3); __PYX_ERR(2, 2452, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDARKCLOUDCOVER") < 0)) __PYX_ERR(2, 2452, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 2452, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.5); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2452, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2452, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2452, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2452, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2452, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_72CDLDARKCLOUDCOVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_72CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2477 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2478 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__292, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2478, __pyx_L1_error) + + /* "talib/_func.pxi":2477 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2479 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2480 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__293, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2480, __pyx_L1_error) + + /* "talib/_func.pxi":2479 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2481 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2482 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2482, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2481 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2483 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2484 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2485 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__294, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2485, __pyx_L1_error) + + /* "talib/_func.pxi":2484 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2486 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2487 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__295, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2487, __pyx_L1_error) + + /* "talib/_func.pxi":2486 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2488 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2489 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2489, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2488 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2490 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2491 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2492 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__296, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2492, __pyx_L1_error) + + /* "talib/_func.pxi":2491 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2493 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2494 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__297, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2494, __pyx_L1_error) + + /* "talib/_func.pxi":2493 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2495 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2496 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2496, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2495 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2497 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2498 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2499 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__298, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2499, __pyx_L1_error) + + /* "talib/_func.pxi":2498 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2500 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2501 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__299, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2501, __pyx_L1_error) + + /* "talib/_func.pxi":2500 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2502 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2503 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2503, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2502 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2504 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2505 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2506 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2507 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__300, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2507, __pyx_L1_error) + + /* "talib/_func.pxi":2506 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2508 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2509 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2509, __pyx_L1_error) + + /* "talib/_func.pxi":2508 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2510 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2511 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__302, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2511, __pyx_L1_error) + + /* "talib/_func.pxi":2510 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2512 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2513 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2514 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2515 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2516 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2515 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2517 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2518 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2519 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2518 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2520 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2521 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2522 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2521 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2523 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2524 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2525 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2524 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2526 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2527 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2529 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__303, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2529, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2530 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2531 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDARKCLOUDCOVER_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":2532 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2532, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2533 + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2534 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2535 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2536 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDARKCLOUDCOVER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2537 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2538 + * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2452 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2542 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_75CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_74CDLDOJI[] = " CDLDOJI(open, high, low, close)\n\n Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_75CDLDOJI = {"CDLDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_75CDLDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_74CDLDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_75CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 1); __PYX_ERR(2, 2542, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 2); __PYX_ERR(2, 2542, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 3); __PYX_ERR(2, 2542, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJI") < 0)) __PYX_ERR(2, 2542, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2542, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2542, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_74CDLDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_74CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2565 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2566 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__304, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2566, __pyx_L1_error) + + /* "talib/_func.pxi":2565 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2567 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2568 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__305, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2568, __pyx_L1_error) + + /* "talib/_func.pxi":2567 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2569 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2570 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2570, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2569 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2571 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2572 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2573 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__306, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2573, __pyx_L1_error) + + /* "talib/_func.pxi":2572 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2574 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2575 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__307, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2575, __pyx_L1_error) + + /* "talib/_func.pxi":2574 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2576 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2577 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2577, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2576 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2578 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2579 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2580 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__308, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2580, __pyx_L1_error) + + /* "talib/_func.pxi":2579 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2581 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2582 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__309, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2582, __pyx_L1_error) + + /* "talib/_func.pxi":2581 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2583 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2584 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2584, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2583 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2585 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2586 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2587 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__310, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2587, __pyx_L1_error) + + /* "talib/_func.pxi":2586 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2588 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2589 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__311, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2589, __pyx_L1_error) + + /* "talib/_func.pxi":2588 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2590 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2591 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2591, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2590 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2592 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2593 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2594 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2595 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__312, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2595, __pyx_L1_error) + + /* "talib/_func.pxi":2594 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2596 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2597 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__313, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2597, __pyx_L1_error) + + /* "talib/_func.pxi":2596 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2598 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2599 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__314, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2599, __pyx_L1_error) + + /* "talib/_func.pxi":2598 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2600 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2601 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2602 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2603 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2604 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2603 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2605 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2606 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2607 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2606 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2608 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2609 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2610 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2609 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2611 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2612 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2613 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2612 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2614 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2615 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2617 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__315, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2617, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2618 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2619 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDOJI_Lookback()); + + /* "talib/_func.pxi":2620 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2620, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2621 + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2622 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2623 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2624 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2625 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2626 + * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2542 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2630 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_77CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_76CDLDOJISTAR[] = " CDLDOJISTAR(open, high, low, close)\n\n Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_77CDLDOJISTAR = {"CDLDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_77CDLDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_76CDLDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_77CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 1); __PYX_ERR(2, 2630, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 2); __PYX_ERR(2, 2630, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 3); __PYX_ERR(2, 2630, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJISTAR") < 0)) __PYX_ERR(2, 2630, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2630, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2630, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_76CDLDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_76CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2653 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2654 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__316, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2654, __pyx_L1_error) + + /* "talib/_func.pxi":2653 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2655 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2656 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__317, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2656, __pyx_L1_error) + + /* "talib/_func.pxi":2655 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2657 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2658 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2658, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2657 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2659 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2660 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2661 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__318, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2661, __pyx_L1_error) + + /* "talib/_func.pxi":2660 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2662 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2663 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__319, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2663, __pyx_L1_error) + + /* "talib/_func.pxi":2662 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2664 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2665 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2665, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2664 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2666 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2667 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2668 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__320, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2668, __pyx_L1_error) + + /* "talib/_func.pxi":2667 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2669 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2670 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__321, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2670, __pyx_L1_error) + + /* "talib/_func.pxi":2669 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2671 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2672 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2672, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2671 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2673 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2674 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2675 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__322, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2675, __pyx_L1_error) + + /* "talib/_func.pxi":2674 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2676 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2677 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__323, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2677, __pyx_L1_error) + + /* "talib/_func.pxi":2676 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2678 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2679 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2679, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2678 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2680 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2681 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2682 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2683 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__324, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2683, __pyx_L1_error) + + /* "talib/_func.pxi":2682 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2684 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2685 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__325, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2685, __pyx_L1_error) + + /* "talib/_func.pxi":2684 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2686 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2687 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__326, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2687, __pyx_L1_error) + + /* "talib/_func.pxi":2686 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2688 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2689 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2690 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2691 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2692 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2691 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2693 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2694 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2695 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2694 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2696 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2697 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2698 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2697 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2699 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2700 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2701 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2700 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2702 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2703 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2705 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__327, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2705, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2706 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2707 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDOJISTAR_Lookback()); + + /* "talib/_func.pxi":2708 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2708, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2708, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2709 + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2710 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2711 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2712 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2713 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2714 + * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2630 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2718 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_79CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_78CDLDRAGONFLYDOJI[] = " CDLDRAGONFLYDOJI(open, high, low, close)\n\n Dragonfly Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_79CDLDRAGONFLYDOJI = {"CDLDRAGONFLYDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_79CDLDRAGONFLYDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_78CDLDRAGONFLYDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_79CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 1); __PYX_ERR(2, 2718, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 2); __PYX_ERR(2, 2718, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 3); __PYX_ERR(2, 2718, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDRAGONFLYDOJI") < 0)) __PYX_ERR(2, 2718, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2718, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2718, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2718, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2718, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2718, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_78CDLDRAGONFLYDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_78CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2741 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2742 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__328, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2742, __pyx_L1_error) + + /* "talib/_func.pxi":2741 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2743 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2744 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__329, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2744, __pyx_L1_error) + + /* "talib/_func.pxi":2743 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2745 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2746 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2746, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2745 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2747 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2748 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2749 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__330, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2749, __pyx_L1_error) + + /* "talib/_func.pxi":2748 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2750 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2751 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__331, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2751, __pyx_L1_error) + + /* "talib/_func.pxi":2750 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2752 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2753 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2753, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2752 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2754 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2755 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2756 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__332, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2756, __pyx_L1_error) + + /* "talib/_func.pxi":2755 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2757 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2758 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__333, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2758, __pyx_L1_error) + + /* "talib/_func.pxi":2757 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2759 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2760 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2760, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2759 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2761 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2762 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2763 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__334, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2763, __pyx_L1_error) + + /* "talib/_func.pxi":2762 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2764 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2765 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__335, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2765, __pyx_L1_error) + + /* "talib/_func.pxi":2764 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2766 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2767 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2767, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2766 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2768 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2769 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2770 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2771 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__336, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2771, __pyx_L1_error) + + /* "talib/_func.pxi":2770 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2772 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2773 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__337, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2773, __pyx_L1_error) + + /* "talib/_func.pxi":2772 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2774 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2775 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__338, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2775, __pyx_L1_error) + + /* "talib/_func.pxi":2774 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2776 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2777 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2778 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2779 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2780 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2779 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2781 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2782 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2783 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2782 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2784 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2785 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2786 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2785 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2787 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2788 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2789 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2788 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2790 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2791 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2793 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__339, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2793, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2794 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2795 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDRAGONFLYDOJI_Lookback()); + + /* "talib/_func.pxi":2796 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2796, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2797 + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2798 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2799 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2800 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDRAGONFLYDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2801 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2802 + * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2718 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2806 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_81CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_80CDLENGULFING[] = " CDLENGULFING(open, high, low, close)\n\n Engulfing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_81CDLENGULFING = {"CDLENGULFING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_81CDLENGULFING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_80CDLENGULFING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_81CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLENGULFING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 1); __PYX_ERR(2, 2806, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 2); __PYX_ERR(2, 2806, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 3); __PYX_ERR(2, 2806, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLENGULFING") < 0)) __PYX_ERR(2, 2806, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2806, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2806, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2806, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2806, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2806, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_80CDLENGULFING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_80CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLENGULFING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2829 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2830 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__340, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2830, __pyx_L1_error) + + /* "talib/_func.pxi":2829 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2831 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2832 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__341, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2832, __pyx_L1_error) + + /* "talib/_func.pxi":2831 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2833 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2834 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2834, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2833 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2835 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2836 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2837 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__342, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2837, __pyx_L1_error) + + /* "talib/_func.pxi":2836 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2838 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2839 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__343, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2839, __pyx_L1_error) + + /* "talib/_func.pxi":2838 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2840 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2841 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2841, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2840 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2842 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2843 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2844 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__344, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2844, __pyx_L1_error) + + /* "talib/_func.pxi":2843 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2845 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2846 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__345, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2846, __pyx_L1_error) + + /* "talib/_func.pxi":2845 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2847 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2848 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2848, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2847 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2849 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2850 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2851 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__346, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2851, __pyx_L1_error) + + /* "talib/_func.pxi":2850 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2852 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2853 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__347, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2853, __pyx_L1_error) + + /* "talib/_func.pxi":2852 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2854 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2855 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2855, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2854 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2856 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2857 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2858 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2859 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__348, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2859, __pyx_L1_error) + + /* "talib/_func.pxi":2858 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2860 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2861 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__349, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2861, __pyx_L1_error) + + /* "talib/_func.pxi":2860 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2862 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2863 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__350, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2863, __pyx_L1_error) + + /* "talib/_func.pxi":2862 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2864 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2865 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2866 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2867 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2868 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2867 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2869 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2870 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2871 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2870 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2872 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2873 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2874 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2873 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2875 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2876 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2877 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2876 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2878 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2879 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2881 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__351, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2881, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2882 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2883 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLENGULFING_Lookback()); + + /* "talib/_func.pxi":2884 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2884, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2885 + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2886 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2887 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLENGULFING", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2888 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLENGULFING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLENGULFING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2889 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLENGULFING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLENGULFING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2890 + * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLENGULFING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2806 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2894 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_83CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_82CDLEVENINGDOJISTAR[] = " CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Evening Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_83CDLEVENINGDOJISTAR = {"CDLEVENINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_83CDLEVENINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_82CDLEVENINGDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_83CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(2, 2894, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(2, 2894, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(2, 2894, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGDOJISTAR") < 0)) __PYX_ERR(2, 2894, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 2894, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2894, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2894, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2894, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2894, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2894, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_82CDLEVENINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_82CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":2919 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2920 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2920, __pyx_L1_error) + + /* "talib/_func.pxi":2919 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":2921 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2922 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2922, __pyx_L1_error) + + /* "talib/_func.pxi":2921 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2923 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2924 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2924, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2923 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":2925 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":2926 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2927 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2927, __pyx_L1_error) + + /* "talib/_func.pxi":2926 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":2928 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2929 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2929, __pyx_L1_error) + + /* "talib/_func.pxi":2928 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2930 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2931 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2931, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2930 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":2932 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":2933 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2934 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__356, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2934, __pyx_L1_error) + + /* "talib/_func.pxi":2933 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":2935 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2936 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__357, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2936, __pyx_L1_error) + + /* "talib/_func.pxi":2935 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2937 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2938 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2938, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2937 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":2939 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":2940 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2941 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__358, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2941, __pyx_L1_error) + + /* "talib/_func.pxi":2940 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":2942 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2943 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__359, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2943, __pyx_L1_error) + + /* "talib/_func.pxi":2942 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":2944 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2945 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2945, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2944 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":2946 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":2947 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":2948 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2949 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__360, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2949, __pyx_L1_error) + + /* "talib/_func.pxi":2948 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":2950 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2951 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__361, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2951, __pyx_L1_error) + + /* "talib/_func.pxi":2950 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":2952 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2953 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__362, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2953, __pyx_L1_error) + + /* "talib/_func.pxi":2952 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":2954 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":2955 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2956 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":2957 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2958 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2957 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":2959 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":2960 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2961 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2960 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":2962 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":2963 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2964 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2963 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":2965 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":2966 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":2967 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":2966 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":2968 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":2969 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":2971 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__363, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 2971, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":2972 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":2973 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLEVENINGDOJISTAR_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":2974 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 2974, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":2975 + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":2976 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":2977 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":2978 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLEVENINGDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":2979 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":2980 + * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2894 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":2984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_85CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_84CDLEVENINGSTAR[] = " CDLEVENINGSTAR(open, high, low, close[, penetration=?])\n\n Evening Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_85CDLEVENINGSTAR = {"CDLEVENINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_85CDLEVENINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_84CDLEVENINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_85CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLEVENINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 1); __PYX_ERR(2, 2984, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 2); __PYX_ERR(2, 2984, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 3); __PYX_ERR(2, 2984, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGSTAR") < 0)) __PYX_ERR(2, 2984, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 2984, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 2984, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 2984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 2984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 2984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 2984, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_84CDLEVENINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_84CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLEVENINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3009 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3010 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__364, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3010, __pyx_L1_error) + + /* "talib/_func.pxi":3009 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3011 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3012 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__365, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3012, __pyx_L1_error) + + /* "talib/_func.pxi":3011 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3013 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3014 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3014, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3013 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3015 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3016 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3017 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__366, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3017, __pyx_L1_error) + + /* "talib/_func.pxi":3016 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3018 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3019 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__367, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3019, __pyx_L1_error) + + /* "talib/_func.pxi":3018 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3020 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3021 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3021, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3020 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3022 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3023 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3024 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__368, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3024, __pyx_L1_error) + + /* "talib/_func.pxi":3023 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3025 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3026 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__369, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3026, __pyx_L1_error) + + /* "talib/_func.pxi":3025 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3027 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3028 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3028, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3027 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3029 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3030 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3031 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__370, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3031, __pyx_L1_error) + + /* "talib/_func.pxi":3030 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3032 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3033 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__371, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3033, __pyx_L1_error) + + /* "talib/_func.pxi":3032 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3034 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3035 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3035, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3034 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3036 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3037 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3038 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3039 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__372, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3039, __pyx_L1_error) + + /* "talib/_func.pxi":3038 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3040 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3041 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__373, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3041, __pyx_L1_error) + + /* "talib/_func.pxi":3040 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3042 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3043 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__374, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3043, __pyx_L1_error) + + /* "talib/_func.pxi":3042 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3044 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3045 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3046 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3047 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3048 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3047 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3049 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3050 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3051 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3050 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3052 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3053 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3054 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3053 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3055 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3056 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3057 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3056 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3058 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3059 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3061 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__375, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3061, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3062 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3063 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLEVENINGSTAR_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":3064 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3064, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3065 + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3066 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3067 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3068 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLEVENINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3069 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3070 + * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":2984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3074 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_87CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_86CDLGAPSIDESIDEWHITE[] = " CDLGAPSIDESIDEWHITE(open, high, low, close)\n\n Up/Down-gap side-by-side white lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_87CDLGAPSIDESIDEWHITE = {"CDLGAPSIDESIDEWHITE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_87CDLGAPSIDESIDEWHITE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_86CDLGAPSIDESIDEWHITE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_87CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 1); __PYX_ERR(2, 3074, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 2); __PYX_ERR(2, 3074, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 3); __PYX_ERR(2, 3074, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGAPSIDESIDEWHITE") < 0)) __PYX_ERR(2, 3074, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3074, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3074, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3074, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3074, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3074, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_86CDLGAPSIDESIDEWHITE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_86CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3097 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3098 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__376, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3098, __pyx_L1_error) + + /* "talib/_func.pxi":3097 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3099 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3100 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__377, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3100, __pyx_L1_error) + + /* "talib/_func.pxi":3099 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3101 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3102 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3102, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3101 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3103 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3104 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3105 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__378, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3105, __pyx_L1_error) + + /* "talib/_func.pxi":3104 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3106 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3107 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__379, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3107, __pyx_L1_error) + + /* "talib/_func.pxi":3106 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3108 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3109 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3109, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3108 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3110 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3111 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3112 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__380, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3112, __pyx_L1_error) + + /* "talib/_func.pxi":3111 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3113 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3114 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__381, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3114, __pyx_L1_error) + + /* "talib/_func.pxi":3113 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3115 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3116 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3116, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3115 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3117 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3118 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3119 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__382, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3119, __pyx_L1_error) + + /* "talib/_func.pxi":3118 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3120 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3121 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__383, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3121, __pyx_L1_error) + + /* "talib/_func.pxi":3120 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3122 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3123 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3123, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3122 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3124 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3125 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3126 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3127 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__384, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3127, __pyx_L1_error) + + /* "talib/_func.pxi":3126 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3128 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3129 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__385, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3129, __pyx_L1_error) + + /* "talib/_func.pxi":3128 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3130 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3131 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__386, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3131, __pyx_L1_error) + + /* "talib/_func.pxi":3130 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3132 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3133 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3134 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3135 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3136 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3135 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3137 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3138 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3139 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3138 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3140 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3141 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3142 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3141 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3143 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3144 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3145 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3144 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3146 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3147 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3149 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__387, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3149, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3150 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3151 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLGAPSIDESIDEWHITE_Lookback()); + + /* "talib/_func.pxi":3152 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3152, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3153 + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3154 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3155 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3156 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLGAPSIDESIDEWHITE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3157 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3158 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3074 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3162 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_89CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_88CDLGRAVESTONEDOJI[] = " CDLGRAVESTONEDOJI(open, high, low, close)\n\n Gravestone Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_89CDLGRAVESTONEDOJI = {"CDLGRAVESTONEDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_89CDLGRAVESTONEDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_88CDLGRAVESTONEDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_89CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 1); __PYX_ERR(2, 3162, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 2); __PYX_ERR(2, 3162, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 3); __PYX_ERR(2, 3162, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGRAVESTONEDOJI") < 0)) __PYX_ERR(2, 3162, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3162, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3162, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3162, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3162, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3162, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_88CDLGRAVESTONEDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_88CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3185 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3186 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__388, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3186, __pyx_L1_error) + + /* "talib/_func.pxi":3185 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3187 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3188 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__389, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3188, __pyx_L1_error) + + /* "talib/_func.pxi":3187 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3189 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3190 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3190, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3189 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3191 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3192 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3193 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__390, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3193, __pyx_L1_error) + + /* "talib/_func.pxi":3192 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3194 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3195 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__391, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3195, __pyx_L1_error) + + /* "talib/_func.pxi":3194 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3196 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3197 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3197, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3196 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3198 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3199 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3200 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__392, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3200, __pyx_L1_error) + + /* "talib/_func.pxi":3199 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3201 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3202 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__393, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3202, __pyx_L1_error) + + /* "talib/_func.pxi":3201 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3203 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3204 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3204, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3203 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3205 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3206 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3207 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__394, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3207, __pyx_L1_error) + + /* "talib/_func.pxi":3206 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3208 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3209 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__395, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3209, __pyx_L1_error) + + /* "talib/_func.pxi":3208 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3210 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3211 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3211, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3210 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3212 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3213 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3214 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3215 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__396, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3215, __pyx_L1_error) + + /* "talib/_func.pxi":3214 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3216 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3217 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__397, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3217, __pyx_L1_error) + + /* "talib/_func.pxi":3216 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3218 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3219 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__398, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3219, __pyx_L1_error) + + /* "talib/_func.pxi":3218 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3220 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3221 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3222 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3223 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3224 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3223 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3225 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3226 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3227 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3226 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3228 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3229 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3230 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3229 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3231 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3232 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3233 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3232 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3234 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3235 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3237 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__399, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3237, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3238 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3239 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLGRAVESTONEDOJI_Lookback()); + + /* "talib/_func.pxi":3240 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3240, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3241 + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3242 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3243 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3244 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLGRAVESTONEDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3245 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3246 + * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3162 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3250 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_91CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_90CDLHAMMER[] = " CDLHAMMER(open, high, low, close)\n\n Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_91CDLHAMMER = {"CDLHAMMER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_91CDLHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_90CDLHAMMER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_91CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHAMMER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 1); __PYX_ERR(2, 3250, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 2); __PYX_ERR(2, 3250, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 3); __PYX_ERR(2, 3250, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHAMMER") < 0)) __PYX_ERR(2, 3250, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3250, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3250, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_90CDLHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_90CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHAMMER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3273 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3274 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__400, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3274, __pyx_L1_error) + + /* "talib/_func.pxi":3273 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3275 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3276 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__401, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3276, __pyx_L1_error) + + /* "talib/_func.pxi":3275 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3277 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3278 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3278, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3277 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3279 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3280 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3281 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__402, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3281, __pyx_L1_error) + + /* "talib/_func.pxi":3280 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3282 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3283 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__403, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3283, __pyx_L1_error) + + /* "talib/_func.pxi":3282 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3284 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3285 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3285, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3284 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3286 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3287 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3288 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__404, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3288, __pyx_L1_error) + + /* "talib/_func.pxi":3287 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3289 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3290 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__405, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3290, __pyx_L1_error) + + /* "talib/_func.pxi":3289 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3291 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3292 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3292, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3291 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3293 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3294 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3295 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__406, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3295, __pyx_L1_error) + + /* "talib/_func.pxi":3294 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3296 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3297 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__407, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3297, __pyx_L1_error) + + /* "talib/_func.pxi":3296 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3298 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3299 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3299, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3298 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3300 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3301 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3302 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3303 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__408, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3303, __pyx_L1_error) + + /* "talib/_func.pxi":3302 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3304 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3305 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__409, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3305, __pyx_L1_error) + + /* "talib/_func.pxi":3304 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3306 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3307 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__410, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3307, __pyx_L1_error) + + /* "talib/_func.pxi":3306 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3308 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3309 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3310 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3311 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3312 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3311 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3313 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3314 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3315 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3314 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3316 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3317 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3318 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3317 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3319 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3320 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3321 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3320 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3322 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3323 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3325 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__411, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3325, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3326 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3327 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHAMMER_Lookback()); + + /* "talib/_func.pxi":3328 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3328, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3329 + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3330 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3331 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHAMMER", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3332 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHAMMER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHAMMER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3333 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHAMMER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3334 + * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHAMMER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3250 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3338 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_93CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_92CDLHANGINGMAN[] = " CDLHANGINGMAN(open, high, low, close)\n\n Hanging Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_93CDLHANGINGMAN = {"CDLHANGINGMAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_93CDLHANGINGMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_92CDLHANGINGMAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_93CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHANGINGMAN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 1); __PYX_ERR(2, 3338, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 2); __PYX_ERR(2, 3338, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 3); __PYX_ERR(2, 3338, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHANGINGMAN") < 0)) __PYX_ERR(2, 3338, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3338, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3338, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3338, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3338, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3338, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_92CDLHANGINGMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_92CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHANGINGMAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3361 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3362 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__412, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3362, __pyx_L1_error) + + /* "talib/_func.pxi":3361 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3363 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3364 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__413, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3364, __pyx_L1_error) + + /* "talib/_func.pxi":3363 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3365 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3366 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3366, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3365 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3367 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3368 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3369 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__414, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3369, __pyx_L1_error) + + /* "talib/_func.pxi":3368 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3370 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3371 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__415, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3371, __pyx_L1_error) + + /* "talib/_func.pxi":3370 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3372 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3373 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3373, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3372 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3374 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3375 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3376 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__416, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3376, __pyx_L1_error) + + /* "talib/_func.pxi":3375 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3377 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3378 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__417, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3378, __pyx_L1_error) + + /* "talib/_func.pxi":3377 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3379 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3380 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3380, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3379 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3381 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3382 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3383 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__418, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3383, __pyx_L1_error) + + /* "talib/_func.pxi":3382 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3384 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3385 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__419, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3385, __pyx_L1_error) + + /* "talib/_func.pxi":3384 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3386 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3387 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3387, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3386 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3388 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3389 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3390 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3391 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__420, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3391, __pyx_L1_error) + + /* "talib/_func.pxi":3390 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3392 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3393 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__421, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3393, __pyx_L1_error) + + /* "talib/_func.pxi":3392 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3394 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3395 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__422, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3395, __pyx_L1_error) + + /* "talib/_func.pxi":3394 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3396 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3397 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3398 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3399 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3400 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3399 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3401 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3402 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3403 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3402 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3404 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3405 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3406 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3405 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3407 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3408 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3409 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3408 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3410 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3411 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3413 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__423, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3413, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3414 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3415 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHANGINGMAN_Lookback()); + + /* "talib/_func.pxi":3416 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3416, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3417 + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3418 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3419 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3420 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHANGINGMAN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3421 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHANGINGMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3422 + * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3338 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3426 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_95CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_94CDLHARAMI[] = " CDLHARAMI(open, high, low, close)\n\n Harami Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_95CDLHARAMI = {"CDLHARAMI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_95CDLHARAMI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_94CDLHARAMI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_95CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHARAMI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 1); __PYX_ERR(2, 3426, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 2); __PYX_ERR(2, 3426, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 3); __PYX_ERR(2, 3426, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMI") < 0)) __PYX_ERR(2, 3426, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3426, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3426, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_94CDLHARAMI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_94CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHARAMI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3449 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3450 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__424, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3450, __pyx_L1_error) + + /* "talib/_func.pxi":3449 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3451 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3452 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__425, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3452, __pyx_L1_error) + + /* "talib/_func.pxi":3451 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3453 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3454 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3454, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3453 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3455 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3456 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3457 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__426, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3457, __pyx_L1_error) + + /* "talib/_func.pxi":3456 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3458 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3459 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__427, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3459, __pyx_L1_error) + + /* "talib/_func.pxi":3458 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3460 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3461 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3461, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3460 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3462 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3463 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3464 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__428, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3464, __pyx_L1_error) + + /* "talib/_func.pxi":3463 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3465 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3466 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__429, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3466, __pyx_L1_error) + + /* "talib/_func.pxi":3465 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3467 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3468 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3468, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3467 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3469 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3470 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3471 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__430, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3471, __pyx_L1_error) + + /* "talib/_func.pxi":3470 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3472 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3473 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__431, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3473, __pyx_L1_error) + + /* "talib/_func.pxi":3472 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3474 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3475 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3475, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3474 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3476 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3477 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3478 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3479 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__432, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3479, __pyx_L1_error) + + /* "talib/_func.pxi":3478 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3480 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3481 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__433, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3481, __pyx_L1_error) + + /* "talib/_func.pxi":3480 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3482 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3483 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__434, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3483, __pyx_L1_error) + + /* "talib/_func.pxi":3482 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3484 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3485 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3486 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3487 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3488 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3487 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3489 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3490 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3491 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3490 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3492 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3493 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3494 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3493 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3495 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3496 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3497 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3496 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3498 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3499 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3501 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__435, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3501, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3502 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3503 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHARAMI_Lookback()); + + /* "talib/_func.pxi":3504 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3504, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3505 + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3506 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3507 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3508 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHARAMI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHARAMI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3509 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHARAMI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3510 + * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3426 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3514 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_97CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_96CDLHARAMICROSS[] = " CDLHARAMICROSS(open, high, low, close)\n\n Harami Cross Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_97CDLHARAMICROSS = {"CDLHARAMICROSS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_97CDLHARAMICROSS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_96CDLHARAMICROSS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_97CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHARAMICROSS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 1); __PYX_ERR(2, 3514, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 2); __PYX_ERR(2, 3514, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 3); __PYX_ERR(2, 3514, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMICROSS") < 0)) __PYX_ERR(2, 3514, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3514, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3514, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_96CDLHARAMICROSS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_96CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHARAMICROSS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3537 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3538 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__436, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3538, __pyx_L1_error) + + /* "talib/_func.pxi":3537 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3539 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3540 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__437, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3540, __pyx_L1_error) + + /* "talib/_func.pxi":3539 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3541 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3542 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3542, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3541 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3543 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3544 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3545 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__438, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3545, __pyx_L1_error) + + /* "talib/_func.pxi":3544 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3546 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3547 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__439, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3547, __pyx_L1_error) + + /* "talib/_func.pxi":3546 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3548 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3549 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3549, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3548 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3550 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3551 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3552 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__440, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3552, __pyx_L1_error) + + /* "talib/_func.pxi":3551 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3553 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3554 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__441, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3554, __pyx_L1_error) + + /* "talib/_func.pxi":3553 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3555 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3556 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3556, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3555 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3557 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3558 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3559 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__442, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3559, __pyx_L1_error) + + /* "talib/_func.pxi":3558 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3560 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3561 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__443, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3561, __pyx_L1_error) + + /* "talib/_func.pxi":3560 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3562 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3563 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3563, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3562 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3564 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3565 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3566 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3567 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__444, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3567, __pyx_L1_error) + + /* "talib/_func.pxi":3566 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3568 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3569 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__445, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3569, __pyx_L1_error) + + /* "talib/_func.pxi":3568 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3570 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3571 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__446, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3571, __pyx_L1_error) + + /* "talib/_func.pxi":3570 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3572 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3573 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3574 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3575 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3576 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3575 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3577 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3578 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3579 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3578 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3580 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3581 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3582 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3581 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3583 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3584 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3585 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3584 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3586 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3587 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3589 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__447, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3589, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3590 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3591 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHARAMICROSS_Lookback()); + + /* "talib/_func.pxi":3592 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3592, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3593 + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3594 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3595 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3596 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHARAMICROSS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3597 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHARAMICROSS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3598 + * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3514 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3602 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_99CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_98CDLHIGHWAVE[] = " CDLHIGHWAVE(open, high, low, close)\n\n High-Wave Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_99CDLHIGHWAVE = {"CDLHIGHWAVE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_99CDLHIGHWAVE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_98CDLHIGHWAVE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_99CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHIGHWAVE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 1); __PYX_ERR(2, 3602, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 2); __PYX_ERR(2, 3602, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 3); __PYX_ERR(2, 3602, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIGHWAVE") < 0)) __PYX_ERR(2, 3602, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3602, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3602, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3602, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3602, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3602, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_98CDLHIGHWAVE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_98CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHIGHWAVE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3625 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3626 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__448, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3626, __pyx_L1_error) + + /* "talib/_func.pxi":3625 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3627 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3628 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__449, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3628, __pyx_L1_error) + + /* "talib/_func.pxi":3627 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3629 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3630 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3630, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3629 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3631 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3632 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3633 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__450, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3633, __pyx_L1_error) + + /* "talib/_func.pxi":3632 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3634 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3635 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__451, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3635, __pyx_L1_error) + + /* "talib/_func.pxi":3634 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3636 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3637 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3637, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3636 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3638 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3639 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3640 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__452, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3640, __pyx_L1_error) + + /* "talib/_func.pxi":3639 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3641 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3642 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__453, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3642, __pyx_L1_error) + + /* "talib/_func.pxi":3641 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3643 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3644 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3644, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3643 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3645 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3646 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3647 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__454, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3647, __pyx_L1_error) + + /* "talib/_func.pxi":3646 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3648 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3649 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__455, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3649, __pyx_L1_error) + + /* "talib/_func.pxi":3648 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3650 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3651 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3651, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3650 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3652 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3653 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3654 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3655 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__456, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3655, __pyx_L1_error) + + /* "talib/_func.pxi":3654 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3656 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3657 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__457, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3657, __pyx_L1_error) + + /* "talib/_func.pxi":3656 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3658 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3659 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__458, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3659, __pyx_L1_error) + + /* "talib/_func.pxi":3658 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3660 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3661 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3662 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3663 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3664 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3663 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3665 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3666 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3667 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3666 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3668 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3669 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3670 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3669 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3671 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3672 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3673 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3672 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3674 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3675 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3677 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__459, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3677, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3678 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3679 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIGHWAVE_Lookback()); + + /* "talib/_func.pxi":3680 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3680, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3681 + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3682 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3683 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3684 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIGHWAVE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3685 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIGHWAVE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3686 + * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3602 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3690 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_101CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_100CDLHIKKAKE[] = " CDLHIKKAKE(open, high, low, close)\n\n Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_101CDLHIKKAKE = {"CDLHIKKAKE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_101CDLHIKKAKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_100CDLHIKKAKE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_101CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHIKKAKE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 1); __PYX_ERR(2, 3690, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 2); __PYX_ERR(2, 3690, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 3); __PYX_ERR(2, 3690, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKE") < 0)) __PYX_ERR(2, 3690, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3690, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3690, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3690, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3690, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3690, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_100CDLHIKKAKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_100CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHIKKAKE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3713 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3714 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__460, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3714, __pyx_L1_error) + + /* "talib/_func.pxi":3713 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3715 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3716 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__461, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3716, __pyx_L1_error) + + /* "talib/_func.pxi":3715 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3717 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3718 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3718, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3717 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3719 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3720 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3721 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__462, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3721, __pyx_L1_error) + + /* "talib/_func.pxi":3720 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3722 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3723 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__463, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3723, __pyx_L1_error) + + /* "talib/_func.pxi":3722 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3724 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3725 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3725, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3724 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3726 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3727 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3728 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__464, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3728, __pyx_L1_error) + + /* "talib/_func.pxi":3727 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3729 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3730 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__465, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3730, __pyx_L1_error) + + /* "talib/_func.pxi":3729 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3731 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3732 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3732, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3731 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3733 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3734 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3735 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__466, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3735, __pyx_L1_error) + + /* "talib/_func.pxi":3734 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3736 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3737 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__467, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3737, __pyx_L1_error) + + /* "talib/_func.pxi":3736 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3738 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3739 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3739, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3738 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3740 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3741 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3742 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3743 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__468, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3743, __pyx_L1_error) + + /* "talib/_func.pxi":3742 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3744 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3745 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__469, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3745, __pyx_L1_error) + + /* "talib/_func.pxi":3744 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3746 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3747 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__470, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3747, __pyx_L1_error) + + /* "talib/_func.pxi":3746 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3748 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3749 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3750 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3751 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3752 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3751 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3753 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3754 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3755 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3754 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3756 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3757 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3758 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3757 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3759 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3760 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3761 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3760 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3762 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3763 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3765 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__471, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3765, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3766 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3767 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIKKAKE_Lookback()); + + /* "talib/_func.pxi":3768 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3768, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3769 + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3770 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3771 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3772 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIKKAKE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIKKAKE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3773 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIKKAKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3774 + * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3690 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3778 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_103CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_102CDLHIKKAKEMOD[] = " CDLHIKKAKEMOD(open, high, low, close)\n\n Modified Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_103CDLHIKKAKEMOD = {"CDLHIKKAKEMOD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_103CDLHIKKAKEMOD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_102CDLHIKKAKEMOD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_103CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHIKKAKEMOD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 1); __PYX_ERR(2, 3778, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 2); __PYX_ERR(2, 3778, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 3); __PYX_ERR(2, 3778, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKEMOD") < 0)) __PYX_ERR(2, 3778, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3778, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3778, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3778, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3778, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3778, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_102CDLHIKKAKEMOD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_102CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHIKKAKEMOD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3801 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3802 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__472, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3802, __pyx_L1_error) + + /* "talib/_func.pxi":3801 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3803 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3804 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__473, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3804, __pyx_L1_error) + + /* "talib/_func.pxi":3803 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3805 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3806 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3806, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3805 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3807 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3808 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3809 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__474, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3809, __pyx_L1_error) + + /* "talib/_func.pxi":3808 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3810 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3811 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__475, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3811, __pyx_L1_error) + + /* "talib/_func.pxi":3810 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3812 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3813 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3813, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3812 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3814 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3815 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3816 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__476, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3816, __pyx_L1_error) + + /* "talib/_func.pxi":3815 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3817 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3818 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__477, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3818, __pyx_L1_error) + + /* "talib/_func.pxi":3817 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3819 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3820 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3820, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3819 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3821 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3822 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3823 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__478, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3823, __pyx_L1_error) + + /* "talib/_func.pxi":3822 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3824 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3825 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__479, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3825, __pyx_L1_error) + + /* "talib/_func.pxi":3824 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3826 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3827 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3827, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3826 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3828 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3829 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3830 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3831 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__480, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3831, __pyx_L1_error) + + /* "talib/_func.pxi":3830 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3832 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3833 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__481, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3833, __pyx_L1_error) + + /* "talib/_func.pxi":3832 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3834 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3835 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__482, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3835, __pyx_L1_error) + + /* "talib/_func.pxi":3834 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3836 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3837 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3838 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3839 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3840 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3839 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3841 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3842 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3843 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3842 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3844 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3845 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3846 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3845 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3847 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3848 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3849 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3848 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3850 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3851 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3853 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__483, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3853, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3854 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3855 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIKKAKEMOD_Lookback()); + + /* "talib/_func.pxi":3856 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3856, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3857 + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3858 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3859 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3860 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIKKAKEMOD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3861 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3862 + * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3778 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3866 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_105CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_104CDLHOMINGPIGEON[] = " CDLHOMINGPIGEON(open, high, low, close)\n\n Homing Pigeon (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_105CDLHOMINGPIGEON = {"CDLHOMINGPIGEON", (PyCFunction)__pyx_pw_5talib_7_ta_lib_105CDLHOMINGPIGEON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_104CDLHOMINGPIGEON}; +static PyObject *__pyx_pw_5talib_7_ta_lib_105CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLHOMINGPIGEON (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 1); __PYX_ERR(2, 3866, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 2); __PYX_ERR(2, 3866, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 3); __PYX_ERR(2, 3866, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHOMINGPIGEON") < 0)) __PYX_ERR(2, 3866, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3866, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3866, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_104CDLHOMINGPIGEON(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_104CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLHOMINGPIGEON", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3889 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3890 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__484, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3890, __pyx_L1_error) + + /* "talib/_func.pxi":3889 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3891 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3892 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__485, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3892, __pyx_L1_error) + + /* "talib/_func.pxi":3891 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3893 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3894 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3894, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3893 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3895 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3896 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3897 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__486, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3897, __pyx_L1_error) + + /* "talib/_func.pxi":3896 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3898 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3899 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__487, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3899, __pyx_L1_error) + + /* "talib/_func.pxi":3898 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3900 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3901 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3901, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3900 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3902 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3903 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3904 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__488, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3904, __pyx_L1_error) + + /* "talib/_func.pxi":3903 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3905 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3906 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__489, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3906, __pyx_L1_error) + + /* "talib/_func.pxi":3905 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3907 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3908 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3908, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3907 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3909 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3910 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3911 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__490, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3911, __pyx_L1_error) + + /* "talib/_func.pxi":3910 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":3912 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3913 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__491, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3913, __pyx_L1_error) + + /* "talib/_func.pxi":3912 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3914 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3915 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3915, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3914 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":3916 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":3917 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":3918 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3919 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__492, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3919, __pyx_L1_error) + + /* "talib/_func.pxi":3918 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":3920 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3921 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__493, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3921, __pyx_L1_error) + + /* "talib/_func.pxi":3920 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":3922 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3923 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__494, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3923, __pyx_L1_error) + + /* "talib/_func.pxi":3922 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":3924 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":3925 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3926 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":3927 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3928 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3927 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":3929 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":3930 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3931 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3930 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":3932 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":3933 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3934 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3933 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":3935 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":3936 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3937 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":3936 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":3938 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":3939 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":3941 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__495, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3941, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":3942 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":3943 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHOMINGPIGEON_Lookback()); + + /* "talib/_func.pxi":3944 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3944, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3945 + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":3946 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":3947 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":3948 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHOMINGPIGEON(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":3949 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":3950 + * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3866 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":3954 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_107CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_106CDLIDENTICAL3CROWS[] = " CDLIDENTICAL3CROWS(open, high, low, close)\n\n Identical Three Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_107CDLIDENTICAL3CROWS = {"CDLIDENTICAL3CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_107CDLIDENTICAL3CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_106CDLIDENTICAL3CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_107CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 1); __PYX_ERR(2, 3954, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 2); __PYX_ERR(2, 3954, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 3); __PYX_ERR(2, 3954, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLIDENTICAL3CROWS") < 0)) __PYX_ERR(2, 3954, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 3954, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 3954, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 3954, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 3954, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 3954, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_106CDLIDENTICAL3CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_106CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":3977 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3978 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__496, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3978, __pyx_L1_error) + + /* "talib/_func.pxi":3977 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":3979 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3980 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__497, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3980, __pyx_L1_error) + + /* "talib/_func.pxi":3979 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3981 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3982 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3982, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3981 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":3983 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":3984 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3985 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__498, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3985, __pyx_L1_error) + + /* "talib/_func.pxi":3984 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":3986 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3987 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__499, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3987, __pyx_L1_error) + + /* "talib/_func.pxi":3986 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3988 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3989 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3989, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3988 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":3990 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":3991 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3992 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__500, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3992, __pyx_L1_error) + + /* "talib/_func.pxi":3991 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":3993 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3994 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__501, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3994, __pyx_L1_error) + + /* "talib/_func.pxi":3993 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":3995 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3996 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 3996, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":3995 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":3997 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":3998 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":3999 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__502, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 3999, __pyx_L1_error) + + /* "talib/_func.pxi":3998 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4000 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4001 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__503, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4001, __pyx_L1_error) + + /* "talib/_func.pxi":4000 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4002 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4003 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4003, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4002 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4004 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4005 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4006 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4007 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__504, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4007, __pyx_L1_error) + + /* "talib/_func.pxi":4006 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4008 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4009 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__505, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4009, __pyx_L1_error) + + /* "talib/_func.pxi":4008 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4010 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4011 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__506, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4011, __pyx_L1_error) + + /* "talib/_func.pxi":4010 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4012 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4013 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4014 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4015 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4016 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4015 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4017 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4018 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4019 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4018 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4020 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4021 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4022 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4021 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4023 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4024 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4025 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4024 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4026 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4027 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4029 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__507, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4029, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4030 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4031 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLIDENTICAL3CROWS_Lookback()); + + /* "talib/_func.pxi":4032 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4032, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4033 + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4034 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4035 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4036 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLIDENTICAL3CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4037 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4038 + * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":3954 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_109CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_108CDLINNECK[] = " CDLINNECK(open, high, low, close)\n\n In-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_109CDLINNECK = {"CDLINNECK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_109CDLINNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_108CDLINNECK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_109CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLINNECK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 1); __PYX_ERR(2, 4042, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 2); __PYX_ERR(2, 4042, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 3); __PYX_ERR(2, 4042, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINNECK") < 0)) __PYX_ERR(2, 4042, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4042, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4042, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_108CDLINNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_108CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLINNECK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4065 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4066 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__508, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4066, __pyx_L1_error) + + /* "talib/_func.pxi":4065 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4067 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4068 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__509, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4068, __pyx_L1_error) + + /* "talib/_func.pxi":4067 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4069 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4070 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4070, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4069 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4071 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4072 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4073 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__510, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4073, __pyx_L1_error) + + /* "talib/_func.pxi":4072 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4074 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4075 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__511, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4075, __pyx_L1_error) + + /* "talib/_func.pxi":4074 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4076 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4077 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4077, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4076 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4078 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4079 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4080 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__512, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4080, __pyx_L1_error) + + /* "talib/_func.pxi":4079 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4081 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4082 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__513, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4082, __pyx_L1_error) + + /* "talib/_func.pxi":4081 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4083 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4084 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4084, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4083 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4085 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4086 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4087 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__514, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4087, __pyx_L1_error) + + /* "talib/_func.pxi":4086 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4088 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4089 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__515, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4089, __pyx_L1_error) + + /* "talib/_func.pxi":4088 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4090 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4091 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4091, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4090 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4092 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4093 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4094 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4095 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__516, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4095, __pyx_L1_error) + + /* "talib/_func.pxi":4094 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4096 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4097 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__517, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4097, __pyx_L1_error) + + /* "talib/_func.pxi":4096 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4098 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4099 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__518, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4099, __pyx_L1_error) + + /* "talib/_func.pxi":4098 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4100 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4101 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4102 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4103 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4104 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4103 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4105 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4106 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4107 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4106 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4108 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4109 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4110 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4109 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4111 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4112 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4113 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4112 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4114 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4115 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4117 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__519, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4117, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4118 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4119 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLINNECK_Lookback()); + + /* "talib/_func.pxi":4120 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4120, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4121 + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4122 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4123 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINNECK", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4124 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLINNECK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLINNECK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4125 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINNECK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLINNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4126 + * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINNECK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4130 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_111CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_110CDLINVERTEDHAMMER[] = " CDLINVERTEDHAMMER(open, high, low, close)\n\n Inverted Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_111CDLINVERTEDHAMMER = {"CDLINVERTEDHAMMER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_111CDLINVERTEDHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_110CDLINVERTEDHAMMER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_111CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 1); __PYX_ERR(2, 4130, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 2); __PYX_ERR(2, 4130, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 3); __PYX_ERR(2, 4130, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINVERTEDHAMMER") < 0)) __PYX_ERR(2, 4130, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4130, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4130, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4130, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4130, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4130, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_110CDLINVERTEDHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_110CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4153 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4154 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__520, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4154, __pyx_L1_error) + + /* "talib/_func.pxi":4153 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4155 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4156 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__521, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4156, __pyx_L1_error) + + /* "talib/_func.pxi":4155 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4157 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4158 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4158, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4157 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4159 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4160 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4161 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__522, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4161, __pyx_L1_error) + + /* "talib/_func.pxi":4160 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4162 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4163 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__523, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4163, __pyx_L1_error) + + /* "talib/_func.pxi":4162 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4164 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4165 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4165, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4164 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4166 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4167 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4168 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__524, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4168, __pyx_L1_error) + + /* "talib/_func.pxi":4167 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4169 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4170 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__525, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4170, __pyx_L1_error) + + /* "talib/_func.pxi":4169 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4171 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4172 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4172, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4171 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4173 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4174 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4175 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__526, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4175, __pyx_L1_error) + + /* "talib/_func.pxi":4174 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4176 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4177 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__527, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4177, __pyx_L1_error) + + /* "talib/_func.pxi":4176 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4178 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4179 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4179, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4178 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4180 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4181 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4182 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4183 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__528, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4183, __pyx_L1_error) + + /* "talib/_func.pxi":4182 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4184 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4185 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__529, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4185, __pyx_L1_error) + + /* "talib/_func.pxi":4184 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4186 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4187 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__530, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4187, __pyx_L1_error) + + /* "talib/_func.pxi":4186 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4188 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4189 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4190 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4191 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4192 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4191 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4193 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4194 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4195 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4194 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4196 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4197 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4198 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4197 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4199 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4200 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4201 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4200 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4202 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4203 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4205 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__531, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4205, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4206 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4207 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLINVERTEDHAMMER_Lookback()); + + /* "talib/_func.pxi":4208 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4208, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4209 + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4210 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4211 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4212 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLINVERTEDHAMMER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4213 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4214 + * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4130 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_113CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_112CDLKICKING[] = " CDLKICKING(open, high, low, close)\n\n Kicking (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_113CDLKICKING = {"CDLKICKING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_113CDLKICKING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_112CDLKICKING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_113CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLKICKING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 1); __PYX_ERR(2, 4218, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 2); __PYX_ERR(2, 4218, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 3); __PYX_ERR(2, 4218, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKING") < 0)) __PYX_ERR(2, 4218, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4218, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4218, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_112CDLKICKING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_112CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLKICKING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4241 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4242 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__532, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4242, __pyx_L1_error) + + /* "talib/_func.pxi":4241 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4243 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4244 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__533, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4244, __pyx_L1_error) + + /* "talib/_func.pxi":4243 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4245 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4246 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4246, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4245 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4247 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4248 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4249 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__534, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4249, __pyx_L1_error) + + /* "talib/_func.pxi":4248 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__535, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4251, __pyx_L1_error) + + /* "talib/_func.pxi":4250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4253 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4253, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4254 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__536, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4256, __pyx_L1_error) + + /* "talib/_func.pxi":4255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__537, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4258, __pyx_L1_error) + + /* "talib/_func.pxi":4257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4260 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4260, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4261 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__538, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4263, __pyx_L1_error) + + /* "talib/_func.pxi":4262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__539, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4265, __pyx_L1_error) + + /* "talib/_func.pxi":4264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4267 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4267, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4268 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4269 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4270 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4271 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__540, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4271, __pyx_L1_error) + + /* "talib/_func.pxi":4270 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4272 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4273 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__541, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4273, __pyx_L1_error) + + /* "talib/_func.pxi":4272 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__542, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4275, __pyx_L1_error) + + /* "talib/_func.pxi":4274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4276 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4277 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4278 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4279 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4280 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4279 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4281 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4282 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4283 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4282 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4284 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4285 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4286 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4285 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4287 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4288 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4289 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4288 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4290 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4291 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4293 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__543, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4293, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4294 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4295 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLKICKING_Lookback()); + + /* "talib/_func.pxi":4296 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4296, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4297 + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4298 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4299 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKING", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4300 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLKICKING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLKICKING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4301 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLKICKING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4302 + * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_115CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_114CDLKICKINGBYLENGTH[] = " CDLKICKINGBYLENGTH(open, high, low, close)\n\n Kicking - bull/bear determined by the longer marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_115CDLKICKINGBYLENGTH = {"CDLKICKINGBYLENGTH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_115CDLKICKINGBYLENGTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_114CDLKICKINGBYLENGTH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_115CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 1); __PYX_ERR(2, 4306, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 2); __PYX_ERR(2, 4306, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 3); __PYX_ERR(2, 4306, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKINGBYLENGTH") < 0)) __PYX_ERR(2, 4306, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4306, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4306, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_114CDLKICKINGBYLENGTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_114CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4329 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4330 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__544, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4330, __pyx_L1_error) + + /* "talib/_func.pxi":4329 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4331 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4332 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__545, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4332, __pyx_L1_error) + + /* "talib/_func.pxi":4331 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4333 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4334 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4334, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4333 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4335 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4336 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4337 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__546, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4337, __pyx_L1_error) + + /* "talib/_func.pxi":4336 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4338 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4339 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__547, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4339, __pyx_L1_error) + + /* "talib/_func.pxi":4338 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4340 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4341 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4341, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4340 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4342 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4343 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4344 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__548, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4344, __pyx_L1_error) + + /* "talib/_func.pxi":4343 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4345 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4346 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__549, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4346, __pyx_L1_error) + + /* "talib/_func.pxi":4345 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4347 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4348 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4348, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4347 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4349 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4350 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4351 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__550, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4351, __pyx_L1_error) + + /* "talib/_func.pxi":4350 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4352 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4353 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__551, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4353, __pyx_L1_error) + + /* "talib/_func.pxi":4352 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4354 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4355 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4355, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4354 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4356 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4357 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4358 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4359 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__552, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4359, __pyx_L1_error) + + /* "talib/_func.pxi":4358 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4360 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4361 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__553, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4361, __pyx_L1_error) + + /* "talib/_func.pxi":4360 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4362 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4363 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__554, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4363, __pyx_L1_error) + + /* "talib/_func.pxi":4362 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4364 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4365 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4366 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4367 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4368 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4367 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4369 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4370 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4371 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4370 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4372 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4373 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4374 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4373 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4375 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4376 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4377 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4376 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4378 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4379 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4381 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__555, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4381, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4382 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4383 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLKICKINGBYLENGTH_Lookback()); + + /* "talib/_func.pxi":4384 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4384, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4385 + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4386 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4387 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4388 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLKICKINGBYLENGTH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4389 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4390 + * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_117CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_116CDLLADDERBOTTOM[] = " CDLLADDERBOTTOM(open, high, low, close)\n\n Ladder Bottom (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_117CDLLADDERBOTTOM = {"CDLLADDERBOTTOM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_117CDLLADDERBOTTOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_116CDLLADDERBOTTOM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_117CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLLADDERBOTTOM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 1); __PYX_ERR(2, 4394, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 2); __PYX_ERR(2, 4394, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 3); __PYX_ERR(2, 4394, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLADDERBOTTOM") < 0)) __PYX_ERR(2, 4394, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4394, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4394, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_116CDLLADDERBOTTOM(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_116CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLLADDERBOTTOM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4417 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4418 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__556, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4418, __pyx_L1_error) + + /* "talib/_func.pxi":4417 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4419 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4420 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__557, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4420, __pyx_L1_error) + + /* "talib/_func.pxi":4419 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4421 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4422 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4422, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4421 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4423 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4424 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4425 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__558, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4425, __pyx_L1_error) + + /* "talib/_func.pxi":4424 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4426 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4427 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__559, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4427, __pyx_L1_error) + + /* "talib/_func.pxi":4426 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4428 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4429 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4429, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4428 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4430 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4431 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4432 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__560, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4432, __pyx_L1_error) + + /* "talib/_func.pxi":4431 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4433 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4434 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__561, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4434, __pyx_L1_error) + + /* "talib/_func.pxi":4433 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4435 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4436 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4436, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4435 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4437 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4438 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4439 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__562, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4439, __pyx_L1_error) + + /* "talib/_func.pxi":4438 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4440 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4441 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__563, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4441, __pyx_L1_error) + + /* "talib/_func.pxi":4440 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4442 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4443 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4443, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4442 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4444 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4445 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4446 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4447 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__564, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4447, __pyx_L1_error) + + /* "talib/_func.pxi":4446 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4448 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4449 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__565, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4449, __pyx_L1_error) + + /* "talib/_func.pxi":4448 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4450 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4451 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__566, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4451, __pyx_L1_error) + + /* "talib/_func.pxi":4450 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4452 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4453 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4454 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4455 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4456 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4455 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4457 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4458 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4459 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4458 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4460 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4461 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4462 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4461 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4463 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4464 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4465 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4464 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4466 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4467 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4469 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__567, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4469, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4470 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4471 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLADDERBOTTOM_Lookback()); + + /* "talib/_func.pxi":4472 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4472, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4473 + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4474 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4475 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4476 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLADDERBOTTOM(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4477 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4478 + * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_119CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_118CDLLONGLEGGEDDOJI[] = " CDLLONGLEGGEDDOJI(open, high, low, close)\n\n Long Legged Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_119CDLLONGLEGGEDDOJI = {"CDLLONGLEGGEDDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_119CDLLONGLEGGEDDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_118CDLLONGLEGGEDDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_119CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 1); __PYX_ERR(2, 4482, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 2); __PYX_ERR(2, 4482, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 3); __PYX_ERR(2, 4482, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLEGGEDDOJI") < 0)) __PYX_ERR(2, 4482, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4482, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4482, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4482, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_118CDLLONGLEGGEDDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_118CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4505 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4506 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__568, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4506, __pyx_L1_error) + + /* "talib/_func.pxi":4505 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4507 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4508 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__569, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4508, __pyx_L1_error) + + /* "talib/_func.pxi":4507 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4509 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4510 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4510, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4509 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4511 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4512 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4513 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__570, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4513, __pyx_L1_error) + + /* "talib/_func.pxi":4512 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4514 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4515 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__571, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4515, __pyx_L1_error) + + /* "talib/_func.pxi":4514 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4516 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4517 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4517, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4516 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4518 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4519 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4520 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__572, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4520, __pyx_L1_error) + + /* "talib/_func.pxi":4519 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4521 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4522 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__573, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4522, __pyx_L1_error) + + /* "talib/_func.pxi":4521 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4523 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4524 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4524, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4523 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4525 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4526 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4527 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__574, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4527, __pyx_L1_error) + + /* "talib/_func.pxi":4526 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4528 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4529 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__575, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4529, __pyx_L1_error) + + /* "talib/_func.pxi":4528 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4530 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4531 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4531, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4530 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4532 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4533 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4534 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4535 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__576, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4535, __pyx_L1_error) + + /* "talib/_func.pxi":4534 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4536 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4537 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__577, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4537, __pyx_L1_error) + + /* "talib/_func.pxi":4536 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4538 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4539 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__578, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4539, __pyx_L1_error) + + /* "talib/_func.pxi":4538 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4540 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4541 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4542 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4543 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4544 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4543 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4545 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4546 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4547 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4546 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4548 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4549 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4550 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4549 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4551 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4552 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4553 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4552 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4554 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4555 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4557 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__579, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4557, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4558 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4559 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLONGLEGGEDDOJI_Lookback()); + + /* "talib/_func.pxi":4560 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4560, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4561 + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4562 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4563 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4564 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLONGLEGGEDDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4565 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4566 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_121CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_120CDLLONGLINE[] = " CDLLONGLINE(open, high, low, close)\n\n Long Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_121CDLLONGLINE = {"CDLLONGLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_121CDLLONGLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_120CDLLONGLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_121CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLLONGLINE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 1); __PYX_ERR(2, 4570, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 2); __PYX_ERR(2, 4570, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 3); __PYX_ERR(2, 4570, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLINE") < 0)) __PYX_ERR(2, 4570, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4570, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4570, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4570, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_120CDLLONGLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_120CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLLONGLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4593 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4594 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__580, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4594, __pyx_L1_error) + + /* "talib/_func.pxi":4593 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__581, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4596, __pyx_L1_error) + + /* "talib/_func.pxi":4595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4598 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4598, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4599 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__582, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4601, __pyx_L1_error) + + /* "talib/_func.pxi":4600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__583, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4603, __pyx_L1_error) + + /* "talib/_func.pxi":4602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4605 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4605, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4606 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__584, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4608, __pyx_L1_error) + + /* "talib/_func.pxi":4607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__585, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4610, __pyx_L1_error) + + /* "talib/_func.pxi":4609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4612 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4612, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4613 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__586, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4615, __pyx_L1_error) + + /* "talib/_func.pxi":4614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__587, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4617, __pyx_L1_error) + + /* "talib/_func.pxi":4616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4619 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4619, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4620 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4621 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__588, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4623, __pyx_L1_error) + + /* "talib/_func.pxi":4622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__589, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4625, __pyx_L1_error) + + /* "talib/_func.pxi":4624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__590, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4627, __pyx_L1_error) + + /* "talib/_func.pxi":4626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4628 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4629 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4630 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4631 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4632 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4631 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4633 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4634 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4635 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4634 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4636 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4637 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4638 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4637 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4639 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4640 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4641 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4640 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4642 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4643 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4645 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__591, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4645, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4646 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4647 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLONGLINE_Lookback()); + + /* "talib/_func.pxi":4648 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4648, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4649 + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4650 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4651 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLINE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4652 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLONGLINE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLONGLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4653 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLINE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLONGLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4654 + * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLLONGLINE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_123CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_122CDLMARUBOZU[] = " CDLMARUBOZU(open, high, low, close)\n\n Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_123CDLMARUBOZU = {"CDLMARUBOZU", (PyCFunction)__pyx_pw_5talib_7_ta_lib_123CDLMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_122CDLMARUBOZU}; +static PyObject *__pyx_pw_5talib_7_ta_lib_123CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLMARUBOZU (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 1); __PYX_ERR(2, 4658, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 2); __PYX_ERR(2, 4658, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 3); __PYX_ERR(2, 4658, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMARUBOZU") < 0)) __PYX_ERR(2, 4658, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4658, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4658, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4658, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_122CDLMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_122CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLMARUBOZU", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4681 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4682 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__592, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4682, __pyx_L1_error) + + /* "talib/_func.pxi":4681 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4683 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4684 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__593, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4684, __pyx_L1_error) + + /* "talib/_func.pxi":4683 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4685 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4686 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4686, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4685 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4687 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4688 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4689 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__594, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4689, __pyx_L1_error) + + /* "talib/_func.pxi":4688 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4690 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4691 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__595, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4691, __pyx_L1_error) + + /* "talib/_func.pxi":4690 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4692 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4693 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4693, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4692 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4694 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4695 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4696 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__596, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4696, __pyx_L1_error) + + /* "talib/_func.pxi":4695 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4697 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4698 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__597, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4698, __pyx_L1_error) + + /* "talib/_func.pxi":4697 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4699 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4700 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4700, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4699 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4701 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4702 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4703 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__598, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4703, __pyx_L1_error) + + /* "talib/_func.pxi":4702 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4704 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4705 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__599, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4705, __pyx_L1_error) + + /* "talib/_func.pxi":4704 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4706 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4707 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4707, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4706 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4708 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4709 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4710 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4711 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__600, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4711, __pyx_L1_error) + + /* "talib/_func.pxi":4710 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4712 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4713 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__601, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4713, __pyx_L1_error) + + /* "talib/_func.pxi":4712 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4714 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4715 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__602, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4715, __pyx_L1_error) + + /* "talib/_func.pxi":4714 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4716 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4717 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4718 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4719 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4720 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4719 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4721 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4722 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4723 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4722 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4724 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4725 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4726 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4725 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4727 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4728 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4729 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4728 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4730 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4731 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4733 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__603, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4733, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4734 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4735 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMARUBOZU_Lookback()); + + /* "talib/_func.pxi":4736 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4736, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4737 + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4738 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4739 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4740 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMARUBOZU", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMARUBOZU(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4741 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4742 + * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_125CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_124CDLMATCHINGLOW[] = " CDLMATCHINGLOW(open, high, low, close)\n\n Matching Low (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_125CDLMATCHINGLOW = {"CDLMATCHINGLOW", (PyCFunction)__pyx_pw_5talib_7_ta_lib_125CDLMATCHINGLOW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_124CDLMATCHINGLOW}; +static PyObject *__pyx_pw_5talib_7_ta_lib_125CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLMATCHINGLOW (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 1); __PYX_ERR(2, 4746, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 2); __PYX_ERR(2, 4746, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 3); __PYX_ERR(2, 4746, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATCHINGLOW") < 0)) __PYX_ERR(2, 4746, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4746, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4746, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4746, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_124CDLMATCHINGLOW(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_124CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLMATCHINGLOW", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4769 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4770 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__604, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4770, __pyx_L1_error) + + /* "talib/_func.pxi":4769 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4771 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4772 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__605, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4772, __pyx_L1_error) + + /* "talib/_func.pxi":4771 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4773 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4774 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4774, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4773 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4775 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4776 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4777 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__606, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4777, __pyx_L1_error) + + /* "talib/_func.pxi":4776 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4778 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4779 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__607, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4779, __pyx_L1_error) + + /* "talib/_func.pxi":4778 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4780 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4781 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4781, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4780 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4782 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4783 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4784 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__608, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4784, __pyx_L1_error) + + /* "talib/_func.pxi":4783 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4785 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4786 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__609, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4786, __pyx_L1_error) + + /* "talib/_func.pxi":4785 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4787 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4788 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4788, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4787 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4789 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4790 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4791 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__610, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4791, __pyx_L1_error) + + /* "talib/_func.pxi":4790 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4792 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4793 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__611, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4793, __pyx_L1_error) + + /* "talib/_func.pxi":4792 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4794 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4795 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4795, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4794 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4796 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4797 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4798 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4799 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__612, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4799, __pyx_L1_error) + + /* "talib/_func.pxi":4798 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4800 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4801 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__613, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4801, __pyx_L1_error) + + /* "talib/_func.pxi":4800 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4802 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4803 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__614, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4803, __pyx_L1_error) + + /* "talib/_func.pxi":4802 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4804 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4805 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4806 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4807 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4808 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4807 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4809 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4810 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4811 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4810 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4812 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4813 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4814 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4813 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4815 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4816 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4817 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4816 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4818 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4819 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4821 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__615, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4821, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4822 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4823 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMATCHINGLOW_Lookback()); + + /* "talib/_func.pxi":4824 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4824, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4825 + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4826 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4827 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4828 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMATCHINGLOW(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4829 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4830 + * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_127CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_126CDLMATHOLD[] = " CDLMATHOLD(open, high, low, close[, penetration=?])\n\n Mat Hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_127CDLMATHOLD = {"CDLMATHOLD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_127CDLMATHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_126CDLMATHOLD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_127CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLMATHOLD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 1); __PYX_ERR(2, 4834, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 2); __PYX_ERR(2, 4834, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 3); __PYX_ERR(2, 4834, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATHOLD") < 0)) __PYX_ERR(2, 4834, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 4834, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.5); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4834, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4834, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_126CDLMATHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_126CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLMATHOLD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4859 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4860 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__616, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4860, __pyx_L1_error) + + /* "talib/_func.pxi":4859 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4861 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4862 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__617, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4862, __pyx_L1_error) + + /* "talib/_func.pxi":4861 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4863 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4864 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4864, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4863 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4865 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4866 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4867 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__618, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4867, __pyx_L1_error) + + /* "talib/_func.pxi":4866 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4868 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4869 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__619, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4869, __pyx_L1_error) + + /* "talib/_func.pxi":4868 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4870 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4871 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4871, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4870 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4872 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4873 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4874 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__620, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4874, __pyx_L1_error) + + /* "talib/_func.pxi":4873 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4875 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4876 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__621, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4876, __pyx_L1_error) + + /* "talib/_func.pxi":4875 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4877 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4878 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4878, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4877 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4879 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4880 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4881 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__622, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4881, __pyx_L1_error) + + /* "talib/_func.pxi":4880 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4882 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4883 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__623, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4883, __pyx_L1_error) + + /* "talib/_func.pxi":4882 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4884 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4885 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4885, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4884 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4886 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4887 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4888 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4889 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__624, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4889, __pyx_L1_error) + + /* "talib/_func.pxi":4888 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4890 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4891 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__625, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4891, __pyx_L1_error) + + /* "talib/_func.pxi":4890 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4892 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4893 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__626, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4893, __pyx_L1_error) + + /* "talib/_func.pxi":4892 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4894 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4895 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4896 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4897 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4898 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4897 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4899 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4900 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4901 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4900 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4902 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4903 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4904 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4903 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4905 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4906 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4907 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4906 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4908 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4909 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":4911 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__627, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4911, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":4912 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":4913 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMATHOLD_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":4914 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4914, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4915 + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":4916 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4917 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATHOLD", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":4918 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMATHOLD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMATHOLD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":4919 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATHOLD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMATHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":4920 + * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMATHOLD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":4924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_129CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_128CDLMORNINGDOJISTAR[] = " CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Morning Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_129CDLMORNINGDOJISTAR = {"CDLMORNINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_129CDLMORNINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_128CDLMORNINGDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_129CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(2, 4924, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(2, 4924, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(2, 4924, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGDOJISTAR") < 0)) __PYX_ERR(2, 4924, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 4924, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4924, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 4924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 4924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 4924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 4924, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_128CDLMORNINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_128CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":4949 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4950 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__628, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4950, __pyx_L1_error) + + /* "talib/_func.pxi":4949 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":4951 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4952 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__629, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4952, __pyx_L1_error) + + /* "talib/_func.pxi":4951 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4953 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4954 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4954, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4953 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":4955 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":4956 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4957 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__630, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4957, __pyx_L1_error) + + /* "talib/_func.pxi":4956 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":4958 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4959 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__631, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4959, __pyx_L1_error) + + /* "talib/_func.pxi":4958 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4960 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4961 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4961, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4960 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":4962 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":4963 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4964 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__632, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4964, __pyx_L1_error) + + /* "talib/_func.pxi":4963 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":4965 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4966 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__633, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4966, __pyx_L1_error) + + /* "talib/_func.pxi":4965 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4967 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4968 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4968, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4967 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":4969 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":4970 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4971 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__634, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4971, __pyx_L1_error) + + /* "talib/_func.pxi":4970 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":4972 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4973 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__635, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4973, __pyx_L1_error) + + /* "talib/_func.pxi":4972 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":4974 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4975 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 4975, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":4974 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":4976 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":4977 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":4978 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4979 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__636, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4979, __pyx_L1_error) + + /* "talib/_func.pxi":4978 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":4980 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4981 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__637, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4981, __pyx_L1_error) + + /* "talib/_func.pxi":4980 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":4982 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4983 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__638, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 4983, __pyx_L1_error) + + /* "talib/_func.pxi":4982 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":4984 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":4985 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":4986 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":4987 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4988 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4987 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":4989 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":4990 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4991 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4990 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":4992 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":4993 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4994 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4993 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":4995 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":4996 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":4997 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":4996 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":4998 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":4999 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5001 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__639, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5001, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5002 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5003 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMORNINGDOJISTAR_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":5004 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5004, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5005 + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5006 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5007 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5008 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMORNINGDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5009 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5010 + * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":4924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5014 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_131CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_130CDLMORNINGSTAR[] = " CDLMORNINGSTAR(open, high, low, close[, penetration=?])\n\n Morning Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_131CDLMORNINGSTAR = {"CDLMORNINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_131CDLMORNINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_130CDLMORNINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_131CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLMORNINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 1); __PYX_ERR(2, 5014, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 2); __PYX_ERR(2, 5014, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 3); __PYX_ERR(2, 5014, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGSTAR") < 0)) __PYX_ERR(2, 5014, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 5014, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5014, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5014, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5014, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5014, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5014, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_130CDLMORNINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_130CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLMORNINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5039 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5040 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__640, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5040, __pyx_L1_error) + + /* "talib/_func.pxi":5039 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5041 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5042 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__641, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5042, __pyx_L1_error) + + /* "talib/_func.pxi":5041 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5043 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5044 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5044, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5043 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5045 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5046 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5047 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__642, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5047, __pyx_L1_error) + + /* "talib/_func.pxi":5046 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5048 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5049 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__643, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5049, __pyx_L1_error) + + /* "talib/_func.pxi":5048 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5050 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5051 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5051, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5050 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5052 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5053 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5054 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__644, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5054, __pyx_L1_error) + + /* "talib/_func.pxi":5053 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5055 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5056 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__645, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5056, __pyx_L1_error) + + /* "talib/_func.pxi":5055 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5057 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5058 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5058, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5057 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5059 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5060 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5061 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__646, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5061, __pyx_L1_error) + + /* "talib/_func.pxi":5060 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5062 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5063 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__647, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5063, __pyx_L1_error) + + /* "talib/_func.pxi":5062 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5064 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5065 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5065, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5064 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5066 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5067 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5068 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5069 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__648, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5069, __pyx_L1_error) + + /* "talib/_func.pxi":5068 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5070 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5071 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__649, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5071, __pyx_L1_error) + + /* "talib/_func.pxi":5070 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5072 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5073 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__650, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5073, __pyx_L1_error) + + /* "talib/_func.pxi":5072 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5074 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5075 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5076 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5077 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5078 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5077 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5079 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5080 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5081 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5080 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5082 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5083 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5084 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5083 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5085 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5086 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5087 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5086 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5088 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5089 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5091 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__651, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5091, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5092 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5093 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMORNINGSTAR_Lookback(__pyx_v_penetration)); + + /* "talib/_func.pxi":5094 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5094, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5095 + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5096 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5097 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5098 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMORNINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5099 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5100 + * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5014 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5104 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_133CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_132CDLONNECK[] = " CDLONNECK(open, high, low, close)\n\n On-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_133CDLONNECK = {"CDLONNECK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_133CDLONNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_132CDLONNECK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_133CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLONNECK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 1); __PYX_ERR(2, 5104, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 2); __PYX_ERR(2, 5104, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 3); __PYX_ERR(2, 5104, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLONNECK") < 0)) __PYX_ERR(2, 5104, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5104, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5104, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_132CDLONNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_132CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLONNECK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5127 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5128 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__652, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5128, __pyx_L1_error) + + /* "talib/_func.pxi":5127 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5129 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5130 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__653, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5130, __pyx_L1_error) + + /* "talib/_func.pxi":5129 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5131 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5132 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5132, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5131 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5133 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5134 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5135 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__654, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5135, __pyx_L1_error) + + /* "talib/_func.pxi":5134 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5136 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5137 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__655, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5137, __pyx_L1_error) + + /* "talib/_func.pxi":5136 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5138 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5139 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5139, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5138 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5140 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5141 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5142 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__656, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5142, __pyx_L1_error) + + /* "talib/_func.pxi":5141 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5143 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5144 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__657, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5144, __pyx_L1_error) + + /* "talib/_func.pxi":5143 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5145 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5146 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5146, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5145 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5147 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5148 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5149 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__658, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5149, __pyx_L1_error) + + /* "talib/_func.pxi":5148 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5150 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5151 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__659, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5151, __pyx_L1_error) + + /* "talib/_func.pxi":5150 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5152 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5153 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5153, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5152 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5154 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5155 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5156 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5157 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__660, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5157, __pyx_L1_error) + + /* "talib/_func.pxi":5156 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5158 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5159 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__661, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5159, __pyx_L1_error) + + /* "talib/_func.pxi":5158 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5160 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5161 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__662, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5161, __pyx_L1_error) + + /* "talib/_func.pxi":5160 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5162 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5163 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5164 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5165 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5166 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5165 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5167 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5168 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5169 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5168 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5170 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5171 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5172 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5171 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5173 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5174 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5175 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5174 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5176 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5177 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5179 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__663, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5179, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5180 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5181 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLONNECK_Lookback()); + + /* "talib/_func.pxi":5182 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5182, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5183 + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5184 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5185 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLONNECK", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5186 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLONNECK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLONNECK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5187 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLONNECK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLONNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5188 + * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLONNECK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5104 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5192 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_135CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_134CDLPIERCING[] = " CDLPIERCING(open, high, low, close)\n\n Piercing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_135CDLPIERCING = {"CDLPIERCING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_135CDLPIERCING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_134CDLPIERCING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_135CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLPIERCING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 1); __PYX_ERR(2, 5192, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 2); __PYX_ERR(2, 5192, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 3); __PYX_ERR(2, 5192, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLPIERCING") < 0)) __PYX_ERR(2, 5192, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5192, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5192, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5192, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5192, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5192, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_134CDLPIERCING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_134CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLPIERCING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5215 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5216 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__664, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5216, __pyx_L1_error) + + /* "talib/_func.pxi":5215 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5217 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5218 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__665, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5218, __pyx_L1_error) + + /* "talib/_func.pxi":5217 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5219 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5220 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5220, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5219 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5221 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5222 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5223 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__666, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5223, __pyx_L1_error) + + /* "talib/_func.pxi":5222 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5224 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5225 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__667, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5225, __pyx_L1_error) + + /* "talib/_func.pxi":5224 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5226 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5227 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5227, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5226 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5228 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5229 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5230 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__668, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5230, __pyx_L1_error) + + /* "talib/_func.pxi":5229 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5231 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5232 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__669, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5232, __pyx_L1_error) + + /* "talib/_func.pxi":5231 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5233 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5234 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5234, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5233 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5235 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5236 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5237 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__670, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5237, __pyx_L1_error) + + /* "talib/_func.pxi":5236 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5238 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5239 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__671, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5239, __pyx_L1_error) + + /* "talib/_func.pxi":5238 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5240 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5241 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5241, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5240 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5242 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5243 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5244 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5245 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__672, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5245, __pyx_L1_error) + + /* "talib/_func.pxi":5244 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5246 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5247 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__673, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5247, __pyx_L1_error) + + /* "talib/_func.pxi":5246 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5248 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5249 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__674, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5249, __pyx_L1_error) + + /* "talib/_func.pxi":5248 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5250 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5251 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5252 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5253 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5254 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5253 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5255 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5256 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5257 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5256 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5258 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5259 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5260 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5259 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5261 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5262 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5263 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5262 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5264 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5265 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5267 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__675, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5267, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5268 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5269 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLPIERCING_Lookback()); + + /* "talib/_func.pxi":5270 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5270, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5271 + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5272 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5273 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLPIERCING", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5274 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLPIERCING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLPIERCING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5275 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLPIERCING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLPIERCING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5276 + * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLPIERCING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5192 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5280 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_137CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_136CDLRICKSHAWMAN[] = " CDLRICKSHAWMAN(open, high, low, close)\n\n Rickshaw Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_137CDLRICKSHAWMAN = {"CDLRICKSHAWMAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_137CDLRICKSHAWMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_136CDLRICKSHAWMAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_137CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLRICKSHAWMAN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 1); __PYX_ERR(2, 5280, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 2); __PYX_ERR(2, 5280, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 3); __PYX_ERR(2, 5280, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRICKSHAWMAN") < 0)) __PYX_ERR(2, 5280, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5280, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5280, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_136CDLRICKSHAWMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_136CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLRICKSHAWMAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5303 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5304 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__676, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5304, __pyx_L1_error) + + /* "talib/_func.pxi":5303 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5305 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5306 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__677, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5306, __pyx_L1_error) + + /* "talib/_func.pxi":5305 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5307 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5308 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5308, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5307 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5309 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5310 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5311 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__678, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5311, __pyx_L1_error) + + /* "talib/_func.pxi":5310 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5312 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5313 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__679, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5313, __pyx_L1_error) + + /* "talib/_func.pxi":5312 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5314 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5315 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5315, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5314 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5316 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5317 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5318 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__680, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5318, __pyx_L1_error) + + /* "talib/_func.pxi":5317 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5319 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5320 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__681, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5320, __pyx_L1_error) + + /* "talib/_func.pxi":5319 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5321 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5322 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5322, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5321 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5323 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5324 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5325 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__682, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5325, __pyx_L1_error) + + /* "talib/_func.pxi":5324 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5326 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5327 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__683, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5327, __pyx_L1_error) + + /* "talib/_func.pxi":5326 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5328 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5329 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5329, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5328 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5330 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5331 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5332 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5333 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__684, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5333, __pyx_L1_error) + + /* "talib/_func.pxi":5332 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5334 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5335 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__685, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5335, __pyx_L1_error) + + /* "talib/_func.pxi":5334 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5336 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5337 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__686, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5337, __pyx_L1_error) + + /* "talib/_func.pxi":5336 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5338 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5339 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5340 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5341 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5342 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5341 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5343 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5344 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5345 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5344 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5346 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5347 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5348 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5347 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5349 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5350 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5351 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5350 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5352 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5353 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5355 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__687, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5355, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5356 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5357 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLRICKSHAWMAN_Lookback()); + + /* "talib/_func.pxi":5358 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5358, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5359 + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5360 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5361 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5362 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLRICKSHAWMAN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5363 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5364 + * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5280 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5368 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_139CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_138CDLRISEFALL3METHODS[] = " CDLRISEFALL3METHODS(open, high, low, close)\n\n Rising/Falling Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_139CDLRISEFALL3METHODS = {"CDLRISEFALL3METHODS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_139CDLRISEFALL3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_138CDLRISEFALL3METHODS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_139CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 1); __PYX_ERR(2, 5368, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 2); __PYX_ERR(2, 5368, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 3); __PYX_ERR(2, 5368, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRISEFALL3METHODS") < 0)) __PYX_ERR(2, 5368, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5368, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5368, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_138CDLRISEFALL3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_138CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5391 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5392 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__688, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5392, __pyx_L1_error) + + /* "talib/_func.pxi":5391 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5393 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5394 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__689, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5394, __pyx_L1_error) + + /* "talib/_func.pxi":5393 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5395 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5396 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5396, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5395 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5397 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5398 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5399 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__690, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5399, __pyx_L1_error) + + /* "talib/_func.pxi":5398 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5400 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5401 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__691, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5401, __pyx_L1_error) + + /* "talib/_func.pxi":5400 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5402 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5403 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5403, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5402 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5404 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5405 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5406 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__692, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5406, __pyx_L1_error) + + /* "talib/_func.pxi":5405 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5407 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5408 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__693, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5408, __pyx_L1_error) + + /* "talib/_func.pxi":5407 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5409 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5410 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5410, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5409 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5411 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5412 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5413 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__694, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5413, __pyx_L1_error) + + /* "talib/_func.pxi":5412 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5414 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5415 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__695, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5415, __pyx_L1_error) + + /* "talib/_func.pxi":5414 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5416 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5417 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5417, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5416 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5418 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5419 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5420 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5421 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__696, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5421, __pyx_L1_error) + + /* "talib/_func.pxi":5420 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5422 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5423 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__697, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5423, __pyx_L1_error) + + /* "talib/_func.pxi":5422 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5424 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5425 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__698, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5425, __pyx_L1_error) + + /* "talib/_func.pxi":5424 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5426 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5427 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5428 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5429 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5430 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5429 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5431 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5432 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5433 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5432 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5434 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5435 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5436 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5435 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5437 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5438 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5439 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5438 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5440 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5441 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5443 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__699, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5443, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5444 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5445 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLRISEFALL3METHODS_Lookback()); + + /* "talib/_func.pxi":5446 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5446, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5447 + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5448 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5449 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5450 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLRISEFALL3METHODS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5451 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5452 + * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5368 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5456 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_141CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_140CDLSEPARATINGLINES[] = " CDLSEPARATINGLINES(open, high, low, close)\n\n Separating Lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_141CDLSEPARATINGLINES = {"CDLSEPARATINGLINES", (PyCFunction)__pyx_pw_5talib_7_ta_lib_141CDLSEPARATINGLINES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_140CDLSEPARATINGLINES}; +static PyObject *__pyx_pw_5talib_7_ta_lib_141CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSEPARATINGLINES (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 1); __PYX_ERR(2, 5456, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 2); __PYX_ERR(2, 5456, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 3); __PYX_ERR(2, 5456, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSEPARATINGLINES") < 0)) __PYX_ERR(2, 5456, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5456, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5456, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5456, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5456, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5456, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_140CDLSEPARATINGLINES(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_140CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSEPARATINGLINES", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5479 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5480 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__700, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5480, __pyx_L1_error) + + /* "talib/_func.pxi":5479 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5481 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5482 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__701, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5482, __pyx_L1_error) + + /* "talib/_func.pxi":5481 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5483 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5484 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5484, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5483 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5485 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5486 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5487 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__702, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5487, __pyx_L1_error) + + /* "talib/_func.pxi":5486 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5488 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5489 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__703, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5489, __pyx_L1_error) + + /* "talib/_func.pxi":5488 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5490 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5491 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5491, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5490 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5492 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5493 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5494 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__704, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5494, __pyx_L1_error) + + /* "talib/_func.pxi":5493 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5495 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5496 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__705, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5496, __pyx_L1_error) + + /* "talib/_func.pxi":5495 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5497 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5498 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5498, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5497 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5499 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5500 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5501 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__706, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5501, __pyx_L1_error) + + /* "talib/_func.pxi":5500 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5502 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5503 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__707, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5503, __pyx_L1_error) + + /* "talib/_func.pxi":5502 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5504 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5505 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5505, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5504 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5506 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5507 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5508 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5509 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__708, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5509, __pyx_L1_error) + + /* "talib/_func.pxi":5508 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5510 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5511 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__709, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5511, __pyx_L1_error) + + /* "talib/_func.pxi":5510 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5512 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5513 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__710, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5513, __pyx_L1_error) + + /* "talib/_func.pxi":5512 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5514 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5515 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5516 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5517 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5518 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5517 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5519 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5520 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5521 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5520 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5522 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5523 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5524 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5523 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5525 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5526 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5527 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5526 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5528 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5529 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5531 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__711, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5531, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5532 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5533 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSEPARATINGLINES_Lookback()); + + /* "talib/_func.pxi":5534 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5534, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5535 + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5536 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5537 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5538 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSEPARATINGLINES(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5539 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5540 + * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5456 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5544 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_143CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_142CDLSHOOTINGSTAR[] = " CDLSHOOTINGSTAR(open, high, low, close)\n\n Shooting Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_143CDLSHOOTINGSTAR = {"CDLSHOOTINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_143CDLSHOOTINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_142CDLSHOOTINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_143CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 1); __PYX_ERR(2, 5544, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 2); __PYX_ERR(2, 5544, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 3); __PYX_ERR(2, 5544, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHOOTINGSTAR") < 0)) __PYX_ERR(2, 5544, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5544, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5544, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5544, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5544, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5544, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_142CDLSHOOTINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_142CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5567 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5568 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__712, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5568, __pyx_L1_error) + + /* "talib/_func.pxi":5567 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5569 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5570 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__713, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5570, __pyx_L1_error) + + /* "talib/_func.pxi":5569 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5571 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5572 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5572, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5571 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5573 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5574 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5575 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__714, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5575, __pyx_L1_error) + + /* "talib/_func.pxi":5574 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5576 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5577 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__715, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5577, __pyx_L1_error) + + /* "talib/_func.pxi":5576 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5578 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5579 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5579, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5578 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5580 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5581 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5582 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5582, __pyx_L1_error) + + /* "talib/_func.pxi":5581 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5583 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5584 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5584, __pyx_L1_error) + + /* "talib/_func.pxi":5583 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5585 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5586 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5586, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5585 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5587 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5588 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5589 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5589, __pyx_L1_error) + + /* "talib/_func.pxi":5588 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5590 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5591 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5591, __pyx_L1_error) + + /* "talib/_func.pxi":5590 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5592 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5593 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5593, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5592 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5594 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5595 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5596 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5597 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5597, __pyx_L1_error) + + /* "talib/_func.pxi":5596 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5598 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5599 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__721, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5599, __pyx_L1_error) + + /* "talib/_func.pxi":5598 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5600 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5601 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__722, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5601, __pyx_L1_error) + + /* "talib/_func.pxi":5600 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5602 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5603 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5604 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5605 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5606 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5605 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5607 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5608 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5609 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5608 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5610 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5611 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5612 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5611 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5613 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5614 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5615 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5614 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5616 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5617 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5619 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__723, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5619, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5620 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5621 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSHOOTINGSTAR_Lookback()); + + /* "talib/_func.pxi":5622 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5622, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5623 + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5624 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5625 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5626 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSHOOTINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5627 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5628 + * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5544 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5632 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_145CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_144CDLSHORTLINE[] = " CDLSHORTLINE(open, high, low, close)\n\n Short Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_145CDLSHORTLINE = {"CDLSHORTLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_145CDLSHORTLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_144CDLSHORTLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_145CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSHORTLINE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 1); __PYX_ERR(2, 5632, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 2); __PYX_ERR(2, 5632, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 3); __PYX_ERR(2, 5632, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHORTLINE") < 0)) __PYX_ERR(2, 5632, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5632, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5632, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_144CDLSHORTLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_144CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSHORTLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5655 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5656 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__724, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5656, __pyx_L1_error) + + /* "talib/_func.pxi":5655 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5657 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5658 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__725, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5658, __pyx_L1_error) + + /* "talib/_func.pxi":5657 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5659 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5660 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5660, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5659 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5661 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5662 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5663 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__726, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5663, __pyx_L1_error) + + /* "talib/_func.pxi":5662 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5664 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5665 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__727, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5665, __pyx_L1_error) + + /* "talib/_func.pxi":5664 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5666 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5667 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5667, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5666 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5668 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5669 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5670 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__728, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5670, __pyx_L1_error) + + /* "talib/_func.pxi":5669 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5671 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5672 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__729, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5672, __pyx_L1_error) + + /* "talib/_func.pxi":5671 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5673 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5674 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5674, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5673 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5675 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5676 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5677 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__730, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5677, __pyx_L1_error) + + /* "talib/_func.pxi":5676 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5678 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5679 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__731, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5679, __pyx_L1_error) + + /* "talib/_func.pxi":5678 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5680 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5681 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5681, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5680 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5682 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5683 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5684 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5685 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__732, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5685, __pyx_L1_error) + + /* "talib/_func.pxi":5684 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5686 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5687 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__733, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5687, __pyx_L1_error) + + /* "talib/_func.pxi":5686 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5688 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5689 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__734, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5689, __pyx_L1_error) + + /* "talib/_func.pxi":5688 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5690 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5691 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5692 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5693 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5694 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5693 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5695 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5696 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5697 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5696 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5698 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5699 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5700 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5699 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5701 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5702 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5703 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5702 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5704 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5705 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5707 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__735, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5707, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5708 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5709 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSHORTLINE_Lookback()); + + /* "talib/_func.pxi":5710 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5710, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5711 + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5712 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5713 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5714 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSHORTLINE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSHORTLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5715 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSHORTLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5716 + * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5632 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5720 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_147CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_146CDLSPINNINGTOP[] = " CDLSPINNINGTOP(open, high, low, close)\n\n Spinning Top (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_147CDLSPINNINGTOP = {"CDLSPINNINGTOP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_147CDLSPINNINGTOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_146CDLSPINNINGTOP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_147CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSPINNINGTOP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 1); __PYX_ERR(2, 5720, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 2); __PYX_ERR(2, 5720, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 3); __PYX_ERR(2, 5720, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSPINNINGTOP") < 0)) __PYX_ERR(2, 5720, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5720, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5720, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5720, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5720, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5720, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_146CDLSPINNINGTOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_146CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSPINNINGTOP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5743 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5744 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__736, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5744, __pyx_L1_error) + + /* "talib/_func.pxi":5743 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5745 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5746 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__737, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5746, __pyx_L1_error) + + /* "talib/_func.pxi":5745 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5747 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5748 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5748, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5747 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5749 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5750 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5751 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__738, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5751, __pyx_L1_error) + + /* "talib/_func.pxi":5750 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5752 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5753 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__739, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5753, __pyx_L1_error) + + /* "talib/_func.pxi":5752 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5754 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5755 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5755, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5754 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5756 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5757 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5758 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__740, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5758, __pyx_L1_error) + + /* "talib/_func.pxi":5757 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5759 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5760 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__741, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5760, __pyx_L1_error) + + /* "talib/_func.pxi":5759 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5761 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5762 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5762, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5761 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5763 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5764 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5765 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__742, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5765, __pyx_L1_error) + + /* "talib/_func.pxi":5764 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5766 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5767 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__743, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5767, __pyx_L1_error) + + /* "talib/_func.pxi":5766 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5768 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5769 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5769, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5768 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5770 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5771 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5772 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5773 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__744, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5773, __pyx_L1_error) + + /* "talib/_func.pxi":5772 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5774 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5775 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__745, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5775, __pyx_L1_error) + + /* "talib/_func.pxi":5774 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5776 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5777 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__746, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5777, __pyx_L1_error) + + /* "talib/_func.pxi":5776 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5778 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5779 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5780 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5781 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5782 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5781 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5783 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5784 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5785 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5784 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5786 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5787 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5788 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5787 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5789 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5790 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5791 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5790 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5792 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5793 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5795 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__747, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5795, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5796 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5797 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSPINNINGTOP_Lookback()); + + /* "talib/_func.pxi":5798 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5798, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5799 + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5800 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5801 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5802 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSPINNINGTOP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5803 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5804 + * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5720 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5808 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_149CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_148CDLSTALLEDPATTERN[] = " CDLSTALLEDPATTERN(open, high, low, close)\n\n Stalled Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_149CDLSTALLEDPATTERN = {"CDLSTALLEDPATTERN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_149CDLSTALLEDPATTERN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_148CDLSTALLEDPATTERN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_149CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 1); __PYX_ERR(2, 5808, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 2); __PYX_ERR(2, 5808, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 3); __PYX_ERR(2, 5808, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTALLEDPATTERN") < 0)) __PYX_ERR(2, 5808, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5808, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5808, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5808, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5808, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5808, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_148CDLSTALLEDPATTERN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_148CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5831 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5832 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__748, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5832, __pyx_L1_error) + + /* "talib/_func.pxi":5831 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5833 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5834 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__749, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5834, __pyx_L1_error) + + /* "talib/_func.pxi":5833 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5835 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5836 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5836, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5835 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5837 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5838 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5839 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__750, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5839, __pyx_L1_error) + + /* "talib/_func.pxi":5838 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5840 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5841 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__751, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5841, __pyx_L1_error) + + /* "talib/_func.pxi":5840 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5842 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5843 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5843, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5842 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5844 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5845 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5846 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__752, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5846, __pyx_L1_error) + + /* "talib/_func.pxi":5845 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5847 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5848 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__753, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5848, __pyx_L1_error) + + /* "talib/_func.pxi":5847 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5849 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5850 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5850, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5849 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5851 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5852 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5853 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__754, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5853, __pyx_L1_error) + + /* "talib/_func.pxi":5852 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5854 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5855 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__755, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5855, __pyx_L1_error) + + /* "talib/_func.pxi":5854 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5856 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5857 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5857, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5856 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5858 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5859 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5860 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5861 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__756, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5861, __pyx_L1_error) + + /* "talib/_func.pxi":5860 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5862 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5863 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__757, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5863, __pyx_L1_error) + + /* "talib/_func.pxi":5862 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5864 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5865 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__758, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5865, __pyx_L1_error) + + /* "talib/_func.pxi":5864 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5866 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5867 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5868 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5869 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5870 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5869 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5871 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5872 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5873 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5872 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5874 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5875 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5876 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5875 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5877 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5878 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5879 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5878 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5880 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5881 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5883 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__759, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5883, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5884 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5885 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSTALLEDPATTERN_Lookback()); + + /* "talib/_func.pxi":5886 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5886, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5887 + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5888 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5889 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5890 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSTALLEDPATTERN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5891 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5892 + * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5808 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5896 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_151CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_150CDLSTICKSANDWICH[] = " CDLSTICKSANDWICH(open, high, low, close)\n\n Stick Sandwich (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_151CDLSTICKSANDWICH = {"CDLSTICKSANDWICH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_151CDLSTICKSANDWICH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_150CDLSTICKSANDWICH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_151CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLSTICKSANDWICH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 1); __PYX_ERR(2, 5896, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 2); __PYX_ERR(2, 5896, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 3); __PYX_ERR(2, 5896, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTICKSANDWICH") < 0)) __PYX_ERR(2, 5896, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5896, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5896, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_150CDLSTICKSANDWICH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_150CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLSTICKSANDWICH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":5919 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5920 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__760, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5920, __pyx_L1_error) + + /* "talib/_func.pxi":5919 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":5921 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5922 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__761, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5922, __pyx_L1_error) + + /* "talib/_func.pxi":5921 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5923 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5924 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5924, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5923 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":5925 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":5926 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5927 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__762, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5927, __pyx_L1_error) + + /* "talib/_func.pxi":5926 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":5928 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5929 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__763, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5929, __pyx_L1_error) + + /* "talib/_func.pxi":5928 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5930 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5931 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5931, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5930 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":5932 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":5933 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5934 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__764, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5934, __pyx_L1_error) + + /* "talib/_func.pxi":5933 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":5935 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5936 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__765, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5936, __pyx_L1_error) + + /* "talib/_func.pxi":5935 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5937 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5938 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5938, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5937 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":5939 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":5940 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5941 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__766, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5941, __pyx_L1_error) + + /* "talib/_func.pxi":5940 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":5942 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5943 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__767, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5943, __pyx_L1_error) + + /* "talib/_func.pxi":5942 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":5944 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5945 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5945, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5944 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":5946 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":5947 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":5948 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5949 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__768, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5949, __pyx_L1_error) + + /* "talib/_func.pxi":5948 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":5950 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5951 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__769, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5951, __pyx_L1_error) + + /* "talib/_func.pxi":5950 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":5952 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5953 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__770, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5953, __pyx_L1_error) + + /* "talib/_func.pxi":5952 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":5954 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":5955 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5956 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":5957 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5958 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5957 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":5959 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":5960 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5961 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5960 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":5962 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":5963 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5964 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5963 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":5965 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":5966 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":5967 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":5966 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":5968 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":5969 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":5971 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__771, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 5971, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":5972 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":5973 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSTICKSANDWICH_Lookback()); + + /* "talib/_func.pxi":5974 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 5974, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":5975 + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":5976 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":5977 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":5978 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSTICKSANDWICH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":5979 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":5980 + * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5896 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":5984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_153CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_152CDLTAKURI[] = " CDLTAKURI(open, high, low, close)\n\n Takuri (Dragonfly Doji with very long lower shadow) (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_153CDLTAKURI = {"CDLTAKURI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_153CDLTAKURI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_152CDLTAKURI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_153CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLTAKURI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 1); __PYX_ERR(2, 5984, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 2); __PYX_ERR(2, 5984, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 3); __PYX_ERR(2, 5984, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTAKURI") < 0)) __PYX_ERR(2, 5984, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 5984, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 5984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 5984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 5984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 5984, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_152CDLTAKURI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_152CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLTAKURI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6007 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6008 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__772, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6008, __pyx_L1_error) + + /* "talib/_func.pxi":6007 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6009 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6010 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__773, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6010, __pyx_L1_error) + + /* "talib/_func.pxi":6009 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6011 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6012 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6012, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6011 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6013 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6014 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6015 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__774, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6015, __pyx_L1_error) + + /* "talib/_func.pxi":6014 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6016 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6017 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__775, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6017, __pyx_L1_error) + + /* "talib/_func.pxi":6016 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6018 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6019 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6019, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6018 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6020 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6021 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6022 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__776, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6022, __pyx_L1_error) + + /* "talib/_func.pxi":6021 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6023 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6024 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__777, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6024, __pyx_L1_error) + + /* "talib/_func.pxi":6023 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6025 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6026 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6026, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6025 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6027 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6028 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6029 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__778, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6029, __pyx_L1_error) + + /* "talib/_func.pxi":6028 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6030 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6031 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__779, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6031, __pyx_L1_error) + + /* "talib/_func.pxi":6030 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6032 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6033 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6033, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6032 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6034 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6035 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6036 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6037 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__780, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6037, __pyx_L1_error) + + /* "talib/_func.pxi":6036 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6038 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6039 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__781, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6039, __pyx_L1_error) + + /* "talib/_func.pxi":6038 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6040 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6041 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__782, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6041, __pyx_L1_error) + + /* "talib/_func.pxi":6040 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6042 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6043 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6044 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6045 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6046 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6045 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6047 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6048 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6049 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6048 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6050 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6051 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6052 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6051 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6053 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6054 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6055 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6054 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6056 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6057 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6059 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__783, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6059, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6060 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6061 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTAKURI_Lookback()); + + /* "talib/_func.pxi":6062 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6062, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6062, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6063 + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6064 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6065 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTAKURI", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6066 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTAKURI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTAKURI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6067 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTAKURI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTAKURI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6068 + * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTAKURI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":5984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6072 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_155CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_154CDLTASUKIGAP[] = " CDLTASUKIGAP(open, high, low, close)\n\n Tasuki Gap (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_155CDLTASUKIGAP = {"CDLTASUKIGAP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_155CDLTASUKIGAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_154CDLTASUKIGAP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_155CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLTASUKIGAP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 1); __PYX_ERR(2, 6072, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 2); __PYX_ERR(2, 6072, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 3); __PYX_ERR(2, 6072, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTASUKIGAP") < 0)) __PYX_ERR(2, 6072, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6072, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6072, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6072, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6072, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6072, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_154CDLTASUKIGAP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_154CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLTASUKIGAP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6095 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6096 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__784, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6096, __pyx_L1_error) + + /* "talib/_func.pxi":6095 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6097 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6098 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__785, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6098, __pyx_L1_error) + + /* "talib/_func.pxi":6097 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6099 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6100 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6100, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6099 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6101 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6102 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6103 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__786, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6103, __pyx_L1_error) + + /* "talib/_func.pxi":6102 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6104 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6105 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__787, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6105, __pyx_L1_error) + + /* "talib/_func.pxi":6104 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6106 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6107 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6107, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6106 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6108 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6109 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6110 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__788, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6110, __pyx_L1_error) + + /* "talib/_func.pxi":6109 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6111 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6112 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__789, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6112, __pyx_L1_error) + + /* "talib/_func.pxi":6111 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6113 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6114 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6114, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6113 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6115 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6116 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6117 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__790, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6117, __pyx_L1_error) + + /* "talib/_func.pxi":6116 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6118 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6119 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__791, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6119, __pyx_L1_error) + + /* "talib/_func.pxi":6118 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6120 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6121 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6121, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6120 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6122 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6123 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6124 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6125 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__792, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6125, __pyx_L1_error) + + /* "talib/_func.pxi":6124 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6126 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6127 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__793, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6127, __pyx_L1_error) + + /* "talib/_func.pxi":6126 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6128 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6129 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__794, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6129, __pyx_L1_error) + + /* "talib/_func.pxi":6128 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6130 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6131 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6132 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6133 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6134 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6133 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6135 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6136 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6137 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6136 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6138 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6139 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6140 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6139 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6141 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6142 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6143 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6142 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6144 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6145 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6147 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__795, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6147, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6148 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6149 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTASUKIGAP_Lookback()); + + /* "talib/_func.pxi":6150 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6150, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6151 + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6152 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6153 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6154 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTASUKIGAP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6155 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTASUKIGAP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6156 + * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6072 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6160 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_157CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_156CDLTHRUSTING[] = " CDLTHRUSTING(open, high, low, close)\n\n Thrusting Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_157CDLTHRUSTING = {"CDLTHRUSTING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_157CDLTHRUSTING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_156CDLTHRUSTING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_157CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLTHRUSTING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 1); __PYX_ERR(2, 6160, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 2); __PYX_ERR(2, 6160, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 3); __PYX_ERR(2, 6160, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTHRUSTING") < 0)) __PYX_ERR(2, 6160, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6160, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6160, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_156CDLTHRUSTING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_156CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLTHRUSTING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6183 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6184 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__796, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6184, __pyx_L1_error) + + /* "talib/_func.pxi":6183 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6185 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6186 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__797, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6186, __pyx_L1_error) + + /* "talib/_func.pxi":6185 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6187 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6188 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6188, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6187 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6189 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6190 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6191 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__798, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6191, __pyx_L1_error) + + /* "talib/_func.pxi":6190 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6192 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6193 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__799, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6193, __pyx_L1_error) + + /* "talib/_func.pxi":6192 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6194 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6195 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6195, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6194 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6196 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6197 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6198 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__800, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6198, __pyx_L1_error) + + /* "talib/_func.pxi":6197 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6199 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6200 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__801, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6200, __pyx_L1_error) + + /* "talib/_func.pxi":6199 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6201 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6202 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6202, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6201 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6203 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6204 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6205 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__802, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6205, __pyx_L1_error) + + /* "talib/_func.pxi":6204 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6206 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6207 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__803, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6207, __pyx_L1_error) + + /* "talib/_func.pxi":6206 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6208 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6209 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6209, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6208 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6210 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6211 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6212 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6213 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__804, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6213, __pyx_L1_error) + + /* "talib/_func.pxi":6212 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6214 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6215 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__805, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6215, __pyx_L1_error) + + /* "talib/_func.pxi":6214 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6216 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6217 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__806, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6217, __pyx_L1_error) + + /* "talib/_func.pxi":6216 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6218 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6219 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6220 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6221 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6222 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6221 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6223 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6224 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6225 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6224 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6226 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6227 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6228 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6227 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6229 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6230 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6231 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6230 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6232 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6233 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6235 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__807, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6235, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6236 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6237 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTHRUSTING_Lookback()); + + /* "talib/_func.pxi":6238 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6238, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6239 + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6240 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6241 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6242 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTHRUSTING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTHRUSTING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6243 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTHRUSTING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6244 + * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6160 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6248 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_159CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_158CDLTRISTAR[] = " CDLTRISTAR(open, high, low, close)\n\n Tristar Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_159CDLTRISTAR = {"CDLTRISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_159CDLTRISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_158CDLTRISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_159CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLTRISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 1); __PYX_ERR(2, 6248, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 2); __PYX_ERR(2, 6248, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 3); __PYX_ERR(2, 6248, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTRISTAR") < 0)) __PYX_ERR(2, 6248, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6248, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6248, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6248, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6248, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6248, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_158CDLTRISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_158CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLTRISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6271 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6272 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__808, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6272, __pyx_L1_error) + + /* "talib/_func.pxi":6271 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6273 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6274 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__809, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6274, __pyx_L1_error) + + /* "talib/_func.pxi":6273 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6275 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6276 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6276, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6275 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6277 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6278 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6279 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__810, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6279, __pyx_L1_error) + + /* "talib/_func.pxi":6278 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6280 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6281 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__811, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6281, __pyx_L1_error) + + /* "talib/_func.pxi":6280 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6282 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6283 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6283, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6282 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6284 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6285 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6286 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__812, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6286, __pyx_L1_error) + + /* "talib/_func.pxi":6285 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6287 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6288 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__813, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6288, __pyx_L1_error) + + /* "talib/_func.pxi":6287 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6289 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6290 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6290, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6289 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6291 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6292 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6293 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__814, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6293, __pyx_L1_error) + + /* "talib/_func.pxi":6292 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6294 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6295 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__815, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6295, __pyx_L1_error) + + /* "talib/_func.pxi":6294 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6296 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6297 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6297, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6296 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6298 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6299 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6300 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6301 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__816, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6301, __pyx_L1_error) + + /* "talib/_func.pxi":6300 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6302 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6303 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__817, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6303, __pyx_L1_error) + + /* "talib/_func.pxi":6302 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6304 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6305 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__818, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6305, __pyx_L1_error) + + /* "talib/_func.pxi":6304 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6306 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6307 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6308 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6309 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6310 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6309 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6311 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6312 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6313 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6312 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6314 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6315 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6316 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6315 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6317 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6318 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6319 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6318 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6320 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6321 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6323 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__819, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6323, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6324 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6325 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTRISTAR_Lookback()); + + /* "talib/_func.pxi":6326 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6326, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6327 + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6328 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6329 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTRISTAR", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6330 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTRISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTRISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6331 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTRISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTRISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6332 + * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLTRISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6248 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6336 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_161CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_160CDLUNIQUE3RIVER[] = " CDLUNIQUE3RIVER(open, high, low, close)\n\n Unique 3 River (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_161CDLUNIQUE3RIVER = {"CDLUNIQUE3RIVER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_161CDLUNIQUE3RIVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_160CDLUNIQUE3RIVER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_161CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 1); __PYX_ERR(2, 6336, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 2); __PYX_ERR(2, 6336, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 3); __PYX_ERR(2, 6336, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUNIQUE3RIVER") < 0)) __PYX_ERR(2, 6336, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6336, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6336, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_160CDLUNIQUE3RIVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_160CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6359 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6360 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__820, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6360, __pyx_L1_error) + + /* "talib/_func.pxi":6359 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6361 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6362 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__821, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6362, __pyx_L1_error) + + /* "talib/_func.pxi":6361 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6363 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6364 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6364, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6363 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6365 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6366 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6367 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__822, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6367, __pyx_L1_error) + + /* "talib/_func.pxi":6366 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6368 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6369 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__823, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6369, __pyx_L1_error) + + /* "talib/_func.pxi":6368 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6370 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6371 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6371, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6370 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6372 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6373 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6374 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__824, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6374, __pyx_L1_error) + + /* "talib/_func.pxi":6373 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6375 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6376 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__825, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6376, __pyx_L1_error) + + /* "talib/_func.pxi":6375 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6377 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6378 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6378, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6377 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6379 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6380 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6381 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__826, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6381, __pyx_L1_error) + + /* "talib/_func.pxi":6380 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6382 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6383 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__827, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6383, __pyx_L1_error) + + /* "talib/_func.pxi":6382 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6384 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6385 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6385, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6384 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6386 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6387 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6388 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6389 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__828, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6389, __pyx_L1_error) + + /* "talib/_func.pxi":6388 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6390 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6391 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__829, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6391, __pyx_L1_error) + + /* "talib/_func.pxi":6390 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6392 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6393 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__830, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6393, __pyx_L1_error) + + /* "talib/_func.pxi":6392 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6394 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6395 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6396 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6397 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6398 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6397 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6399 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6400 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6401 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6400 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6402 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6403 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6404 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6403 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6405 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6406 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6407 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6406 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6408 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6409 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6411 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__831, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6411, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6412 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6413 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLUNIQUE3RIVER_Lookback()); + + /* "talib/_func.pxi":6414 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6414, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6415 + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6416 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6417 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6418 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLUNIQUE3RIVER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6419 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6420 + * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6336 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6424 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_163CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_162CDLUPSIDEGAP2CROWS[] = " CDLUPSIDEGAP2CROWS(open, high, low, close)\n\n Upside Gap Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_163CDLUPSIDEGAP2CROWS = {"CDLUPSIDEGAP2CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_163CDLUPSIDEGAP2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_162CDLUPSIDEGAP2CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_163CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 1); __PYX_ERR(2, 6424, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 2); __PYX_ERR(2, 6424, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 3); __PYX_ERR(2, 6424, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUPSIDEGAP2CROWS") < 0)) __PYX_ERR(2, 6424, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6424, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6424, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_162CDLUPSIDEGAP2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_162CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6447 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6448 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__832, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6448, __pyx_L1_error) + + /* "talib/_func.pxi":6447 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6449 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6450 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__833, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6450, __pyx_L1_error) + + /* "talib/_func.pxi":6449 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6451 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6452 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6452, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6451 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6453 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6454 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6455 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__834, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6455, __pyx_L1_error) + + /* "talib/_func.pxi":6454 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6456 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6457 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__835, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6457, __pyx_L1_error) + + /* "talib/_func.pxi":6456 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6458 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6459 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6459, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6458 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6460 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6461 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6462 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__836, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6462, __pyx_L1_error) + + /* "talib/_func.pxi":6461 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6463 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6464 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__837, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6464, __pyx_L1_error) + + /* "talib/_func.pxi":6463 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6465 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6466 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6466, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6465 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6467 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6468 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6469 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__838, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6469, __pyx_L1_error) + + /* "talib/_func.pxi":6468 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6470 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6471 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__839, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6471, __pyx_L1_error) + + /* "talib/_func.pxi":6470 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6472 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6473 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6473, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6472 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6474 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6475 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6476 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6477 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__840, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6477, __pyx_L1_error) + + /* "talib/_func.pxi":6476 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6478 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6479 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__841, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6479, __pyx_L1_error) + + /* "talib/_func.pxi":6478 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6480 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6481 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__842, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6481, __pyx_L1_error) + + /* "talib/_func.pxi":6480 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6482 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6483 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6484 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6485 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6486 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6485 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6487 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6488 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6489 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6488 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6490 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6491 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6492 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6491 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6493 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6494 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6495 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6494 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6496 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6497 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6499 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__843, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6499, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6500 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6501 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLUPSIDEGAP2CROWS_Lookback()); + + /* "talib/_func.pxi":6502 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6502, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6503 + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6504 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6505 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6506 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLUPSIDEGAP2CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6507 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6508 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6424 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6512 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_165CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_164CDLXSIDEGAP3METHODS[] = " CDLXSIDEGAP3METHODS(open, high, low, close)\n\n Upside/Downside Gap Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_165CDLXSIDEGAP3METHODS = {"CDLXSIDEGAP3METHODS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_165CDLXSIDEGAP3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_164CDLXSIDEGAP3METHODS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_165CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 1); __PYX_ERR(2, 6512, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 2); __PYX_ERR(2, 6512, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 3); __PYX_ERR(2, 6512, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLXSIDEGAP3METHODS") < 0)) __PYX_ERR(2, 6512, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6512, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(2, 6512, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6512, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6512, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6512, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_164CDLXSIDEGAP3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_164CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":6535 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6536 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__844, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6536, __pyx_L1_error) + + /* "talib/_func.pxi":6535 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_func.pxi":6537 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6538 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__845, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6538, __pyx_L1_error) + + /* "talib/_func.pxi":6537 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6539 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6540 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6540, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6539 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_func.pxi":6541 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_func.pxi":6542 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6543 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__846, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6543, __pyx_L1_error) + + /* "talib/_func.pxi":6542 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":6544 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6545 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__847, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6545, __pyx_L1_error) + + /* "talib/_func.pxi":6544 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6546 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6547 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6547, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6546 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":6548 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":6549 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6550 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__848, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6550, __pyx_L1_error) + + /* "talib/_func.pxi":6549 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":6551 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6552 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__849, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6552, __pyx_L1_error) + + /* "talib/_func.pxi":6551 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6553 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6554 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6554, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6553 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":6555 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":6556 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6557 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__850, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6557, __pyx_L1_error) + + /* "talib/_func.pxi":6556 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":6558 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6559 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__851, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6559, __pyx_L1_error) + + /* "talib/_func.pxi":6558 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6560 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6561 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6561, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6560 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":6562 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":6563 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_func.pxi":6564 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6565 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__852, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6565, __pyx_L1_error) + + /* "talib/_func.pxi":6564 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_func.pxi":6566 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6567 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__853, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6567, __pyx_L1_error) + + /* "talib/_func.pxi":6566 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":6568 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6569 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__854, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6569, __pyx_L1_error) + + /* "talib/_func.pxi":6568 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6570 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = open_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6571 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = open_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6572 + * begidx = 0 + * for i from 0 <= i < length: + * val = open_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); + + /* "talib/_func.pxi":6573 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6574 + * val = open_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6573 + * for i from 0 <= i < length: + * val = open_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = high_data[i] + */ + } + + /* "talib/_func.pxi":6575 + * if val != val: + * continue + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":6576 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6577 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6576 + * continue + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":6578 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":6579 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6580 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6579 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":6581 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":6582 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6583 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":6582 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6584 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6585 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6587 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__855, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6587, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":6588 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6589 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CDLXSIDEGAP3METHODS_Lookback()); + + /* "talib/_func.pxi":6590 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6590, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6591 + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":6592 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6593 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":6594 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLXSIDEGAP3METHODS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6595 + * outinteger_data[i] = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6596 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":6512 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6600 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_167CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_166CEIL[] = " CEIL(real)\n\n Vector Ceil (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_167CEIL = {"CEIL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_167CEIL, METH_O, __pyx_doc_5talib_7_ta_lib_166CEIL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_167CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CEIL (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 6600, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_166CEIL(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_166CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CEIL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":6620 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6621 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__856, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6621, __pyx_L1_error) + + /* "talib/_func.pxi":6620 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":6622 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6623 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__857, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6623, __pyx_L1_error) + + /* "talib/_func.pxi":6622 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6624 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6625 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6625, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6624 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":6626 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":6627 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":6628 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6629 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6630 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":6631 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6632 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":6631 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6633 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6634 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6636 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CEIL_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__858, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6636, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":6637 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CEIL_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6638 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CEIL_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CEIL_Lookback()); + + /* "talib/_func.pxi":6639 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CEIL_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6639, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6640 + * lookback = begidx + lib.TA_CEIL_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6641 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6642 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CEIL", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6643 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CEIL", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CEIL(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6644 + * outreal_data[i] = NaN + * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CEIL", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CEIL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6645 + * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CEIL", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6600 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CEIL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6649 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_169CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_168CMO[] = " CMO(real[, timeperiod=?])\n\n Chande Momentum Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_169CMO = {"CMO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_169CMO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_168CMO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_169CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CMO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CMO") < 0)) __PYX_ERR(2, 6649, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 6649, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CMO", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6649, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 6649, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_168CMO(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_168CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CMO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":6671 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6672 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__859, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6672, __pyx_L1_error) + + /* "talib/_func.pxi":6671 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":6673 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6674 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__860, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6674, __pyx_L1_error) + + /* "talib/_func.pxi":6673 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6675 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6676 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6676, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6675 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":6677 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":6678 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":6679 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6680 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6681 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":6682 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6683 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":6682 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6684 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6685 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6687 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__861, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6687, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":6688 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6689 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CMO_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":6690 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6690, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6691 + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6692 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6693 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CMO", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6694 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CMO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CMO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6695 + * outreal_data[i] = NaN + * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CMO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CMO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6696 + * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CMO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6649 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6700 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_171CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_170CORREL[] = " CORREL(real0, real1[, timeperiod=?])\n\n Pearson's Correlation Coefficient (r) (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_171CORREL = {"CORREL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_171CORREL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_170CORREL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_171CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("CORREL (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, 1); __PYX_ERR(2, 6700, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CORREL") < 0)) __PYX_ERR(2, 6700, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 6700, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6700, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 6700, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 6700, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_170CORREL(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_170CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("CORREL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":6724 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6725 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__862, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6725, __pyx_L1_error) + + /* "talib/_func.pxi":6724 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":6726 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6727 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__863, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6727, __pyx_L1_error) + + /* "talib/_func.pxi":6726 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6728 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6729 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6729, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6728 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":6730 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":6731 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6732 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__864, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6732, __pyx_L1_error) + + /* "talib/_func.pxi":6731 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":6733 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6734 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__865, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6734, __pyx_L1_error) + + /* "talib/_func.pxi":6733 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6735 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6736 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6736, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6735 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":6737 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":6738 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":6739 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6740 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__866, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6740, __pyx_L1_error) + + /* "talib/_func.pxi":6739 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6741 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6742 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6743 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":6744 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6745 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":6744 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":6746 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":6747 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6748 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":6747 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6749 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6750 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6752 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__867, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6752, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":6753 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6754 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_CORREL_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":6755 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6755, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6756 + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6757 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6758 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CORREL", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6759 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CORREL", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CORREL(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6760 + * outreal_data[i] = NaN + * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CORREL", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CORREL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6761 + * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_CORREL", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6700 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6765 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_173COS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_172COS[] = " COS(real)\n\n Vector Trigonometric Cos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_173COS = {"COS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_173COS, METH_O, __pyx_doc_5talib_7_ta_lib_172COS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_173COS(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("COS (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 6765, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_172COS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_172COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("COS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":6785 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6786 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__868, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6786, __pyx_L1_error) + + /* "talib/_func.pxi":6785 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":6787 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6788 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__869, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6788, __pyx_L1_error) + + /* "talib/_func.pxi":6787 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6789 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6790 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6790, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6789 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":6791 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":6792 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":6793 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6794 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6795 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":6796 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6797 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":6796 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6798 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6799 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6801 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COS_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__870, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6801, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":6802 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_COS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6803 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COS_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_COS_Lookback()); + + /* "talib/_func.pxi":6804 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6804, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6805 + * lookback = begidx + lib.TA_COS_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6806 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6807 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COS", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6808 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_COS", retCode) + * return outreal + */ + __pyx_v_retCode = TA_COS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6809 + * outreal_data[i] = NaN + * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COS", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_COS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6810 + * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COS", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6765 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.COS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6814 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_175COSH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_174COSH[] = " COSH(real)\n\n Vector Trigonometric Cosh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_175COSH = {"COSH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_175COSH, METH_O, __pyx_doc_5talib_7_ta_lib_174COSH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_175COSH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("COSH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 6814, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_174COSH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_174COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("COSH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":6834 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6835 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__871, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6835, __pyx_L1_error) + + /* "talib/_func.pxi":6834 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":6836 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6837 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__872, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6837, __pyx_L1_error) + + /* "talib/_func.pxi":6836 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6838 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6839 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6839, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6838 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":6840 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":6841 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":6842 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6843 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6844 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":6845 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6846 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":6845 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6847 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6848 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6850 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COSH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__873, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6850, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":6851 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_COSH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6852 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COSH_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_COSH_Lookback()); + + /* "talib/_func.pxi":6853 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COSH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6853, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6854 + * lookback = begidx + lib.TA_COSH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6855 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6856 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COSH", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6857 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_COSH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_COSH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6858 + * outreal_data[i] = NaN + * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COSH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_COSH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6859 + * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_COSH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6814 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.COSH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6863 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_177DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_176DEMA[] = " DEMA(real[, timeperiod=?])\n\n Double Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_177DEMA = {"DEMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_177DEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_176DEMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_177DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DEMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DEMA") < 0)) __PYX_ERR(2, 6863, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 6863, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("DEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6863, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 6863, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_176DEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_176DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("DEMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":6885 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6886 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__874, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6886, __pyx_L1_error) + + /* "talib/_func.pxi":6885 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":6887 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6888 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__875, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6888, __pyx_L1_error) + + /* "talib/_func.pxi":6887 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6889 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6890 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6890, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6889 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":6891 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":6892 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":6893 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6894 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6895 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":6896 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6897 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":6896 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6898 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6899 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6901 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__876, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6901, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":6902 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6903 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_DEMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":6904 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6904, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6905 + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6906 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6907 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DEMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6908 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DEMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DEMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6909 + * outreal_data[i] = NaN + * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DEMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6910 + * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DEMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6863 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_179DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_178DIV[] = " DIV(real0, real1)\n\n Vector Arithmetic Div (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_179DIV = {"DIV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_179DIV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_178DIV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_179DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DIV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, 1); __PYX_ERR(2, 6914, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DIV") < 0)) __PYX_ERR(2, 6914, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6914, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 6914, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 6914, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_178DIV(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_178DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("DIV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":6936 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6937 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__877, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6937, __pyx_L1_error) + + /* "talib/_func.pxi":6936 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":6938 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6939 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__878, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6939, __pyx_L1_error) + + /* "talib/_func.pxi":6938 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6940 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6941 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6941, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6940 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":6942 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":6943 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6944 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__879, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6944, __pyx_L1_error) + + /* "talib/_func.pxi":6943 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":6945 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6946 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__880, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6946, __pyx_L1_error) + + /* "talib/_func.pxi":6945 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":6947 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6948 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6948, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6947 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":6949 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":6950 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":6951 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6952 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__881, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6952, __pyx_L1_error) + + /* "talib/_func.pxi":6951 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":6953 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":6954 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6955 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":6956 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6957 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":6956 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":6958 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":6959 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":6960 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":6959 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":6961 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":6962 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":6964 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DIV_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__882, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 6964, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":6965 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_DIV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":6966 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DIV_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_DIV_Lookback()); + + /* "talib/_func.pxi":6967 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DIV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 6967, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":6968 + * lookback = begidx + lib.TA_DIV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":6969 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":6970 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DIV", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":6971 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DIV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DIV(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":6972 + * outreal_data[i] = NaN + * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DIV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DIV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":6973 + * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DIV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":6977 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_181DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_180DX[] = " DX(high, low, close[, timeperiod=?])\n\n Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_181DX = {"DX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_181DX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_180DX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_181DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 1); __PYX_ERR(2, 6977, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 2); __PYX_ERR(2, 6977, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DX") < 0)) __PYX_ERR(2, 6977, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 6977, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 6977, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 6977, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 6977, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 6977, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_180DX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_180DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("DX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":7001 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7002 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__883, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7002, __pyx_L1_error) + + /* "talib/_func.pxi":7001 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":7003 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7004 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__884, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7004, __pyx_L1_error) + + /* "talib/_func.pxi":7003 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7005 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7006 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7006, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7005 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":7007 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":7008 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7009 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__885, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7009, __pyx_L1_error) + + /* "talib/_func.pxi":7008 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":7010 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7011 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__886, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7011, __pyx_L1_error) + + /* "talib/_func.pxi":7010 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7012 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7013 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7013, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7012 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":7014 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":7015 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7016 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__887, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7016, __pyx_L1_error) + + /* "talib/_func.pxi":7015 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":7017 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7018 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__888, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7018, __pyx_L1_error) + + /* "talib/_func.pxi":7017 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7019 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7020 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7020, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7019 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":7021 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":7022 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":7023 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7024 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__889, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7024, __pyx_L1_error) + + /* "talib/_func.pxi":7023 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":7025 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7026 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__890, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7026, __pyx_L1_error) + + /* "talib/_func.pxi":7025 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":7027 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7028 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7029 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":7030 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7031 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":7030 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":7032 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":7033 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7034 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":7033 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":7035 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":7036 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7037 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":7036 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7038 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7039 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7041 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__891, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7041, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":7042 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7043 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_DX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7044 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7044, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7045 + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7046 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7047 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DX", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7048 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DX(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7049 + * outreal_data[i] = NaN + * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7050 + * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_DX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":6977 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7054 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_183EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_182EMA[] = " EMA(real[, timeperiod=?])\n\n Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_183EMA = {"EMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_183EMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_182EMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_183EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("EMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "EMA") < 0)) __PYX_ERR(2, 7054, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7054, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("EMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7054, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7054, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_182EMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_182EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("EMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7076 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7077 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__892, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7077, __pyx_L1_error) + + /* "talib/_func.pxi":7076 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7078 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7079 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__893, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7079, __pyx_L1_error) + + /* "talib/_func.pxi":7078 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7080 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7081 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7081, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7080 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7082 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7083 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7084 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7085 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7086 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7087 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7088 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7087 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7089 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7090 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7092 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__894, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7092, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7093 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7094 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_EMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7095 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7095, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7096 + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7097 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7098 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7099 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_EMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_EMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7100 + * outreal_data[i] = NaN + * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_EMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7101 + * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7054 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_185EXP(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_184EXP[] = " EXP(real)\n\n Vector Arithmetic Exp (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_185EXP = {"EXP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_185EXP, METH_O, __pyx_doc_5talib_7_ta_lib_184EXP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_185EXP(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("EXP (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7105, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_184EXP(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_184EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("EXP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7125 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7126 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__895, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7126, __pyx_L1_error) + + /* "talib/_func.pxi":7125 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7127 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7128 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__896, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7128, __pyx_L1_error) + + /* "talib/_func.pxi":7127 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7129 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7130 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7130, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7129 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7131 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7132 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7133 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7134 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7135 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7136 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7137 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7136 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7138 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7139 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7141 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EXP_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__897, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7141, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7142 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_EXP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7143 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EXP_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_EXP_Lookback()); + + /* "talib/_func.pxi":7144 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EXP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7144, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7145 + * lookback = begidx + lib.TA_EXP_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7146 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7147 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EXP", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7148 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_EXP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_EXP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7149 + * outreal_data[i] = NaN + * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EXP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_EXP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7150 + * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_EXP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.EXP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7154 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_187FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_186FLOOR[] = " FLOOR(real)\n\n Vector Floor (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_187FLOOR = {"FLOOR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_187FLOOR, METH_O, __pyx_doc_5talib_7_ta_lib_186FLOOR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_187FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("FLOOR (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7154, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_186FLOOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_186FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("FLOOR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7174 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7175 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__898, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7175, __pyx_L1_error) + + /* "talib/_func.pxi":7174 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7176 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7177 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__899, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7177, __pyx_L1_error) + + /* "talib/_func.pxi":7176 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7178 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7179 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7179, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7178 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7180 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7181 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7182 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7183 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7184 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7185 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7186 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7185 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7187 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7188 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7190 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_FLOOR_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__900, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7190, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7191 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_FLOOR_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7192 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_FLOOR_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_FLOOR_Lookback()); + + /* "talib/_func.pxi":7193 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_FLOOR_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7193, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7194 + * lookback = begidx + lib.TA_FLOOR_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7195 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7196 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_FLOOR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7197 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_FLOOR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_FLOOR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7198 + * outreal_data[i] = NaN + * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_FLOOR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_FLOOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7199 + * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_FLOOR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7154 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.FLOOR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7203 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_189HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_188HT_DCPERIOD[] = " HT_DCPERIOD(real)\n\n Hilbert Transform - Dominant Cycle Period (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_189HT_DCPERIOD = {"HT_DCPERIOD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_189HT_DCPERIOD, METH_O, __pyx_doc_5talib_7_ta_lib_188HT_DCPERIOD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_189HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_DCPERIOD (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7203, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_188HT_DCPERIOD(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_188HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_DCPERIOD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7223 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7224 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__901, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7224, __pyx_L1_error) + + /* "talib/_func.pxi":7223 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7225 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7226 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__902, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7226, __pyx_L1_error) + + /* "talib/_func.pxi":7225 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7227 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7228 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7228, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7227 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7229 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7230 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7231 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7232 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7233 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7234 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7235 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7234 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7236 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7237 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7239 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__903, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7239, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7240 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7241 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_DCPERIOD_Lookback()); + + /* "talib/_func.pxi":7242 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7242, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7243 + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7244 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7245 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7246 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_DCPERIOD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_DCPERIOD(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7247 + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_DCPERIOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7248 + * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7203 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_DCPERIOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7252 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_191HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_190HT_DCPHASE[] = " HT_DCPHASE(real)\n\n Hilbert Transform - Dominant Cycle Phase (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_191HT_DCPHASE = {"HT_DCPHASE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_191HT_DCPHASE, METH_O, __pyx_doc_5talib_7_ta_lib_190HT_DCPHASE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_191HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_DCPHASE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7252, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_190HT_DCPHASE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_190HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_DCPHASE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7272 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7273 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__904, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7273, __pyx_L1_error) + + /* "talib/_func.pxi":7272 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7274 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7275 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__905, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7275, __pyx_L1_error) + + /* "talib/_func.pxi":7274 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7276 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7277 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7277, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7276 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7278 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7279 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7280 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7281 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7282 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7283 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7284 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7283 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7285 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7286 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7288 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__906, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7288, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7289 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7290 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_DCPHASE_Lookback()); + + /* "talib/_func.pxi":7291 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7291, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7292 + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7293 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7294 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPHASE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7295 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_DCPHASE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_DCPHASE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7296 + * outreal_data[i] = NaN + * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPHASE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_DCPHASE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7297 + * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_DCPHASE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7252 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_DCPHASE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_193HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_192HT_PHASOR[] = " HT_PHASOR(real)\n\n Hilbert Transform - Phasor Components (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n inphase\n quadrature\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_193HT_PHASOR = {"HT_PHASOR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_193HT_PHASOR, METH_O, __pyx_doc_5talib_7_ta_lib_192HT_PHASOR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_193HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_PHASOR (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7301, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_192HT_PHASOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_192HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinphase = 0; + double *__pyx_v_outinphase_data; + PyArrayObject *__pyx_v_outquadrature = 0; + double *__pyx_v_outquadrature_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_PHASOR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7324 + * np.ndarray outquadrature + * double* outquadrature_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7325 + * double* outquadrature_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__907, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7325, __pyx_L1_error) + + /* "talib/_func.pxi":7324 + * np.ndarray outquadrature + * double* outquadrature_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7326 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7327 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__908, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7327, __pyx_L1_error) + + /* "talib/_func.pxi":7326 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7328 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7329 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7329, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7328 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7330 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7331 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7332 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7333 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7334 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7335 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7336 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7335 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7337 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7338 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7340 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__909, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7340, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7341 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) + * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7342 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) # <<<<<<<<<<<<<< + * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outinphase_data = outinphase.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_PHASOR_Lookback()); + + /* "talib/_func.pxi":7343 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) + * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinphase_data = outinphase.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7343, __pyx_L1_error) + __pyx_v_outinphase = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7344 + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) + * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outinphase_data = outinphase.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinphase_data[i] = NaN + */ + __pyx_v_outinphase_data = ((double *)__pyx_v_outinphase->data); + + /* "talib/_func.pxi":7345 + * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outinphase_data = outinphase.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinphase_data[i] = NaN + * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7346 + * outinphase_data = outinphase.data + * for i from 0 <= i < min(lookback, length): + * outinphase_data[i] = NaN # <<<<<<<<<<<<<< + * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outquadrature_data = outquadrature.data + */ + (__pyx_v_outinphase_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7347 + * for i from 0 <= i < min(lookback, length): + * outinphase_data[i] = NaN + * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outquadrature_data = outquadrature.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7347, __pyx_L1_error) + __pyx_v_outquadrature = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7348 + * outinphase_data[i] = NaN + * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outquadrature_data = outquadrature.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outquadrature_data[i] = NaN + */ + __pyx_v_outquadrature_data = ((double *)__pyx_v_outquadrature->data); + + /* "talib/_func.pxi":7349 + * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outquadrature_data = outquadrature.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outquadrature_data[i] = NaN + * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7350 + * outquadrature_data = outquadrature.data + * for i from 0 <= i < min(lookback, length): + * outquadrature_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) + * _ta_check_success("TA_HT_PHASOR", retCode) + */ + (__pyx_v_outquadrature_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7351 + * for i from 0 <= i < min(lookback, length): + * outquadrature_data[i] = NaN + * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_PHASOR", retCode) + * return outinphase , outquadrature + */ + __pyx_v_retCode = TA_HT_PHASOR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outinphase_data + __pyx_v_lookback)), ((double *)(__pyx_v_outquadrature_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7352 + * outquadrature_data[i] = NaN + * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) + * _ta_check_success("TA_HT_PHASOR", retCode) # <<<<<<<<<<<<<< + * return outinphase , outquadrature + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_PHASOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7353 + * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) + * _ta_check_success("TA_HT_PHASOR", retCode) + * return outinphase , outquadrature # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outinphase)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outinphase)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outinphase)); + __Pyx_INCREF(((PyObject *)__pyx_v_outquadrature)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outquadrature)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outquadrature)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":7301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_PHASOR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinphase); + __Pyx_XDECREF((PyObject *)__pyx_v_outquadrature); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7357 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_195HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_194HT_SINE[] = " HT_SINE(real)\n\n Hilbert Transform - SineWave (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n sine\n leadsine\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_195HT_SINE = {"HT_SINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_195HT_SINE, METH_O, __pyx_doc_5talib_7_ta_lib_194HT_SINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_195HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_SINE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7357, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_194HT_SINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_194HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outsine = 0; + double *__pyx_v_outsine_data; + PyArrayObject *__pyx_v_outleadsine = 0; + double *__pyx_v_outleadsine_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_SINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7380 + * np.ndarray outleadsine + * double* outleadsine_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7381 + * double* outleadsine_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__910, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7381, __pyx_L1_error) + + /* "talib/_func.pxi":7380 + * np.ndarray outleadsine + * double* outleadsine_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7382 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7383 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__911, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7383, __pyx_L1_error) + + /* "talib/_func.pxi":7382 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7384 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7385 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7385, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7384 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7386 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7387 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7388 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7389 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7390 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7391 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7392 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7391 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7393 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7394 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7396 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__912, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7396, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7397 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) + * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7398 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) # <<<<<<<<<<<<<< + * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outsine_data = outsine.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_SINE_Lookback()); + + /* "talib/_func.pxi":7399 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) + * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outsine_data = outsine.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7399, __pyx_L1_error) + __pyx_v_outsine = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7400 + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) + * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outsine_data = outsine.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outsine_data[i] = NaN + */ + __pyx_v_outsine_data = ((double *)__pyx_v_outsine->data); + + /* "talib/_func.pxi":7401 + * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outsine_data = outsine.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outsine_data[i] = NaN + * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7402 + * outsine_data = outsine.data + * for i from 0 <= i < min(lookback, length): + * outsine_data[i] = NaN # <<<<<<<<<<<<<< + * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outleadsine_data = outleadsine.data + */ + (__pyx_v_outsine_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7403 + * for i from 0 <= i < min(lookback, length): + * outsine_data[i] = NaN + * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outleadsine_data = outleadsine.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7403, __pyx_L1_error) + __pyx_v_outleadsine = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7404 + * outsine_data[i] = NaN + * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outleadsine_data = outleadsine.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outleadsine_data[i] = NaN + */ + __pyx_v_outleadsine_data = ((double *)__pyx_v_outleadsine->data); + + /* "talib/_func.pxi":7405 + * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outleadsine_data = outleadsine.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outleadsine_data[i] = NaN + * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7406 + * outleadsine_data = outleadsine.data + * for i from 0 <= i < min(lookback, length): + * outleadsine_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) + * _ta_check_success("TA_HT_SINE", retCode) + */ + (__pyx_v_outleadsine_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7407 + * for i from 0 <= i < min(lookback, length): + * outleadsine_data[i] = NaN + * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_SINE", retCode) + * return outsine , outleadsine + */ + __pyx_v_retCode = TA_HT_SINE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outsine_data + __pyx_v_lookback)), ((double *)(__pyx_v_outleadsine_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7408 + * outleadsine_data[i] = NaN + * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) + * _ta_check_success("TA_HT_SINE", retCode) # <<<<<<<<<<<<<< + * return outsine , outleadsine + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_SINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7409 + * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) + * _ta_check_success("TA_HT_SINE", retCode) + * return outsine , outleadsine # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outsine)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outsine)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outsine)); + __Pyx_INCREF(((PyObject *)__pyx_v_outleadsine)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outleadsine)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outleadsine)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":7357 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_SINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outsine); + __Pyx_XDECREF((PyObject *)__pyx_v_outleadsine); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7413 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_197HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_196HT_TRENDLINE[] = " HT_TRENDLINE(real)\n\n Hilbert Transform - Instantaneous Trendline (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_197HT_TRENDLINE = {"HT_TRENDLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_197HT_TRENDLINE, METH_O, __pyx_doc_5talib_7_ta_lib_196HT_TRENDLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_197HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_TRENDLINE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7413, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_196HT_TRENDLINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_196HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_TRENDLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7434 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__913, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7434, __pyx_L1_error) + + /* "talib/_func.pxi":7433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7435 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7436 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__914, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7436, __pyx_L1_error) + + /* "talib/_func.pxi":7435 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7437 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7438 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7438, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7437 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7439 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7440 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7441 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7442 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7443 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7444 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7445 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7444 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7446 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7447 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7449 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__915, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7449, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7450 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7451 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_TRENDLINE_Lookback()); + + /* "talib/_func.pxi":7452 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7452, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7453 + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7454 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7455 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7456 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_TRENDLINE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_TRENDLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7457 + * outreal_data[i] = NaN + * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_TRENDLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7458 + * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7413 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_TRENDLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_199HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_198HT_TRENDMODE[] = " HT_TRENDMODE(real)\n\n Hilbert Transform - Trend vs Cycle Mode (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_199HT_TRENDMODE = {"HT_TRENDMODE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_199HT_TRENDMODE, METH_O, __pyx_doc_5talib_7_ta_lib_198HT_TRENDMODE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_199HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("HT_TRENDMODE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7462, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_198HT_TRENDMODE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_198HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("HT_TRENDMODE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7482 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7483 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__916, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7483, __pyx_L1_error) + + /* "talib/_func.pxi":7482 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7484 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7485 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__917, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7485, __pyx_L1_error) + + /* "talib/_func.pxi":7484 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7486 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7487 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7487, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7486 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7488 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7489 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7490 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7491 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7492 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7493 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7494 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7493 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7495 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7496 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7498 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__918, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7498, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7499 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7500 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_HT_TRENDMODE_Lookback()); + + /* "talib/_func.pxi":7501 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7501, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7502 + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":7503 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7504 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":7505 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_TRENDMODE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_HT_TRENDMODE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7506 + * outinteger_data[i] = 0 + * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_TRENDMODE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7507 + * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":7462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.HT_TRENDMODE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_201KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_200KAMA[] = " KAMA(real[, timeperiod=?])\n\n Kaufman Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_201KAMA = {"KAMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_201KAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_200KAMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_201KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("KAMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "KAMA") < 0)) __PYX_ERR(2, 7511, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7511, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("KAMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7511, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7511, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_200KAMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_200KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("KAMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7533 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7534 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__919, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7534, __pyx_L1_error) + + /* "talib/_func.pxi":7533 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7535 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7536 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__920, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7536, __pyx_L1_error) + + /* "talib/_func.pxi":7535 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7537 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7538 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7538, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7537 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7539 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7540 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7541 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7542 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7543 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7544 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7545 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7544 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7546 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7547 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7549 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__921, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7549, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7550 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7551 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_KAMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7552 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7552, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7553 + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7554 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7555 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_KAMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7556 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_KAMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_KAMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7557 + * outreal_data[i] = NaN + * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_KAMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_KAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7558 + * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_KAMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7562 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_203LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_202LINEARREG[] = " LINEARREG(real[, timeperiod=?])\n\n Linear Regression (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_203LINEARREG = {"LINEARREG", (PyCFunction)__pyx_pw_5talib_7_ta_lib_203LINEARREG, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_202LINEARREG}; +static PyObject *__pyx_pw_5talib_7_ta_lib_203LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LINEARREG (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG") < 0)) __PYX_ERR(2, 7562, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7562, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("LINEARREG", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7562, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7562, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_202LINEARREG(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_202LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LINEARREG", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7584 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7585 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__922, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7585, __pyx_L1_error) + + /* "talib/_func.pxi":7584 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7586 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7587 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__923, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7587, __pyx_L1_error) + + /* "talib/_func.pxi":7586 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7588 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7589 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7589, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7588 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7590 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7591 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7592 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7593 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7594 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7595 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7596 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7595 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7597 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7598 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7600 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__924, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7600, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7601 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7602 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7603 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7603, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7604 + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7605 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7606 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7607 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7608 + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7609 + * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7562 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_205LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_204LINEARREG_ANGLE[] = " LINEARREG_ANGLE(real[, timeperiod=?])\n\n Linear Regression Angle (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_205LINEARREG_ANGLE = {"LINEARREG_ANGLE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_205LINEARREG_ANGLE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_204LINEARREG_ANGLE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_205LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LINEARREG_ANGLE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_ANGLE") < 0)) __PYX_ERR(2, 7613, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7613, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("LINEARREG_ANGLE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7613, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7613, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_204LINEARREG_ANGLE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_204LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LINEARREG_ANGLE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7635 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7636 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__925, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7636, __pyx_L1_error) + + /* "talib/_func.pxi":7635 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7637 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7638 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__926, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7638, __pyx_L1_error) + + /* "talib/_func.pxi":7637 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7639 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7640 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7640, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7639 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7641 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7642 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7643 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7644 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7645 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7646 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7647 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7646 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7648 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7649 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7651 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__927, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7651, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7652 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7653 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_ANGLE_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7654 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7654, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7655 + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7656 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7657 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7658 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_ANGLE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7659 + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7660 + * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_207LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_206LINEARREG_INTERCEPT[] = " LINEARREG_INTERCEPT(real[, timeperiod=?])\n\n Linear Regression Intercept (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_207LINEARREG_INTERCEPT = {"LINEARREG_INTERCEPT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_207LINEARREG_INTERCEPT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_206LINEARREG_INTERCEPT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_207LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_INTERCEPT") < 0)) __PYX_ERR(2, 7664, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7664, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("LINEARREG_INTERCEPT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7664, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7664, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_206LINEARREG_INTERCEPT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_206LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7686 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7687 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__928, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7687, __pyx_L1_error) + + /* "talib/_func.pxi":7686 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7688 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7689 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__929, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7689, __pyx_L1_error) + + /* "talib/_func.pxi":7688 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7690 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7691 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7691, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7690 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7692 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7693 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7694 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7695 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7696 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7697 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7698 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7697 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7699 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7700 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7702 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__930, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7702, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7703 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7704 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_INTERCEPT_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7705 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7705, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7706 + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7707 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7708 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7709 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_INTERCEPT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7710 + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7711 + * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_209LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_208LINEARREG_SLOPE[] = " LINEARREG_SLOPE(real[, timeperiod=?])\n\n Linear Regression Slope (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_209LINEARREG_SLOPE = {"LINEARREG_SLOPE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_209LINEARREG_SLOPE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_208LINEARREG_SLOPE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_209LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LINEARREG_SLOPE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_SLOPE") < 0)) __PYX_ERR(2, 7715, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7715, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("LINEARREG_SLOPE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7715, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7715, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_208LINEARREG_SLOPE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_208LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LINEARREG_SLOPE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7737 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7738 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__931, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7738, __pyx_L1_error) + + /* "talib/_func.pxi":7737 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7739 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7740 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__932, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7740, __pyx_L1_error) + + /* "talib/_func.pxi":7739 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7741 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7742 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7742, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7741 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7743 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7744 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7745 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7746 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7747 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7748 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7749 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7748 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7750 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7751 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7753 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__933, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7753, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7754 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7755 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_SLOPE_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":7756 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7756, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7757 + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7758 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7759 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7760 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_SLOPE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7761 + * outreal_data[i] = NaN + * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7762 + * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7766 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_211LN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_210LN[] = " LN(real)\n\n Vector Log Natural (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_211LN = {"LN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_211LN, METH_O, __pyx_doc_5talib_7_ta_lib_210LN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_211LN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7766, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_210LN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_210LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7786 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7787 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__934, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7787, __pyx_L1_error) + + /* "talib/_func.pxi":7786 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7788 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7789 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__935, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7789, __pyx_L1_error) + + /* "talib/_func.pxi":7788 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7790 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7791 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7791, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7790 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7792 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7793 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7794 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7795 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7796 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7797 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7798 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7797 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7799 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7800 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7802 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__936, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7802, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7803 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7804 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LN_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LN_Lookback()); + + /* "talib/_func.pxi":7805 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7805, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7806 + * lookback = begidx + lib.TA_LN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7807 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7808 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7809 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7810 + * outreal_data[i] = NaN + * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7811 + * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7766 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7815 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_213LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_212LOG10[] = " LOG10(real)\n\n Vector Log10 (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_213LOG10 = {"LOG10", (PyCFunction)__pyx_pw_5talib_7_ta_lib_213LOG10, METH_O, __pyx_doc_5talib_7_ta_lib_212LOG10}; +static PyObject *__pyx_pw_5talib_7_ta_lib_213LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("LOG10 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7815, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_212LOG10(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_212LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("LOG10", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7835 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7836 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__937, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7836, __pyx_L1_error) + + /* "talib/_func.pxi":7835 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7837 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7838 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__938, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7838, __pyx_L1_error) + + /* "talib/_func.pxi":7837 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7839 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7840 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7840, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7839 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7841 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7842 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7843 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7844 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7845 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7846 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7847 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7846 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7848 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7849 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7851 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LOG10_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__939, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7851, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7852 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_LOG10_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7853 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LOG10_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_LOG10_Lookback()); + + /* "talib/_func.pxi":7854 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LOG10_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7854, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7855 + * lookback = begidx + lib.TA_LOG10_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7856 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7857 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LOG10", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7858 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LOG10", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LOG10(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7859 + * outreal_data[i] = NaN + * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LOG10", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LOG10, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7860 + * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_LOG10", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7815 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.LOG10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7864 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_215MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_214MA[] = " MA(real[, timeperiod=?, matype=?])\n\n Moving average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_215MA = {"MA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_215MA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_214MA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_215MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_matype,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MA") < 0)) __PYX_ERR(2, 7864, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7864, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7864, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7864, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7864, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_214MA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_214MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7887 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7888 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__940, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7888, __pyx_L1_error) + + /* "talib/_func.pxi":7887 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7889 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7890 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__941, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7890, __pyx_L1_error) + + /* "talib/_func.pxi":7889 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7891 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7892 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7892, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7891 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7893 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7894 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7895 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7896 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7897 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7898 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7899 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7898 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7900 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7901 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7903 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__942, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7903, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7904 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7905 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MA_Lookback(__pyx_v_timeperiod, __pyx_v_matype)); + + /* "talib/_func.pxi":7906 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7906, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7907 + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":7908 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7909 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7910 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7911 + * outreal_data[i] = NaN + * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7912 + * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":7864 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7916 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_217MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_216MACD[] = " MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?])\n\n Moving Average Convergence/Divergence (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_217MACD = {"MACD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_217MACD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_216MACD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_217MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_signalperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MACD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_signalperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACD") < 0)) __PYX_ERR(2, 7916, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7916, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7916, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7916, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MACD", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7916, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7916, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_216MACD(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_216MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outmacd = 0; + double *__pyx_v_outmacd_data; + PyArrayObject *__pyx_v_outmacdsignal = 0; + double *__pyx_v_outmacdsignal_data; + PyArrayObject *__pyx_v_outmacdhist = 0; + double *__pyx_v_outmacdhist_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MACD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":7946 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7947 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__943, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7947, __pyx_L1_error) + + /* "talib/_func.pxi":7946 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":7948 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7949 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__944, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7949, __pyx_L1_error) + + /* "talib/_func.pxi":7948 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":7950 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7951 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7951, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7950 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":7952 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":7953 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":7954 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":7955 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7956 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":7957 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":7958 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":7957 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":7959 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":7960 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":7962 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__945, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 7962, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":7963 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":7964 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) # <<<<<<<<<<<<<< + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MACD_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod)); + + /* "talib/_func.pxi":7965 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7965, __pyx_L1_error) + __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7966 + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + */ + __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); + + /* "talib/_func.pxi":7967 + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7968 + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + */ + (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7969 + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7969, __pyx_L1_error) + __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7970 + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + */ + __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); + + /* "talib/_func.pxi":7971 + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7972 + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + */ + (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7973 + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 7973, __pyx_L1_error) + __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":7974 + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + */ + __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); + + /* "talib/_func.pxi":7975 + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":7976 + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACD", retCode) + */ + (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":7977 + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACD", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACD(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":7978 + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACD", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":7979 + * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACD", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":7916 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":7983 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_219MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_218MACDEXT[] = " MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?])\n\n MACD with controllable MA type (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n fastmatype: 0\n slowperiod: 26\n slowmatype: 0\n signalperiod: 9\n signalmatype: 0\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_219MACDEXT = {"MACDEXT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_219MACDEXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_218MACDEXT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_219MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_fastmatype; + int __pyx_v_slowperiod; + int __pyx_v_slowmatype; + int __pyx_v_signalperiod; + int __pyx_v_signalmatype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MACDEXT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_fastmatype,&__pyx_n_s_slowperiod,&__pyx_n_s_slowmatype,&__pyx_n_s_signalperiod,&__pyx_n_s_signalmatype,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastmatype); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowmatype); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalmatype); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDEXT") < 0)) __PYX_ERR(2, 7983, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_fastmatype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_fastmatype = ((int)0); + } + if (values[3]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_slowmatype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_slowmatype = ((int)0); + } + if (values[5]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + if (values[6]) { + __pyx_v_signalmatype = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_signalmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 7983, __pyx_L3_error) + } else { + __pyx_v_signalmatype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MACDEXT", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 7983, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 7983, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_218MACDEXT(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_218MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outmacd = 0; + double *__pyx_v_outmacd_data; + PyArrayObject *__pyx_v_outmacdsignal = 0; + double *__pyx_v_outmacdsignal_data; + PyArrayObject *__pyx_v_outmacdhist = 0; + double *__pyx_v_outmacdhist_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MACDEXT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8016 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8017 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__946, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8017, __pyx_L1_error) + + /* "talib/_func.pxi":8016 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8018 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8019 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__947, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8019, __pyx_L1_error) + + /* "talib/_func.pxi":8018 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8020 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8021 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8021, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8020 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8022 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8023 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8024 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8025 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8026 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8027 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8028 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8027 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8029 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8030 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8032 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__948, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8032, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8033 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8034 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) # <<<<<<<<<<<<<< + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MACDEXT_Lookback(__pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype)); + + /* "talib/_func.pxi":8035 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8035, __pyx_L1_error) + __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8036 + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + */ + __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); + + /* "talib/_func.pxi":8037 + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8038 + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + */ + (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8039 + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8039, __pyx_L1_error) + __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8040 + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + */ + __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); + + /* "talib/_func.pxi":8041 + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8042 + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + */ + (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8043 + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8043, __pyx_L1_error) + __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8044 + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + */ + __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); + + /* "talib/_func.pxi":8045 + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8046 + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDEXT", retCode) + */ + (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8047 + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACDEXT", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACDEXT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8048 + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDEXT", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACDEXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8049 + * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDEXT", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":7983 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_221MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_220MACDFIX[] = " MACDFIX(real[, signalperiod=?])\n\n Moving Average Convergence/Divergence Fix 12/26 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_221MACDFIX = {"MACDFIX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_221MACDFIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_220MACDFIX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_221MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_signalperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MACDFIX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_signalperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDFIX") < 0)) __PYX_ERR(2, 8053, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8053, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MACDFIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8053, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8053, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_220MACDFIX(__pyx_self, __pyx_v_real, __pyx_v_signalperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_220MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outmacd = 0; + double *__pyx_v_outmacd_data; + PyArrayObject *__pyx_v_outmacdsignal = 0; + double *__pyx_v_outmacdsignal_data; + PyArrayObject *__pyx_v_outmacdhist = 0; + double *__pyx_v_outmacdhist_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MACDFIX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8081 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8082 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__949, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8082, __pyx_L1_error) + + /* "talib/_func.pxi":8081 + * np.ndarray outmacdhist + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8083 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8084 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__950, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8084, __pyx_L1_error) + + /* "talib/_func.pxi":8083 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8085 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8086 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8086, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8085 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8087 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8088 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8089 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8090 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8091 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8092 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8093 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8092 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8094 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8095 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8097 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__951, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8097, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8098 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8099 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) # <<<<<<<<<<<<<< + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MACDFIX_Lookback(__pyx_v_signalperiod)); + + /* "talib/_func.pxi":8100 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8100, __pyx_L1_error) + __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8101 + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + */ + __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); + + /* "talib/_func.pxi":8102 + * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8103 + * outmacd_data = outmacd.data + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + */ + (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8104 + * for i from 0 <= i < min(lookback, length): + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8104, __pyx_L1_error) + __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8105 + * outmacd_data[i] = NaN + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + */ + __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); + + /* "talib/_func.pxi":8106 + * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8107 + * outmacdsignal_data = outmacdsignal.data + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + */ + (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8108 + * for i from 0 <= i < min(lookback, length): + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8108, __pyx_L1_error) + __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8109 + * outmacdsignal_data[i] = NaN + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + */ + __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); + + /* "talib/_func.pxi":8110 + * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8111 + * outmacdhist_data = outmacdhist.data + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDFIX", retCode) + */ + (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8112 + * for i from 0 <= i < min(lookback, length): + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACDFIX", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACDFIX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8113 + * outmacdhist_data[i] = NaN + * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDFIX", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACDFIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8114 + * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) + * _ta_check_success("TA_MACDFIX", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":8053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); + __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8118 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_223MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_222MAMA[] = " MAMA(real[, fastlimit=?, slowlimit=?])\n\n MESA Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastlimit: 0.5\n slowlimit: 0.05\n Outputs:\n mama\n fama\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_223MAMA = {"MAMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_223MAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_222MAMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_223MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + double __pyx_v_fastlimit; + double __pyx_v_slowlimit; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MAMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastlimit,&__pyx_n_s_slowlimit,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastlimit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowlimit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAMA") < 0)) __PYX_ERR(2, 8118, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastlimit = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fastlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 8118, __pyx_L3_error) + } else { + __pyx_v_fastlimit = ((double)-4e37); + } + if (values[2]) { + __pyx_v_slowlimit = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_slowlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 8118, __pyx_L3_error) + } else { + __pyx_v_slowlimit = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MAMA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8118, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8118, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_222MAMA(__pyx_self, __pyx_v_real, __pyx_v_fastlimit, __pyx_v_slowlimit); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_222MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outmama = 0; + double *__pyx_v_outmama_data; + PyArrayObject *__pyx_v_outfama = 0; + double *__pyx_v_outfama_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MAMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8144 + * np.ndarray outfama + * double* outfama_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8145 + * double* outfama_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__952, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8145, __pyx_L1_error) + + /* "talib/_func.pxi":8144 + * np.ndarray outfama + * double* outfama_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8146 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8147 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__953, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8147, __pyx_L1_error) + + /* "talib/_func.pxi":8146 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8148 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8149 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8149, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8148 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8150 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8151 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8152 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8153 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8154 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8155 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8156 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8155 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8157 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8158 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8160 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__954, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8160, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8161 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) + * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8162 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) # <<<<<<<<<<<<<< + * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmama_data = outmama.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MAMA_Lookback(__pyx_v_fastlimit, __pyx_v_slowlimit)); + + /* "talib/_func.pxi":8163 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) + * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmama_data = outmama.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8163, __pyx_L1_error) + __pyx_v_outmama = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8164 + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) + * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmama_data = outmama.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmama_data[i] = NaN + */ + __pyx_v_outmama_data = ((double *)__pyx_v_outmama->data); + + /* "talib/_func.pxi":8165 + * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmama_data = outmama.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmama_data[i] = NaN + * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8166 + * outmama_data = outmama.data + * for i from 0 <= i < min(lookback, length): + * outmama_data[i] = NaN # <<<<<<<<<<<<<< + * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfama_data = outfama.data + */ + (__pyx_v_outmama_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8167 + * for i from 0 <= i < min(lookback, length): + * outmama_data[i] = NaN + * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outfama_data = outfama.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8167, __pyx_L1_error) + __pyx_v_outfama = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8168 + * outmama_data[i] = NaN + * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfama_data = outfama.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outfama_data[i] = NaN + */ + __pyx_v_outfama_data = ((double *)__pyx_v_outfama->data); + + /* "talib/_func.pxi":8169 + * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfama_data = outfama.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outfama_data[i] = NaN + * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8170 + * outfama_data = outfama.data + * for i from 0 <= i < min(lookback, length): + * outfama_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) + * _ta_check_success("TA_MAMA", retCode) + */ + (__pyx_v_outfama_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8171 + * for i from 0 <= i < min(lookback, length): + * outfama_data[i] = NaN + * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAMA", retCode) + * return outmama , outfama + */ + __pyx_v_retCode = TA_MAMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastlimit, __pyx_v_slowlimit, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmama_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfama_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8172 + * outfama_data[i] = NaN + * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) + * _ta_check_success("TA_MAMA", retCode) # <<<<<<<<<<<<<< + * return outmama , outfama + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8173 + * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) + * _ta_check_success("TA_MAMA", retCode) + * return outmama , outfama # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outmama)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmama)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmama)); + __Pyx_INCREF(((PyObject *)__pyx_v_outfama)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outfama)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfama)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":8118 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outmama); + __Pyx_XDECREF((PyObject *)__pyx_v_outfama); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_225MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_224MAVP[] = " MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?])\n\n Moving average with variable period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n periods: (any ndarray)\n Parameters:\n minperiod: 2\n maxperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_225MAVP = {"MAVP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_225MAVP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_224MAVP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_225MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + PyArrayObject *__pyx_v_periods = 0; + int __pyx_v_minperiod; + int __pyx_v_maxperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MAVP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_periods,&__pyx_n_s_minperiod,&__pyx_n_s_maxperiod,&__pyx_n_s_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, 1); __PYX_ERR(2, 8177, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxperiod); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAVP") < 0)) __PYX_ERR(2, 8177, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + __pyx_v_periods = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_minperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8177, __pyx_L3_error) + } else { + __pyx_v_minperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_maxperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8177, __pyx_L3_error) + } else { + __pyx_v_maxperiod = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8177, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periods), __pyx_ptype_5numpy_ndarray, 0, "periods", 0))) __PYX_ERR(2, 8177, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_224MAVP(__pyx_self, __pyx_v_real, __pyx_v_periods, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_224MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + double *__pyx_v_periods_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MAVP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + __Pyx_INCREF((PyObject *)__pyx_v_periods); + + /* "talib/_func.pxi":8203 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8204 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__955, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8204, __pyx_L1_error) + + /* "talib/_func.pxi":8203 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8205 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8206 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__956, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8206, __pyx_L1_error) + + /* "talib/_func.pxi":8205 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8207 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8208 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8208, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8207 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8209 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8210 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("periods is not double") + * if periods.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_periods) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8211 + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") # <<<<<<<<<<<<<< + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__957, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8211, __pyx_L1_error) + + /* "talib/_func.pxi":8210 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("periods is not double") + * if periods.ndim != 1: + */ + } + + /* "talib/_func.pxi":8212 + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + * if periods.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_periods->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8213 + * raise Exception("periods is not double") + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__958, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8213, __pyx_L1_error) + + /* "talib/_func.pxi":8212 + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + * if periods.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8214 + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_periods) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8215 + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) # <<<<<<<<<<<<<< + * periods_data = periods.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_periods); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8215, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_periods, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8214 + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + */ + } + + /* "talib/_func.pxi":8216 + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * if length != periods.shape[0]: + */ + __pyx_v_periods_data = ((double *)__pyx_v_periods->data); + + /* "talib/_func.pxi":8217 + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * if length != periods.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8218 + * periods_data = periods.data + * length = real.shape[0] + * if length != periods.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_periods->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8219 + * length = real.shape[0] + * if length != periods.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__959, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8219, __pyx_L1_error) + + /* "talib/_func.pxi":8218 + * periods_data = periods.data + * length = real.shape[0] + * if length != periods.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8220 + * if length != periods.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8221 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8222 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8223 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = periods_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8224 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = periods_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8223 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = periods_data[i] + */ + } + + /* "talib/_func.pxi":8225 + * if val != val: + * continue + * val = periods_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_periods_data[__pyx_v_i]); + + /* "talib/_func.pxi":8226 + * continue + * val = periods_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8227 + * val = periods_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8226 + * continue + * val = periods_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8228 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8229 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8231 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__960, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8231, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":8232 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8233 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MAVP_Lookback(__pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype)); + + /* "talib/_func.pxi":8234 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8234, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8235 + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8236 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8237 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAVP", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8238 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAVP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MAVP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), ((double *)(__pyx_v_periods_data + __pyx_v_begidx)), __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8239 + * outreal_data[i] = NaN + * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAVP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAVP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8240 + * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAVP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XDECREF((PyObject *)__pyx_v_periods); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8244 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_227MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_226MAX[] = " MAX(real[, timeperiod=?])\n\n Highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_227MAX = {"MAX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_227MAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_226MAX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_227MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MAX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAX") < 0)) __PYX_ERR(2, 8244, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8244, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8244, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8244, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_226MAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_226MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MAX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8266 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8267 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__961, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8267, __pyx_L1_error) + + /* "talib/_func.pxi":8266 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8268 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8269 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__962, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8269, __pyx_L1_error) + + /* "talib/_func.pxi":8268 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8270 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8271 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8271, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8270 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8272 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8273 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8274 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8275 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8276 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8277 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8278 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8277 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8279 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8280 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8282 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__963, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8282, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8283 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8284 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MAX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8285 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8285, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8286 + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8287 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8288 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAX", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8289 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MAX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8290 + * outreal_data[i] = NaN + * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8291 + * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MAX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8244 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8295 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_229MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_228MAXINDEX[] = " MAXINDEX(real[, timeperiod=?])\n\n Index of highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_229MAXINDEX = {"MAXINDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_229MAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_228MAXINDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_229MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MAXINDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAXINDEX") < 0)) __PYX_ERR(2, 8295, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8295, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8295, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8295, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_228MAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_228MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MAXINDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8317 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8318 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__964, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8318, __pyx_L1_error) + + /* "talib/_func.pxi":8317 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8319 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8320 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__965, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8320, __pyx_L1_error) + + /* "talib/_func.pxi":8319 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8321 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8322 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8322, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8321 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8323 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8324 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8325 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8326 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8327 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8328 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8329 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8328 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8330 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8331 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8333 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__966, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8333, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8334 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8335 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MAXINDEX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8336 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8336, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8337 + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":8338 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8339 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MAXINDEX", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":8340 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAXINDEX", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_MAXINDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8341 + * outinteger_data[i] = 0 + * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MAXINDEX", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8342 + * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MAXINDEX", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":8295 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8346 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_231MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_230MEDPRICE[] = " MEDPRICE(high, low)\n\n Median Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_231MEDPRICE = {"MEDPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_231MEDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_230MEDPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_231MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MEDPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, 1); __PYX_ERR(2, 8346, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MEDPRICE") < 0)) __PYX_ERR(2, 8346, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8346, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 8346, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 8346, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_230MEDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_230MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MEDPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":8367 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8368 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__967, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8368, __pyx_L1_error) + + /* "talib/_func.pxi":8367 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":8369 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8370 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__968, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8370, __pyx_L1_error) + + /* "talib/_func.pxi":8369 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8371 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8372 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8372, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8371 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":8373 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":8374 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8375 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__969, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8375, __pyx_L1_error) + + /* "talib/_func.pxi":8374 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":8376 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8377 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__970, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8377, __pyx_L1_error) + + /* "talib/_func.pxi":8376 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8378 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8379 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8379, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8378 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":8380 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":8381 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":8382 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8383 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__971, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8383, __pyx_L1_error) + + /* "talib/_func.pxi":8382 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8384 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8385 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8386 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":8387 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8388 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8387 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":8389 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":8390 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8391 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8390 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8392 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8393 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8395 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__972, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8395, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":8396 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8397 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MEDPRICE_Lookback()); + + /* "talib/_func.pxi":8398 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8398, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8399 + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8400 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8401 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MEDPRICE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8402 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MEDPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MEDPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8403 + * outreal_data[i] = NaN + * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MEDPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MEDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8404 + * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MEDPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8346 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8408 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_233MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_232MFI[] = " MFI(high, low, close, volume[, timeperiod=?])\n\n Money Flow Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_233MFI = {"MFI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_233MFI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_232MFI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_233MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MFI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_timeperiod,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 1); __PYX_ERR(2, 8408, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 2); __PYX_ERR(2, 8408, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 3); __PYX_ERR(2, 8408, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MFI") < 0)) __PYX_ERR(2, 8408, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8408, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8408, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 8408, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 8408, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 8408, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(2, 8408, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_232MFI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_232MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MFI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_func.pxi":8433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8434 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__973, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8434, __pyx_L1_error) + + /* "talib/_func.pxi":8433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":8435 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8436 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__974, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8436, __pyx_L1_error) + + /* "talib/_func.pxi":8435 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8437 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8438 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8438, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8437 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":8439 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":8440 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8441 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__975, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8441, __pyx_L1_error) + + /* "talib/_func.pxi":8440 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":8442 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8443 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__976, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8443, __pyx_L1_error) + + /* "talib/_func.pxi":8442 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8444 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8445 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8445, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8444 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":8446 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":8447 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8448 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__977, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8448, __pyx_L1_error) + + /* "talib/_func.pxi":8447 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":8449 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8450 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__978, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8450, __pyx_L1_error) + + /* "talib/_func.pxi":8449 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8451 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8452 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8452, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8451 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":8453 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":8454 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8455 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__979, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8455, __pyx_L1_error) + + /* "talib/_func.pxi":8454 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_func.pxi":8456 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8457 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__980, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8457, __pyx_L1_error) + + /* "talib/_func.pxi":8456 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8458 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8459 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8459, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8458 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_func.pxi":8460 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_func.pxi":8461 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":8462 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8463 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__981, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8463, __pyx_L1_error) + + /* "talib/_func.pxi":8462 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":8464 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8465 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__982, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8465, __pyx_L1_error) + + /* "talib/_func.pxi":8464 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_func.pxi":8466 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8467 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__983, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8467, __pyx_L1_error) + + /* "talib/_func.pxi":8466 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8468 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8469 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8470 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":8471 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8472 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":8471 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":8473 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":8474 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8475 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":8474 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":8476 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":8477 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8478 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = volume_data[i] + * if val != val: + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":8477 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + } + + /* "talib/_func.pxi":8479 + * if val != val: + * continue + * val = volume_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); + + /* "talib/_func.pxi":8480 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8481 + * val = volume_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L18_continue; + + /* "talib/_func.pxi":8480 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8482 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8483 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L19_break; + __pyx_L18_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8485 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__984, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8485, __pyx_L1_error) + } + __pyx_L19_break:; + + /* "talib/_func.pxi":8486 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8487 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MFI_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8488 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8488, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8489 + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8490 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8491 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MFI", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8492 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MFI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MFI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8493 + * outreal_data[i] = NaN + * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MFI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MFI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8494 + * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MFI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8408 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8498 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_235MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_234MIDPOINT[] = " MIDPOINT(real[, timeperiod=?])\n\n MidPoint over period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_235MIDPOINT = {"MIDPOINT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_235MIDPOINT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_234MIDPOINT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_235MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MIDPOINT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPOINT") < 0)) __PYX_ERR(2, 8498, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8498, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MIDPOINT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8498, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8498, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_234MIDPOINT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_234MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MIDPOINT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8520 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8521 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__985, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8521, __pyx_L1_error) + + /* "talib/_func.pxi":8520 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8522 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8523 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__986, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8523, __pyx_L1_error) + + /* "talib/_func.pxi":8522 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8524 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8525 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8525, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8524 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8526 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8527 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8528 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8529 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8530 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8531 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8532 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8531 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8533 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8534 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8536 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__987, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8536, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8537 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8538 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MIDPOINT_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8539 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8539, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8540 + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8541 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8542 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPOINT", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8543 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIDPOINT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIDPOINT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8544 + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPOINT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIDPOINT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8545 + * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPOINT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8498 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8549 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_237MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_236MIDPRICE[] = " MIDPRICE(high, low[, timeperiod=?])\n\n Midpoint Price over period (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_237MIDPRICE = {"MIDPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_237MIDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_236MIDPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_237MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MIDPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, 1); __PYX_ERR(2, 8549, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPRICE") < 0)) __PYX_ERR(2, 8549, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8549, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8549, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 8549, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 8549, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_236MIDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_236MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MIDPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":8572 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8573 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__988, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8573, __pyx_L1_error) + + /* "talib/_func.pxi":8572 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":8574 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8575 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__989, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8575, __pyx_L1_error) + + /* "talib/_func.pxi":8574 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8576 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8577 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8577, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8576 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":8578 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":8579 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8580 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__990, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8580, __pyx_L1_error) + + /* "talib/_func.pxi":8579 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":8581 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8582 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__991, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8582, __pyx_L1_error) + + /* "talib/_func.pxi":8581 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8583 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8584 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8584, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8583 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":8585 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":8586 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":8587 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8588 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__992, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8588, __pyx_L1_error) + + /* "talib/_func.pxi":8587 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8589 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8590 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8591 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":8592 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8593 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8592 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":8594 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":8595 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8596 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8595 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8597 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8598 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8600 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__993, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8600, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":8601 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8602 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MIDPRICE_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8603 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8603, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8604 + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8605 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8606 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPRICE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8607 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIDPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIDPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8608 + * outreal_data[i] = NaN + * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8609 + * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIDPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8549 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_239MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_238MIN[] = " MIN(real[, timeperiod=?])\n\n Lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_239MIN = {"MIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_239MIN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_238MIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_239MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MIN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIN") < 0)) __PYX_ERR(2, 8613, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8613, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MIN", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8613, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8613, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_238MIN(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_238MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8635 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8636 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__994, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8636, __pyx_L1_error) + + /* "talib/_func.pxi":8635 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8637 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8638 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__995, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8638, __pyx_L1_error) + + /* "talib/_func.pxi":8637 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8639 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8640 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8640, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8639 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8641 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8642 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8643 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8644 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8645 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8646 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8647 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8646 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8648 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8649 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8651 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__996, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8651, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8652 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8653 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MIN_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8654 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8654, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8655 + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8656 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8657 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8658 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8659 + * outreal_data[i] = NaN + * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8660 + * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_241MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_240MININDEX[] = " MININDEX(real[, timeperiod=?])\n\n Index of lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_241MININDEX = {"MININDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_241MININDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_240MININDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_241MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MININDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MININDEX") < 0)) __PYX_ERR(2, 8664, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8664, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MININDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8664, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8664, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_240MININDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_240MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outinteger = 0; + int *__pyx_v_outinteger_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MININDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8686 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8687 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__997, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8687, __pyx_L1_error) + + /* "talib/_func.pxi":8686 + * np.ndarray outinteger + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8688 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8689 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__998, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8689, __pyx_L1_error) + + /* "talib/_func.pxi":8688 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8690 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8691 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8691, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8690 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8692 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8693 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8694 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8695 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8696 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8697 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8698 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8697 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8699 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8700 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8702 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__999, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8702, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8703 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8704 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MININDEX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8705 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8705, __pyx_L1_error) + __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8706 + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + */ + __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); + + /* "talib/_func.pxi":8707 + * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outinteger_data[i] = 0 + * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8708 + * outinteger_data = outinteger.data + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MININDEX", retCode) + */ + (__pyx_v_outinteger_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":8709 + * for i from 0 <= i < min(lookback, length): + * outinteger_data[i] = 0 + * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MININDEX", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_MININDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8710 + * outinteger_data[i] = 0 + * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MININDEX", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MININDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8711 + * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) + * _ta_check_success("TA_MININDEX", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); + __pyx_r = ((PyObject *)__pyx_v_outinteger); + goto __pyx_L0; + + /* "talib/_func.pxi":8664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_243MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_242MINMAX[] = " MINMAX(real[, timeperiod=?])\n\n Lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n min\n max\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_243MINMAX = {"MINMAX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_243MINMAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_242MINMAX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_243MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MINMAX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAX") < 0)) __PYX_ERR(2, 8715, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8715, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MINMAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8715, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8715, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_242MINMAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_242MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outmin = 0; + double *__pyx_v_outmin_data; + PyArrayObject *__pyx_v_outmax = 0; + double *__pyx_v_outmax_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MINMAX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8740 + * np.ndarray outmax + * double* outmax_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8741 + * double* outmax_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1000, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8741, __pyx_L1_error) + + /* "talib/_func.pxi":8740 + * np.ndarray outmax + * double* outmax_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8742 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8743 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1001, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8743, __pyx_L1_error) + + /* "talib/_func.pxi":8742 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8744 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8745 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8745, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8744 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8746 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8747 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8748 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8749 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8750 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8751 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8752 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8751 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8753 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8754 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8756 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1002, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8756, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8757 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) + * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8758 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmin_data = outmin.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MINMAX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8759 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) + * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmin_data = outmin.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8759, __pyx_L1_error) + __pyx_v_outmin = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8760 + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) + * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmin_data = outmin.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmin_data[i] = NaN + */ + __pyx_v_outmin_data = ((double *)__pyx_v_outmin->data); + + /* "talib/_func.pxi":8761 + * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmin_data = outmin.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmin_data[i] = NaN + * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8762 + * outmin_data = outmin.data + * for i from 0 <= i < min(lookback, length): + * outmin_data[i] = NaN # <<<<<<<<<<<<<< + * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmax_data = outmax.data + */ + (__pyx_v_outmin_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8763 + * for i from 0 <= i < min(lookback, length): + * outmin_data[i] = NaN + * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmax_data = outmax.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8763, __pyx_L1_error) + __pyx_v_outmax = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8764 + * outmin_data[i] = NaN + * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmax_data = outmax.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmax_data[i] = NaN + */ + __pyx_v_outmax_data = ((double *)__pyx_v_outmax->data); + + /* "talib/_func.pxi":8765 + * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outmax_data = outmax.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmax_data[i] = NaN + * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8766 + * outmax_data = outmax.data + * for i from 0 <= i < min(lookback, length): + * outmax_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) + * _ta_check_success("TA_MINMAX", retCode) + */ + (__pyx_v_outmax_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8767 + * for i from 0 <= i < min(lookback, length): + * outmax_data[i] = NaN + * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINMAX", retCode) + * return outmin , outmax + */ + __pyx_v_retCode = TA_MINMAX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmin_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmax_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8768 + * outmax_data[i] = NaN + * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) + * _ta_check_success("TA_MINMAX", retCode) # <<<<<<<<<<<<<< + * return outmin , outmax + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINMAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8769 + * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) + * _ta_check_success("TA_MINMAX", retCode) + * return outmin , outmax # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outmin)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmin)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmin)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmax)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmax)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmax)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":8715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outmin); + __Pyx_XDECREF((PyObject *)__pyx_v_outmax); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8773 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_245MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_244MINMAXINDEX[] = " MINMAXINDEX(real[, timeperiod=?])\n\n Indexes of lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n minidx\n maxidx\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_245MINMAXINDEX = {"MINMAXINDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_245MINMAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_244MINMAXINDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_245MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MINMAXINDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAXINDEX") < 0)) __PYX_ERR(2, 8773, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8773, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MINMAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8773, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8773, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_244MINMAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_244MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outminidx = 0; + int *__pyx_v_outminidx_data; + PyArrayObject *__pyx_v_outmaxidx = 0; + int *__pyx_v_outmaxidx_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MINMAXINDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8798 + * np.ndarray outmaxidx + * int* outmaxidx_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8799 + * int* outmaxidx_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1003, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8799, __pyx_L1_error) + + /* "talib/_func.pxi":8798 + * np.ndarray outmaxidx + * int* outmaxidx_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8800 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8801 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1004, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8801, __pyx_L1_error) + + /* "talib/_func.pxi":8800 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8802 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8803 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8803, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8802 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":8804 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":8805 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":8806 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8807 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8808 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":8809 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8810 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":8809 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8811 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8812 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8814 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1005, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8814, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":8815 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) + * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8816 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outminidx_data = outminidx.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MINMAXINDEX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8817 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) + * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outminidx_data = outminidx.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8817, __pyx_L1_error) + __pyx_v_outminidx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8818 + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) + * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outminidx_data = outminidx.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outminidx_data[i] = 0 + */ + __pyx_v_outminidx_data = ((int *)__pyx_v_outminidx->data); + + /* "talib/_func.pxi":8819 + * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outminidx_data = outminidx.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outminidx_data[i] = 0 + * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8820 + * outminidx_data = outminidx.data + * for i from 0 <= i < min(lookback, length): + * outminidx_data[i] = 0 # <<<<<<<<<<<<<< + * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outmaxidx_data = outmaxidx.data + */ + (__pyx_v_outminidx_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":8821 + * for i from 0 <= i < min(lookback, length): + * outminidx_data[i] = 0 + * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outmaxidx_data = outmaxidx.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8821, __pyx_L1_error) + __pyx_v_outmaxidx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8822 + * outminidx_data[i] = 0 + * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outmaxidx_data = outmaxidx.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outmaxidx_data[i] = 0 + */ + __pyx_v_outmaxidx_data = ((int *)__pyx_v_outmaxidx->data); + + /* "talib/_func.pxi":8823 + * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + * outmaxidx_data = outmaxidx.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outmaxidx_data[i] = 0 + * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8824 + * outmaxidx_data = outmaxidx.data + * for i from 0 <= i < min(lookback, length): + * outmaxidx_data[i] = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) + * _ta_check_success("TA_MINMAXINDEX", retCode) + */ + (__pyx_v_outmaxidx_data[__pyx_v_i]) = 0; + } + + /* "talib/_func.pxi":8825 + * for i from 0 <= i < min(lookback, length): + * outmaxidx_data[i] = 0 + * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINMAXINDEX", retCode) + * return outminidx , outmaxidx + */ + __pyx_v_retCode = TA_MINMAXINDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outminidx_data + __pyx_v_lookback)), ((int *)(__pyx_v_outmaxidx_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8826 + * outmaxidx_data[i] = 0 + * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) + * _ta_check_success("TA_MINMAXINDEX", retCode) # <<<<<<<<<<<<<< + * return outminidx , outmaxidx + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINMAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8827 + * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) + * _ta_check_success("TA_MINMAXINDEX", retCode) + * return outminidx , outmaxidx # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outminidx)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outminidx)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outminidx)); + __Pyx_INCREF(((PyObject *)__pyx_v_outmaxidx)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outmaxidx)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmaxidx)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":8773 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outminidx); + __Pyx_XDECREF((PyObject *)__pyx_v_outmaxidx); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8831 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_247MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_246MINUS_DI[] = " MINUS_DI(high, low, close[, timeperiod=?])\n\n Minus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_247MINUS_DI = {"MINUS_DI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_247MINUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_246MINUS_DI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_247MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MINUS_DI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 1); __PYX_ERR(2, 8831, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 2); __PYX_ERR(2, 8831, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DI") < 0)) __PYX_ERR(2, 8831, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8831, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8831, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 8831, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 8831, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 8831, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_246MINUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_246MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MINUS_DI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":8855 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8856 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1006, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8856, __pyx_L1_error) + + /* "talib/_func.pxi":8855 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":8857 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8858 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1007, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8858, __pyx_L1_error) + + /* "talib/_func.pxi":8857 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8859 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8860 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8860, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8859 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":8861 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":8862 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8863 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1008, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8863, __pyx_L1_error) + + /* "talib/_func.pxi":8862 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":8864 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8865 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1009, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8865, __pyx_L1_error) + + /* "talib/_func.pxi":8864 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8866 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8867 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8867, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8866 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":8868 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":8869 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8870 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1010, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8870, __pyx_L1_error) + + /* "talib/_func.pxi":8869 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":8871 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8872 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1011, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8872, __pyx_L1_error) + + /* "talib/_func.pxi":8871 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8873 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8874 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8874, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8873 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":8875 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":8876 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":8877 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8878 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1012, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8878, __pyx_L1_error) + + /* "talib/_func.pxi":8877 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":8879 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8880 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1013, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8880, __pyx_L1_error) + + /* "talib/_func.pxi":8879 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8881 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8882 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8883 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":8884 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8885 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":8884 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":8886 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":8887 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8888 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":8887 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":8889 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":8890 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8891 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":8890 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8892 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8893 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8895 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1014, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8895, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":8896 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8897 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MINUS_DI_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8898 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8898, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8899 + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8900 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8901 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DI", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8902 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINUS_DI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MINUS_DI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8903 + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8904 + * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8831 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_249MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_248MINUS_DM[] = " MINUS_DM(high, low[, timeperiod=?])\n\n Minus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_249MINUS_DM = {"MINUS_DM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_249MINUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_248MINUS_DM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_249MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MINUS_DM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, 1); __PYX_ERR(2, 8908, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DM") < 0)) __PYX_ERR(2, 8908, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8908, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8908, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 8908, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 8908, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_248MINUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_248MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MINUS_DM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":8931 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8932 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1015, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8932, __pyx_L1_error) + + /* "talib/_func.pxi":8931 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":8933 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8934 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1016, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8934, __pyx_L1_error) + + /* "talib/_func.pxi":8933 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8935 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8936 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8936, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8935 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":8937 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":8938 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8939 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1017, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8939, __pyx_L1_error) + + /* "talib/_func.pxi":8938 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":8940 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8941 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1018, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8941, __pyx_L1_error) + + /* "talib/_func.pxi":8940 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8942 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8943 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8943, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8942 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":8944 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":8945 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":8946 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8947 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1019, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8947, __pyx_L1_error) + + /* "talib/_func.pxi":8946 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":8948 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":8949 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8950 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":8951 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8952 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8951 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":8953 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":8954 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8955 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":8954 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":8956 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":8957 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":8959 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1020, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8959, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":8960 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":8961 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MINUS_DM_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":8962 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8962, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8963 + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":8964 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":8965 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DM", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":8966 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINUS_DM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MINUS_DM(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":8967 + * outreal_data[i] = NaN + * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":8968 + * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MINUS_DM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":8972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_251MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_250MOM[] = " MOM(real[, timeperiod=?])\n\n Momentum (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_251MOM = {"MOM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_251MOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_250MOM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_251MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MOM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MOM") < 0)) __PYX_ERR(2, 8972, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8972, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MOM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 8972, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 8972, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_250MOM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_250MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MOM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":8994 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8995 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1021, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8995, __pyx_L1_error) + + /* "talib/_func.pxi":8994 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":8996 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8997 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1022, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 8997, __pyx_L1_error) + + /* "talib/_func.pxi":8996 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":8998 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":8999 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 8999, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":8998 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9000 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9001 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9002 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9003 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9004 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9005 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9006 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9005 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9007 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9008 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9010 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1023, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9010, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9011 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9012 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MOM_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9013 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9013, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9014 + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9015 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9016 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MOM", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9017 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MOM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MOM(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9018 + * outreal_data[i] = NaN + * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MOM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9019 + * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MOM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":8972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9023 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_253MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_252MULT[] = " MULT(real0, real1)\n\n Vector Arithmetic Mult (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_253MULT = {"MULT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_253MULT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_252MULT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_253MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MULT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, 1); __PYX_ERR(2, 9023, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MULT") < 0)) __PYX_ERR(2, 9023, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9023, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 9023, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 9023, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_252MULT(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_252MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("MULT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":9045 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9046 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1024, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9046, __pyx_L1_error) + + /* "talib/_func.pxi":9045 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":9047 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9048 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1025, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9048, __pyx_L1_error) + + /* "talib/_func.pxi":9047 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9049 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9050 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9050, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9049 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":9051 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":9052 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9053 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1026, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9053, __pyx_L1_error) + + /* "talib/_func.pxi":9052 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":9054 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9055 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1027, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9055, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9055, __pyx_L1_error) + + /* "talib/_func.pxi":9054 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9056 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9057 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9057, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9056 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":9058 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":9059 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":9060 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9061 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1028, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9061, __pyx_L1_error) + + /* "talib/_func.pxi":9060 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9062 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9063 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9064 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":9065 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9066 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9065 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":9067 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":9068 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9069 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9068 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9070 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9071 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9073 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MULT_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1029, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9073, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":9074 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_MULT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9075 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MULT_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_MULT_Lookback()); + + /* "talib/_func.pxi":9076 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MULT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9076, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9077 + * lookback = begidx + lib.TA_MULT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9078 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9079 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MULT", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9080 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MULT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MULT(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9081 + * outreal_data[i] = NaN + * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MULT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MULT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9082 + * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_MULT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9023 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9086 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_255NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_254NATR[] = " NATR(high, low, close[, timeperiod=?])\n\n Normalized Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_255NATR = {"NATR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_255NATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_254NATR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_255NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("NATR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 1); __PYX_ERR(2, 9086, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 2); __PYX_ERR(2, 9086, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NATR") < 0)) __PYX_ERR(2, 9086, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9086, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9086, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 9086, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 9086, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 9086, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_254NATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_254NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("NATR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":9110 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9111 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1030, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9111, __pyx_L1_error) + + /* "talib/_func.pxi":9110 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":9112 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9113 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1031, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9113, __pyx_L1_error) + + /* "talib/_func.pxi":9112 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9114 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9115 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9115, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9114 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":9116 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":9117 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9118 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1032, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9118, __pyx_L1_error) + + /* "talib/_func.pxi":9117 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":9119 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9120 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1033, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9120, __pyx_L1_error) + + /* "talib/_func.pxi":9119 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9121 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9122 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9122, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9121 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":9123 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":9124 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9125 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1034, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9125, __pyx_L1_error) + + /* "talib/_func.pxi":9124 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":9126 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9127 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1035, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9127, __pyx_L1_error) + + /* "talib/_func.pxi":9126 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9128 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9129 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9129, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9128 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":9130 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":9131 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":9132 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9133 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1036, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9133, __pyx_L1_error) + + /* "talib/_func.pxi":9132 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":9134 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9135 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1037, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9135, __pyx_L1_error) + + /* "talib/_func.pxi":9134 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9136 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9137 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9138 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":9139 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9140 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9139 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":9141 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":9142 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9143 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9142 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":9144 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":9145 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9146 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9145 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9147 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9148 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9150 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1038, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9150, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":9151 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9152 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_NATR_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9153 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9153, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9154 + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9155 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9156 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_NATR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9157 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_NATR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_NATR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9158 + * outreal_data[i] = NaN + * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_NATR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_NATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9159 + * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_NATR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9086 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9163 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_257OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_256OBV[] = " OBV(real, volume)\n\n On Balance Volume (Volume Indicators)\n\n Inputs:\n real: (any ndarray)\n prices: ['volume']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_257OBV = {"OBV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_257OBV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_256OBV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_257OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + PyArrayObject *__pyx_v_volume = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("OBV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_volume,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, 1); __PYX_ERR(2, 9163, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "OBV") < 0)) __PYX_ERR(2, 9163, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real = ((PyArrayObject *)values[0]); + __pyx_v_volume = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9163, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9163, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(2, 9163, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_256OBV(__pyx_self, __pyx_v_real, __pyx_v_volume); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_256OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("OBV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_func.pxi":9185 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9186 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1039, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9186, __pyx_L1_error) + + /* "talib/_func.pxi":9185 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9187 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9188 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1040, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9188, __pyx_L1_error) + + /* "talib/_func.pxi":9187 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9189 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9190 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9190, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9189 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9191 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9192 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9193 + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1041, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9193, __pyx_L1_error) + + /* "talib/_func.pxi":9192 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_func.pxi":9194 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9195 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1042, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9195, __pyx_L1_error) + + /* "talib/_func.pxi":9194 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9196 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9197 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9197, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9196 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_func.pxi":9198 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * if length != volume.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_func.pxi":9199 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9200 + * volume_data = volume.data + * length = real.shape[0] + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9201 + * length = real.shape[0] + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1043, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9201, __pyx_L1_error) + + /* "talib/_func.pxi":9200 + * volume_data = volume.data + * length = real.shape[0] + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9202 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9203 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9204 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9205 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9206 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = volume_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9205 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = volume_data[i] + */ + } + + /* "talib/_func.pxi":9207 + * if val != val: + * continue + * val = volume_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); + + /* "talib/_func.pxi":9208 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9209 + * val = volume_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9208 + * continue + * val = volume_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9210 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9211 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9213 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_OBV_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1044, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9213, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":9214 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_OBV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9215 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_OBV_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_OBV_Lookback()); + + /* "talib/_func.pxi":9216 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_OBV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9216, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9217 + * lookback = begidx + lib.TA_OBV_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9218 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9219 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_OBV", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9220 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_OBV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_OBV(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9221 + * outreal_data[i] = NaN + * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_OBV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_OBV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9222 + * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_OBV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9163 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_259PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_258PLUS_DI[] = " PLUS_DI(high, low, close[, timeperiod=?])\n\n Plus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_259PLUS_DI = {"PLUS_DI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_259PLUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_258PLUS_DI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_259PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("PLUS_DI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 1); __PYX_ERR(2, 9226, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 2); __PYX_ERR(2, 9226, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DI") < 0)) __PYX_ERR(2, 9226, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9226, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9226, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 9226, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 9226, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 9226, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_258PLUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_258PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("PLUS_DI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":9250 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9251 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1045, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9251, __pyx_L1_error) + + /* "talib/_func.pxi":9250 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":9252 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9253 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1046, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9253, __pyx_L1_error) + + /* "talib/_func.pxi":9252 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9254 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9255 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9255, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9254 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":9256 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":9257 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9258 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1047, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9258, __pyx_L1_error) + + /* "talib/_func.pxi":9257 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":9259 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9260 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1048, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9260, __pyx_L1_error) + + /* "talib/_func.pxi":9259 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9261 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9262 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9262, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9261 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":9263 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":9264 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9265 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1049, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9265, __pyx_L1_error) + + /* "talib/_func.pxi":9264 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":9266 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9267 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1050, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9267, __pyx_L1_error) + + /* "talib/_func.pxi":9266 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9268 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9269 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9269, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9268 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":9270 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":9271 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":9272 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9273 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1051, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9273, __pyx_L1_error) + + /* "talib/_func.pxi":9272 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":9274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1052, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9275, __pyx_L1_error) + + /* "talib/_func.pxi":9274 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9276 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9277 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9278 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":9279 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9280 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9279 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":9281 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":9282 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9283 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9282 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":9284 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":9285 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9286 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":9285 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9287 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9288 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9290 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1053, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9290, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":9291 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9292 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_PLUS_DI_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9293 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9293, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9294 + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9295 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9296 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DI", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9297 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PLUS_DI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PLUS_DI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9298 + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PLUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9299 + * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9303 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_261PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_260PLUS_DM[] = " PLUS_DM(high, low[, timeperiod=?])\n\n Plus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_261PLUS_DM = {"PLUS_DM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_261PLUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_260PLUS_DM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_261PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("PLUS_DM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, 1); __PYX_ERR(2, 9303, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DM") < 0)) __PYX_ERR(2, 9303, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9303, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9303, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 9303, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 9303, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_260PLUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_260PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("PLUS_DM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":9326 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9327 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1054, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9327, __pyx_L1_error) + + /* "talib/_func.pxi":9326 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":9328 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9329 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1055, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9329, __pyx_L1_error) + + /* "talib/_func.pxi":9328 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9330 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9331 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9331, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9330 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":9332 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":9333 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9334 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1056, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9334, __pyx_L1_error) + + /* "talib/_func.pxi":9333 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":9335 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9336 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1057, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9336, __pyx_L1_error) + + /* "talib/_func.pxi":9335 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9337 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9338 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9338, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9337 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":9339 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":9340 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":9341 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9342 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1058, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9342, __pyx_L1_error) + + /* "talib/_func.pxi":9341 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9343 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9344 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9345 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":9346 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9347 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9346 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":9348 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":9349 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9350 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9349 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9351 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9352 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9354 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1059, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9354, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":9355 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9356 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_PLUS_DM_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9357 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9357, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9358 + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9359 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9360 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DM", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9361 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PLUS_DM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PLUS_DM(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9362 + * outreal_data[i] = NaN + * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PLUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9363 + * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PLUS_DM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9303 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9367 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_263PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_262PPO[] = " PPO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Percentage Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_263PPO = {"PPO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_263PPO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_262PPO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_263PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("PPO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PPO") < 0)) __PYX_ERR(2, 9367, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9367, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9367, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9367, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("PPO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9367, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9367, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_262PPO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_262PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("PPO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9391 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9392 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1060, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9392, __pyx_L1_error) + + /* "talib/_func.pxi":9391 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9393 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9394 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1061, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9394, __pyx_L1_error) + + /* "talib/_func.pxi":9393 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9395 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9396 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9396, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9395 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9397 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9398 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9399 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9400 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9401 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9402 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9403 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9402 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9404 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9405 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9407 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1062, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9407, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9408 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9409 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_PPO_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype)); + + /* "talib/_func.pxi":9410 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9410, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9411 + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9412 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9413 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PPO", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9414 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PPO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PPO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9415 + * outreal_data[i] = NaN + * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PPO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PPO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9416 + * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_PPO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9367 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9420 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_265ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_264ROC[] = " ROC(real[, timeperiod=?])\n\n Rate of change : ((real/prevPrice)-1)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_265ROC = {"ROC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_265ROC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_264ROC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_265ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ROC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROC") < 0)) __PYX_ERR(2, 9420, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9420, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ROC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9420, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9420, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_264ROC(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_264ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ROC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9442 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9443 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1063, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9443, __pyx_L1_error) + + /* "talib/_func.pxi":9442 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9444 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9445 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1064, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9445, __pyx_L1_error) + + /* "talib/_func.pxi":9444 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9446 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9447 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9447, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9446 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9448 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9449 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9450 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9451 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9452 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9453 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9454 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9453 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9455 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9456 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9458 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1065, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9458, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9459 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9460 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ROC_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9461 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9461, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9462 + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9463 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9464 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROC", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9465 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROC(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9466 + * outreal_data[i] = NaN + * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9467 + * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9420 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9471 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_267ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_266ROCP[] = " ROCP(real[, timeperiod=?])\n\n Rate of change Percentage: (real-prevPrice)/prevPrice (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_267ROCP = {"ROCP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_267ROCP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_266ROCP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_267ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ROCP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCP") < 0)) __PYX_ERR(2, 9471, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9471, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ROCP", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9471, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9471, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_266ROCP(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_266ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ROCP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9493 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9494 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1066, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9494, __pyx_L1_error) + + /* "talib/_func.pxi":9493 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9495 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9496 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1067, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9496, __pyx_L1_error) + + /* "talib/_func.pxi":9495 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9497 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9498 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9498, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9497 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9499 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9500 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9501 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9502 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9503 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9504 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9505 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9504 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9506 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9507 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9509 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1068, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9509, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9510 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9511 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ROCP_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9512 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9512, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9513 + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9514 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9515 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCP", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9516 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9517 + * outreal_data[i] = NaN + * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9518 + * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9471 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_269ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_268ROCR[] = " ROCR(real[, timeperiod=?])\n\n Rate of change ratio: (real/prevPrice) (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_269ROCR = {"ROCR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_269ROCR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_268ROCR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_269ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ROCR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR") < 0)) __PYX_ERR(2, 9522, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9522, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ROCR", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9522, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9522, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_268ROCR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_268ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ROCR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9544 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9545 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1069, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9545, __pyx_L1_error) + + /* "talib/_func.pxi":9544 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9546 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9547 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1070, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9547, __pyx_L1_error) + + /* "talib/_func.pxi":9546 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9548 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9549 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9549, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9548 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9550 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9551 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9552 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9553 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9554 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9555 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9556 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9555 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9557 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9558 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9560 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1071, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9560, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9561 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9562 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ROCR_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9563 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9563, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9564 + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9565 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9566 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9567 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9568 + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9569 + * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9573 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_271ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_270ROCR100[] = " ROCR100(real[, timeperiod=?])\n\n Rate of change ratio 100 scale: (real/prevPrice)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_271ROCR100 = {"ROCR100", (PyCFunction)__pyx_pw_5talib_7_ta_lib_271ROCR100, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_270ROCR100}; +static PyObject *__pyx_pw_5talib_7_ta_lib_271ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ROCR100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR100") < 0)) __PYX_ERR(2, 9573, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9573, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ROCR100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9573, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9573, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_270ROCR100(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_270ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ROCR100", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9595 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9596 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1072, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9596, __pyx_L1_error) + + /* "talib/_func.pxi":9595 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9597 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9598 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1073, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9598, __pyx_L1_error) + + /* "talib/_func.pxi":9597 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9599 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9600 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9600, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9599 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9601 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9602 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9603 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9604 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9605 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9606 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9607 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9606 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9608 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9609 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9611 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1074, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9611, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9612 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9613 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ROCR100_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9614 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9614, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9615 + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9616 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9617 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR100", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9618 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCR100", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCR100(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9619 + * outreal_data[i] = NaN + * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR100", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCR100, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9620 + * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ROCR100", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9573 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_273RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_272RSI[] = " RSI(real[, timeperiod=?])\n\n Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_273RSI = {"RSI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_273RSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_272RSI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_273RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("RSI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RSI") < 0)) __PYX_ERR(2, 9624, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9624, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("RSI", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9624, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9624, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_272RSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_272RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("RSI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9646 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9647 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1075, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9647, __pyx_L1_error) + + /* "talib/_func.pxi":9646 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9648 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9649 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1076, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9649, __pyx_L1_error) + + /* "talib/_func.pxi":9648 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9650 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9651 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9651, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9650 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9652 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9653 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9654 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9655 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9656 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9657 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9658 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9657 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9659 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9660 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9662 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1077, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9662, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9663 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9664 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_RSI_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9665 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9665, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9666 + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9667 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9668 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_RSI", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9669 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_RSI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_RSI(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9670 + * outreal_data[i] = NaN + * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_RSI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_RSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9671 + * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_RSI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9675 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_275SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_274SAR[] = " SAR(high, low[, acceleration=?, maximum=?])\n\n Parabolic SAR (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n acceleration: 0.02\n maximum: 0.2\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_275SAR = {"SAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_275SAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_274SAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_275SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + double __pyx_v_acceleration; + double __pyx_v_maximum; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_acceleration,&__pyx_n_s_maximum,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, 1); __PYX_ERR(2, 9675, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceleration); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maximum); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAR") < 0)) __PYX_ERR(2, 9675, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_acceleration = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_acceleration == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9675, __pyx_L3_error) + } else { + __pyx_v_acceleration = ((double)0.02); + } + if (values[3]) { + __pyx_v_maximum = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_maximum == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9675, __pyx_L3_error) + } else { + __pyx_v_maximum = ((double)0.2); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9675, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 9675, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 9675, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_274SAR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_acceleration, __pyx_v_maximum); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_274SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":9699 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9700 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1078, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9700, __pyx_L1_error) + + /* "talib/_func.pxi":9699 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":9701 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9702 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1079, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9702, __pyx_L1_error) + + /* "talib/_func.pxi":9701 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9703 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9704 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9704, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9703 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":9705 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":9706 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9707 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1080, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9707, __pyx_L1_error) + + /* "talib/_func.pxi":9706 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":9708 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9709 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1081, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9709, __pyx_L1_error) + + /* "talib/_func.pxi":9708 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9710 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9711 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9711, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9710 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":9712 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":9713 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":9714 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9715 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1082, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9715, __pyx_L1_error) + + /* "talib/_func.pxi":9714 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9716 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9717 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9718 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":9719 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9720 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9719 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":9721 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":9722 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9723 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9722 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9724 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9725 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9727 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1083, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9727, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":9728 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9729 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SAR_Lookback(__pyx_v_acceleration, __pyx_v_maximum)); + + /* "talib/_func.pxi":9730 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9730, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9731 + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9732 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9733 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9734 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SAR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SAR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_acceleration, __pyx_v_maximum, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9735 + * outreal_data[i] = NaN + * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9736 + * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9675 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9740 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_277SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_276SAREXT[] = " SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?])\n\n Parabolic SAR - Extended (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n startvalue: 0\n offsetonreverse: 0\n accelerationinitlong: 0.02\n accelerationlong: 0.02\n accelerationmaxlong: 0.2\n accelerationinitshort: 0.02\n accelerationshort: 0.02\n accelerationmaxshort: 0.2\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_277SAREXT = {"SAREXT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_277SAREXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_276SAREXT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_277SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + double __pyx_v_startvalue; + double __pyx_v_offsetonreverse; + double __pyx_v_accelerationinitlong; + double __pyx_v_accelerationlong; + double __pyx_v_accelerationmaxlong; + double __pyx_v_accelerationinitshort; + double __pyx_v_accelerationshort; + double __pyx_v_accelerationmaxshort; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SAREXT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_startvalue,&__pyx_n_s_offsetonreverse,&__pyx_n_s_accelerationinitlong,&__pyx_n_s_accelerationlong,&__pyx_n_s_accelerationmaxlong,&__pyx_n_s_accelerationinitshort,&__pyx_n_s_accelerationshort,&__pyx_n_s_accelerationmaxshort,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, 1); __PYX_ERR(2, 9740, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startvalue); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offsetonreverse); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitlong); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationlong); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxlong); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitshort); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationshort); + if (value) { values[8] = value; kw_args--; } + } + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxshort); + if (value) { values[9] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAREXT") < 0)) __PYX_ERR(2, 9740, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_startvalue = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_startvalue == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_startvalue = ((double)-4e37); + } + if (values[3]) { + __pyx_v_offsetonreverse = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_offsetonreverse == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_offsetonreverse = ((double)-4e37); + } + if (values[4]) { + __pyx_v_accelerationinitlong = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_accelerationinitlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationinitlong = ((double)-4e37); + } + if (values[5]) { + __pyx_v_accelerationlong = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_accelerationlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationlong = ((double)-4e37); + } + if (values[6]) { + __pyx_v_accelerationmaxlong = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_accelerationmaxlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationmaxlong = ((double)-4e37); + } + if (values[7]) { + __pyx_v_accelerationinitshort = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_accelerationinitshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationinitshort = ((double)-4e37); + } + if (values[8]) { + __pyx_v_accelerationshort = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_accelerationshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationshort = ((double)-4e37); + } + if (values[9]) { + __pyx_v_accelerationmaxshort = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_accelerationmaxshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 9740, __pyx_L3_error) + } else { + __pyx_v_accelerationmaxshort = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9740, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 9740, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 9740, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_276SAREXT(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_276SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SAREXT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_func.pxi":9770 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9771 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1084, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9771, __pyx_L1_error) + + /* "talib/_func.pxi":9770 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":9772 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9773 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1085, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9773, __pyx_L1_error) + + /* "talib/_func.pxi":9772 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9774 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9775 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9775, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9774 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":9776 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":9777 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9778 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1086, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9778, __pyx_L1_error) + + /* "talib/_func.pxi":9777 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":9779 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9780 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1087, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9780, __pyx_L1_error) + + /* "talib/_func.pxi":9779 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9781 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9782 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9782, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9781 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":9783 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":9784 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":9785 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9786 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1088, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9786, __pyx_L1_error) + + /* "talib/_func.pxi":9785 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":9787 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9788 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9789 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":9790 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9791 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9790 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":9792 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":9793 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9794 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":9793 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9795 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9796 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9798 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1089, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9798, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":9799 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9800 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SAREXT_Lookback(__pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort)); + + /* "talib/_func.pxi":9801 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9801, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9802 + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9803 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9804 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAREXT", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9805 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SAREXT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SAREXT(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9806 + * outreal_data[i] = NaN + * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAREXT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SAREXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9807 + * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SAREXT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9740 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9811 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_279SIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_278SIN[] = " SIN(real)\n\n Vector Trigonometric Sin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_279SIN = {"SIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_279SIN, METH_O, __pyx_doc_5talib_7_ta_lib_278SIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_279SIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SIN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9811, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_278SIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_278SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9831 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9832 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1090, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9832, __pyx_L1_error) + + /* "talib/_func.pxi":9831 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9833 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9834 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1091, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9834, __pyx_L1_error) + + /* "talib/_func.pxi":9833 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9835 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9836 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9836, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9835 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9837 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9838 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9839 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9840 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9841 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9842 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9843 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9842 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9844 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9845 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9847 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SIN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1092, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9847, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9848 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9849 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SIN_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SIN_Lookback()); + + /* "talib/_func.pxi":9850 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9850, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9851 + * lookback = begidx + lib.TA_SIN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9852 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9853 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SIN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9854 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9855 + * outreal_data[i] = NaN + * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9856 + * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9811 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9860 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_281SINH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_280SINH[] = " SINH(real)\n\n Vector Trigonometric Sinh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_281SINH = {"SINH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_281SINH, METH_O, __pyx_doc_5talib_7_ta_lib_280SINH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_281SINH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SINH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9860, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_280SINH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_280SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SINH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9880 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9881 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1093, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9881, __pyx_L1_error) + + /* "talib/_func.pxi":9880 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9882 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9883 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1094, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9883, __pyx_L1_error) + + /* "talib/_func.pxi":9882 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9884 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9885 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9885, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9884 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9886 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9887 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9888 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9889 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9890 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9891 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9892 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9891 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9893 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9894 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9896 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SINH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1095, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9896, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9897 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SINH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9898 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SINH_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SINH_Lookback()); + + /* "talib/_func.pxi":9899 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SINH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9899, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9900 + * lookback = begidx + lib.TA_SINH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9901 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9902 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SINH", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9903 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SINH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SINH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9904 + * outreal_data[i] = NaN + * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SINH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SINH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9905 + * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SINH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9860 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SINH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9909 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_283SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_282SMA[] = " SMA(real[, timeperiod=?])\n\n Simple Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_283SMA = {"SMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_283SMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_282SMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_283SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SMA") < 0)) __PYX_ERR(2, 9909, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 9909, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("SMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 9909, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9909, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_282SMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_282SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9931 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9932 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1096, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9932, __pyx_L1_error) + + /* "talib/_func.pxi":9931 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9933 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9934 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1097, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9934, __pyx_L1_error) + + /* "talib/_func.pxi":9933 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9935 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9936 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9936, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9935 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9937 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9938 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9939 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9940 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9941 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9942 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9943 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9942 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9944 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9945 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9947 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1098, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9947, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9948 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9949 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":9950 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9950, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9951 + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":9952 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9953 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":9954 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":9955 + * outreal_data[i] = NaN + * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":9956 + * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9909 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":9960 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_285SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_284SQRT[] = " SQRT(real)\n\n Vector Square Root (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_285SQRT = {"SQRT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_285SQRT, METH_O, __pyx_doc_5talib_7_ta_lib_284SQRT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_285SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SQRT (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 9960, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_284SQRT(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_284SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SQRT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":9980 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9981 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1099, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9981, __pyx_L1_error) + + /* "talib/_func.pxi":9980 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":9982 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9983 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9983, __pyx_L1_error) + + /* "talib/_func.pxi":9982 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":9984 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9985 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9985, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":9984 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":9986 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":9987 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":9988 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":9989 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":9990 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":9991 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":9992 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":9991 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":9993 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":9994 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":9996 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SQRT_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 9996, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":9997 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SQRT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":9998 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SQRT_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SQRT_Lookback()); + + /* "talib/_func.pxi":9999 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SQRT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 9999, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10000 + * lookback = begidx + lib.TA_SQRT_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10001 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10002 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SQRT", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10003 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SQRT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SQRT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10004 + * outreal_data[i] = NaN + * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SQRT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SQRT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10005 + * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SQRT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":9960 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SQRT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10009 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_287STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_286STDDEV[] = " STDDEV(real[, timeperiod=?, nbdev=?])\n\n Standard Deviation (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_287STDDEV = {"STDDEV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_287STDDEV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_286STDDEV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_287STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdev; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("STDDEV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDDEV") < 0)) __PYX_ERR(2, 10009, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10009, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 10009, __pyx_L3_error) + } else { + __pyx_v_nbdev = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("STDDEV", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10009, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10009, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_286STDDEV(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_286STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("STDDEV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10032 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10033 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10033, __pyx_L1_error) + + /* "talib/_func.pxi":10032 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10034 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10035 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10035, __pyx_L1_error) + + /* "talib/_func.pxi":10034 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10036 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10037 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10037, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10036 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10038 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10039 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10040 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10041 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10042 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10043 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10044 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10043 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10045 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10046 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10048 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10048, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10049 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10050 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_STDDEV_Lookback(__pyx_v_timeperiod, __pyx_v_nbdev)); + + /* "talib/_func.pxi":10051 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10051, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10052 + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10053 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10054 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_STDDEV", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10055 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STDDEV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_STDDEV(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10056 + * outreal_data[i] = NaN + * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_STDDEV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STDDEV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10057 + * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_STDDEV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10009 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10061 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_289STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_288STOCH[] = " STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?])\n\n Stochastic (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n slowk_period: 3\n slowk_matype: 0\n slowd_period: 3\n slowd_matype: 0\n Outputs:\n slowk\n slowd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_289STOCH = {"STOCH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_289STOCH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_288STOCH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_289STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_fastk_period; + int __pyx_v_slowk_period; + int __pyx_v_slowk_matype; + int __pyx_v_slowd_period; + int __pyx_v_slowd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("STOCH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_slowk_period,&__pyx_n_s_slowk_matype,&__pyx_n_s_slowd_period,&__pyx_n_s_slowd_matype,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 1); __PYX_ERR(2, 10061, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 2); __PYX_ERR(2, 10061, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_period); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_matype); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_period); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_matype); + if (value) { values[7] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCH") < 0)) __PYX_ERR(2, 10061, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10061, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_slowk_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10061, __pyx_L3_error) + } else { + __pyx_v_slowk_period = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_slowk_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowk_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10061, __pyx_L3_error) + } else { + __pyx_v_slowk_matype = ((int)0); + } + if (values[6]) { + __pyx_v_slowd_period = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_slowd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10061, __pyx_L3_error) + } else { + __pyx_v_slowd_period = ((int)-2147483648); + } + if (values[7]) { + __pyx_v_slowd_matype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_slowd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10061, __pyx_L3_error) + } else { + __pyx_v_slowd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10061, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 10061, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 10061, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 10061, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_288STOCH(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_288STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outslowk = 0; + double *__pyx_v_outslowk_data; + PyArrayObject *__pyx_v_outslowd = 0; + double *__pyx_v_outslowd_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("STOCH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":10092 + * np.ndarray outslowd + * double* outslowd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10093 + * double* outslowd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10093, __pyx_L1_error) + + /* "talib/_func.pxi":10092 + * np.ndarray outslowd + * double* outslowd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":10094 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10095 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10095, __pyx_L1_error) + + /* "talib/_func.pxi":10094 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10096 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10097 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10097, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10096 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":10098 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":10099 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10100 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10100, __pyx_L1_error) + + /* "talib/_func.pxi":10099 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":10101 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10102 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10102, __pyx_L1_error) + + /* "talib/_func.pxi":10101 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10103 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10104 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10104, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10103 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":10105 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":10106 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10107 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10107, __pyx_L1_error) + + /* "talib/_func.pxi":10106 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":10108 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10109 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10109, __pyx_L1_error) + + /* "talib/_func.pxi":10108 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10110 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10111 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10111, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10110 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":10112 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":10113 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":10114 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10115 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10115, __pyx_L1_error) + + /* "talib/_func.pxi":10114 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":10116 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10117 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10117, __pyx_L1_error) + + /* "talib/_func.pxi":10116 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10118 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10119 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10120 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":10121 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10122 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10121 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":10123 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":10124 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10125 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10124 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":10126 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":10127 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10128 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10127 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10129 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10130 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10132 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10132, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":10133 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) + * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10134 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) # <<<<<<<<<<<<<< + * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowk_data = outslowk.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_STOCH_Lookback(__pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype)); + + /* "talib/_func.pxi":10135 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) + * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outslowk_data = outslowk.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10135, __pyx_L1_error) + __pyx_v_outslowk = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10136 + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) + * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowk_data = outslowk.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outslowk_data[i] = NaN + */ + __pyx_v_outslowk_data = ((double *)__pyx_v_outslowk->data); + + /* "talib/_func.pxi":10137 + * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowk_data = outslowk.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outslowk_data[i] = NaN + * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10138 + * outslowk_data = outslowk.data + * for i from 0 <= i < min(lookback, length): + * outslowk_data[i] = NaN # <<<<<<<<<<<<<< + * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowd_data = outslowd.data + */ + (__pyx_v_outslowk_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10139 + * for i from 0 <= i < min(lookback, length): + * outslowk_data[i] = NaN + * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outslowd_data = outslowd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10139, __pyx_L1_error) + __pyx_v_outslowd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10140 + * outslowk_data[i] = NaN + * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowd_data = outslowd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outslowd_data[i] = NaN + */ + __pyx_v_outslowd_data = ((double *)__pyx_v_outslowd->data); + + /* "talib/_func.pxi":10141 + * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outslowd_data = outslowd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outslowd_data[i] = NaN + * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10142 + * outslowd_data = outslowd.data + * for i from 0 <= i < min(lookback, length): + * outslowd_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) + * _ta_check_success("TA_STOCH", retCode) + */ + (__pyx_v_outslowd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10143 + * for i from 0 <= i < min(lookback, length): + * outslowd_data[i] = NaN + * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCH", retCode) + * return outslowk , outslowd + */ + __pyx_v_retCode = TA_STOCH(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outslowk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outslowd_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10144 + * outslowd_data[i] = NaN + * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) + * _ta_check_success("TA_STOCH", retCode) # <<<<<<<<<<<<<< + * return outslowk , outslowd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10145 + * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) + * _ta_check_success("TA_STOCH", retCode) + * return outslowk , outslowd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outslowk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outslowk)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outslowk)); + __Pyx_INCREF(((PyObject *)__pyx_v_outslowd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outslowd)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outslowd)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":10061 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outslowk); + __Pyx_XDECREF((PyObject *)__pyx_v_outslowd); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10149 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_291STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_290STOCHF[] = " STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Fast (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_291STOCHF = {"STOCHF", (PyCFunction)__pyx_pw_5talib_7_ta_lib_291STOCHF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_290STOCHF}; +static PyObject *__pyx_pw_5talib_7_ta_lib_291STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_fastk_period; + int __pyx_v_fastd_period; + int __pyx_v_fastd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("STOCHF (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 1); __PYX_ERR(2, 10149, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 2); __PYX_ERR(2, 10149, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHF") < 0)) __PYX_ERR(2, 10149, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10149, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10149, __pyx_L3_error) + } else { + __pyx_v_fastd_period = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10149, __pyx_L3_error) + } else { + __pyx_v_fastd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10149, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 10149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 10149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 10149, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_290STOCHF(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_290STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outfastk = 0; + double *__pyx_v_outfastk_data; + PyArrayObject *__pyx_v_outfastd = 0; + double *__pyx_v_outfastd_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("STOCHF", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":10178 + * np.ndarray outfastd + * double* outfastd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10179 + * double* outfastd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10179, __pyx_L1_error) + + /* "talib/_func.pxi":10178 + * np.ndarray outfastd + * double* outfastd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":10180 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10181 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10181, __pyx_L1_error) + + /* "talib/_func.pxi":10180 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10182 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10183 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10183, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10182 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":10184 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":10185 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10186 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10186, __pyx_L1_error) + + /* "talib/_func.pxi":10185 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":10187 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10188 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10188, __pyx_L1_error) + + /* "talib/_func.pxi":10187 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10189 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10190 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10190, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10189 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":10191 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":10192 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10193 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10193, __pyx_L1_error) + + /* "talib/_func.pxi":10192 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":10194 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10195 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10195, __pyx_L1_error) + + /* "talib/_func.pxi":10194 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10196 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10197 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10197, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10196 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":10198 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":10199 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":10200 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10201 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10201, __pyx_L1_error) + + /* "talib/_func.pxi":10200 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":10202 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10203 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10203, __pyx_L1_error) + + /* "talib/_func.pxi":10202 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10204 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10205 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10206 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":10207 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10208 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10207 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":10209 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":10210 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10211 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10210 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":10212 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":10213 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10214 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10213 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10215 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10216 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10218 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10218, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":10219 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10220 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) # <<<<<<<<<<<<<< + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_STOCHF_Lookback(__pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype)); + + /* "talib/_func.pxi":10221 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10221, __pyx_L1_error) + __pyx_v_outfastk = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10222 + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN + */ + __pyx_v_outfastk_data = ((double *)__pyx_v_outfastk->data); + + /* "talib/_func.pxi":10223 + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10224 + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN # <<<<<<<<<<<<<< + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data + */ + (__pyx_v_outfastk_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10225 + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10225, __pyx_L1_error) + __pyx_v_outfastd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10226 + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN + */ + __pyx_v_outfastd_data = ((double *)__pyx_v_outfastd->data); + + /* "talib/_func.pxi":10227 + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10228 + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHF", retCode) + */ + (__pyx_v_outfastd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10229 + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCHF", retCode) + * return outfastk , outfastd + */ + __pyx_v_retCode = TA_STOCHF(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outfastk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfastd_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10230 + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHF", retCode) # <<<<<<<<<<<<<< + * return outfastk , outfastd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCHF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10231 + * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHF", retCode) + * return outfastk , outfastd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outfastk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastk)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outfastk)); + __Pyx_INCREF(((PyObject *)__pyx_v_outfastd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastd)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfastd)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":10149 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outfastk); + __Pyx_XDECREF((PyObject *)__pyx_v_outfastd); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10235 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_293STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_292STOCHRSI[] = " STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_293STOCHRSI = {"STOCHRSI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_293STOCHRSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_292STOCHRSI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_293STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + int __pyx_v_fastk_period; + int __pyx_v_fastd_period; + int __pyx_v_fastd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("STOCHRSI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHRSI") < 0)) __PYX_ERR(2, 10235, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10235, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10235, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10235, __pyx_L3_error) + } else { + __pyx_v_fastd_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10235, __pyx_L3_error) + } else { + __pyx_v_fastd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("STOCHRSI", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10235, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10235, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_292STOCHRSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_292STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outfastk = 0; + double *__pyx_v_outfastk_data; + PyArrayObject *__pyx_v_outfastd = 0; + double *__pyx_v_outfastd_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("STOCHRSI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10263 + * np.ndarray outfastd + * double* outfastd_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10264 + * double* outfastd_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10264, __pyx_L1_error) + + /* "talib/_func.pxi":10263 + * np.ndarray outfastd + * double* outfastd_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10265 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10266 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10266, __pyx_L1_error) + + /* "talib/_func.pxi":10265 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10267 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10268 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10268, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10267 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10269 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10270 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10271 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10272 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10273 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10274 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10275 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10274 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10276 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10277 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10279 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10279, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10280 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10281 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) # <<<<<<<<<<<<<< + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_STOCHRSI_Lookback(__pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype)); + + /* "talib/_func.pxi":10282 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10282, __pyx_L1_error) + __pyx_v_outfastk = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10283 + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN + */ + __pyx_v_outfastk_data = ((double *)__pyx_v_outfastk->data); + + /* "talib/_func.pxi":10284 + * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10285 + * outfastk_data = outfastk.data + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN # <<<<<<<<<<<<<< + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data + */ + (__pyx_v_outfastk_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10286 + * for i from 0 <= i < min(lookback, length): + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10286, __pyx_L1_error) + __pyx_v_outfastd = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10287 + * outfastk_data[i] = NaN + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN + */ + __pyx_v_outfastd_data = ((double *)__pyx_v_outfastd->data); + + /* "talib/_func.pxi":10288 + * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10289 + * outfastd_data = outfastd.data + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHRSI", retCode) + */ + (__pyx_v_outfastd_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10290 + * for i from 0 <= i < min(lookback, length): + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCHRSI", retCode) + * return outfastk , outfastd + */ + __pyx_v_retCode = TA_STOCHRSI(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outfastk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfastd_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10291 + * outfastd_data[i] = NaN + * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHRSI", retCode) # <<<<<<<<<<<<<< + * return outfastk , outfastd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCHRSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10292 + * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) + * _ta_check_success("TA_STOCHRSI", retCode) + * return outfastk , outfastd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_outfastk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastk)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outfastk)); + __Pyx_INCREF(((PyObject *)__pyx_v_outfastd)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastd)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfastd)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_func.pxi":10235 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outfastk); + __Pyx_XDECREF((PyObject *)__pyx_v_outfastd); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10296 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_295SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_294SUB[] = " SUB(real0, real1)\n\n Vector Arithmetic Substraction (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_295SUB = {"SUB", (PyCFunction)__pyx_pw_5talib_7_ta_lib_295SUB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_294SUB}; +static PyObject *__pyx_pw_5talib_7_ta_lib_295SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SUB (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, 1); __PYX_ERR(2, 10296, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUB") < 0)) __PYX_ERR(2, 10296, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10296, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(2, 10296, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(2, 10296, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_294SUB(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_294SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SUB", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_func.pxi":10318 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10319 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10319, __pyx_L1_error) + + /* "talib/_func.pxi":10318 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_func.pxi":10320 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10321 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10321, __pyx_L1_error) + + /* "talib/_func.pxi":10320 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10322 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10323 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10323, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10322 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_func.pxi":10324 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_func.pxi":10325 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10326 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10326, __pyx_L1_error) + + /* "talib/_func.pxi":10325 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_func.pxi":10327 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10328 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10328, __pyx_L1_error) + + /* "talib/_func.pxi":10327 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10329 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10330 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10330, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10329 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_func.pxi":10331 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_func.pxi":10332 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_func.pxi":10333 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10334 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10334, __pyx_L1_error) + + /* "talib/_func.pxi":10333 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10335 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real0_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10336 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real0_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10337 + * begidx = 0 + * for i from 0 <= i < length: + * val = real0_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); + + /* "talib/_func.pxi":10338 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10339 + * val = real0_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = real1_data[i] + * if val != val: + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":10338 + * for i from 0 <= i < length: + * val = real0_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = real1_data[i] + */ + } + + /* "talib/_func.pxi":10340 + * if val != val: + * continue + * val = real1_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); + + /* "talib/_func.pxi":10341 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10342 + * val = real1_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L10_continue; + + /* "talib/_func.pxi":10341 + * continue + * val = real1_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10343 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10344 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L11_break; + __pyx_L10_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10346 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUB_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10346, __pyx_L1_error) + } + __pyx_L11_break:; + + /* "talib/_func.pxi":10347 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SUB_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10348 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUB_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SUB_Lookback()); + + /* "talib/_func.pxi":10349 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUB_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10349, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10350 + * lookback = begidx + lib.TA_SUB_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10351 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10352 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUB", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10353 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SUB", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SUB(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10354 + * outreal_data[i] = NaN + * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUB", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SUB, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10355 + * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUB", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10296 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10359 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_297SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_296SUM[] = " SUM(real[, timeperiod=?])\n\n Summation (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_297SUM = {"SUM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_297SUM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_296SUM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_297SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("SUM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUM") < 0)) __PYX_ERR(2, 10359, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10359, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("SUM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10359, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10359, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_296SUM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_296SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("SUM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10381 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10382 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10382, __pyx_L1_error) + + /* "talib/_func.pxi":10381 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10383 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10384 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10384, __pyx_L1_error) + + /* "talib/_func.pxi":10383 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10385 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10386 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10386, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10385 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10387 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10388 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10389 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10390 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10391 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10392 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10393 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10392 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10394 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10395 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10397 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10397, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10398 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10399 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_SUM_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":10400 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10400, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10401 + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10402 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10403 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUM", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10404 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SUM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SUM(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10405 + * outreal_data[i] = NaN + * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SUM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10406 + * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_SUM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10359 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10410 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_299T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_298T3[] = " T3(real[, timeperiod=?, vfactor=?])\n\n Triple Exponential Moving Average (T3) (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n vfactor: 0.7\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_299T3 = {"T3", (PyCFunction)__pyx_pw_5talib_7_ta_lib_299T3, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_298T3}; +static PyObject *__pyx_pw_5talib_7_ta_lib_299T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_vfactor; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("T3 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_vfactor,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vfactor); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "T3") < 0)) __PYX_ERR(2, 10410, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10410, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_vfactor = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_vfactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 10410, __pyx_L3_error) + } else { + __pyx_v_vfactor = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("T3", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10410, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10410, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_298T3(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_vfactor); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_298T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("T3", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10434 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10434, __pyx_L1_error) + + /* "talib/_func.pxi":10433 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10435 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10436 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10436, __pyx_L1_error) + + /* "talib/_func.pxi":10435 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10437 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10438 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10438, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10437 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10439 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10440 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10441 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10442 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10443 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10444 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10445 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10444 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10446 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10447 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10449 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10449, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10450 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10451 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_T3_Lookback(__pyx_v_timeperiod, __pyx_v_vfactor)); + + /* "talib/_func.pxi":10452 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10452, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10453 + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10454 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10455 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_T3", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10456 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_T3", retCode) + * return outreal + */ + __pyx_v_retCode = TA_T3(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_vfactor, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10457 + * outreal_data[i] = NaN + * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_T3", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_T3, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10458 + * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_T3", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10410 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_301TAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_300TAN[] = " TAN(real)\n\n Vector Trigonometric Tan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_301TAN = {"TAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_301TAN, METH_O, __pyx_doc_5talib_7_ta_lib_300TAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_301TAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TAN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10462, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_300TAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_300TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10482 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10483 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10483, __pyx_L1_error) + + /* "talib/_func.pxi":10482 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10484 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10485 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10485, __pyx_L1_error) + + /* "talib/_func.pxi":10484 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10486 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10487 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10487, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10486 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10488 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10489 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10490 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10491 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10492 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10493 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10494 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10493 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10495 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10496 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10498 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TAN_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10498, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10499 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10500 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TAN_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TAN_Lookback()); + + /* "talib/_func.pxi":10501 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10501, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10502 + * lookback = begidx + lib.TA_TAN_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10503 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10504 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TAN", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10505 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TAN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TAN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10506 + * outreal_data[i] = NaN + * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TAN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10507 + * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TAN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_303TANH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_302TANH[] = " TANH(real)\n\n Vector Trigonometric Tanh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_303TANH = {"TANH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_303TANH, METH_O, __pyx_doc_5talib_7_ta_lib_302TANH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_303TANH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TANH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10511, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_302TANH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_302TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TANH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10531 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10532 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10532, __pyx_L1_error) + + /* "talib/_func.pxi":10531 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10533 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10534 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10534, __pyx_L1_error) + + /* "talib/_func.pxi":10533 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10535 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10536 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10536, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10535 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10537 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10538 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10539 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10540 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10541 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10542 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10543 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10542 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10544 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10545 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10547 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TANH_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10547, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10548 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TANH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10549 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TANH_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TANH_Lookback()); + + /* "talib/_func.pxi":10550 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TANH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10550, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10551 + * lookback = begidx + lib.TA_TANH_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10552 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10553 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TANH", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10554 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TANH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TANH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10555 + * outreal_data[i] = NaN + * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TANH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TANH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10556 + * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TANH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TANH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10560 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_305TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_304TEMA[] = " TEMA(real[, timeperiod=?])\n\n Triple Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_305TEMA = {"TEMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_305TEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_304TEMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_305TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TEMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TEMA") < 0)) __PYX_ERR(2, 10560, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10560, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10560, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10560, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_304TEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_304TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TEMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10582 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10583 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10583, __pyx_L1_error) + + /* "talib/_func.pxi":10582 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10584 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10585 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10585, __pyx_L1_error) + + /* "talib/_func.pxi":10584 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10586 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10587 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10587, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10586 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10588 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10589 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10590 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10591 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10592 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10593 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10594 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10593 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10595 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10596 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10598 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10598, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10599 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10600 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TEMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":10601 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10601, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10602 + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10603 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10604 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TEMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10605 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TEMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TEMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10606 + * outreal_data[i] = NaN + * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TEMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10607 + * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TEMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10560 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10611 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_307TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_306TRANGE[] = " TRANGE(high, low, close)\n\n True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_307TRANGE = {"TRANGE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_307TRANGE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_306TRANGE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_307TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TRANGE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 1); __PYX_ERR(2, 10611, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 2); __PYX_ERR(2, 10611, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRANGE") < 0)) __PYX_ERR(2, 10611, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10611, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 10611, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 10611, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 10611, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_306TRANGE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_306TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TRANGE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":10633 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10634 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10634, __pyx_L1_error) + + /* "talib/_func.pxi":10633 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":10635 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10636 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10636, __pyx_L1_error) + + /* "talib/_func.pxi":10635 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10637 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10638 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10638, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10637 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":10639 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":10640 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10641 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10641, __pyx_L1_error) + + /* "talib/_func.pxi":10640 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":10642 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10643 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10643, __pyx_L1_error) + + /* "talib/_func.pxi":10642 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10644 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10645 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10645, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10644 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":10646 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":10647 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10648 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10648, __pyx_L1_error) + + /* "talib/_func.pxi":10647 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":10649 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10650 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10650, __pyx_L1_error) + + /* "talib/_func.pxi":10649 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10651 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10652 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10652, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10651 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":10653 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":10654 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":10655 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10656 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10656, __pyx_L1_error) + + /* "talib/_func.pxi":10655 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":10657 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10658 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10658, __pyx_L1_error) + + /* "talib/_func.pxi":10657 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10659 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10660 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10661 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":10662 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10663 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10662 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":10664 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":10665 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10666 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10665 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":10667 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":10668 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10669 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10668 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10670 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10671 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10673 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRANGE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10673, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":10674 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TRANGE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10675 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRANGE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TRANGE_Lookback()); + + /* "talib/_func.pxi":10676 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRANGE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10676, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10677 + * lookback = begidx + lib.TA_TRANGE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10678 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10679 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRANGE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10680 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRANGE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRANGE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10681 + * outreal_data[i] = NaN + * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRANGE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRANGE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10682 + * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRANGE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10611 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10686 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_309TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_308TRIMA[] = " TRIMA(real[, timeperiod=?])\n\n Triangular Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_309TRIMA = {"TRIMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_309TRIMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_308TRIMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_309TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TRIMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIMA") < 0)) __PYX_ERR(2, 10686, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10686, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TRIMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10686, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10686, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_308TRIMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_308TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TRIMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10708 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10709 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10709, __pyx_L1_error) + + /* "talib/_func.pxi":10708 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10710 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10711 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10711, __pyx_L1_error) + + /* "talib/_func.pxi":10710 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10712 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10713 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10713, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10712 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10714 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10715 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10716 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10717 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10718 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10719 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10720 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10719 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10721 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10722 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10724 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10724, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10725 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10726 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TRIMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":10727 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10727, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10728 + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10729 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10730 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10731 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRIMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRIMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10732 + * outreal_data[i] = NaN + * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRIMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10733 + * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10686 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10737 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_311TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_310TRIX[] = " TRIX(real[, timeperiod=?])\n\n 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_311TRIX = {"TRIX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_311TRIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_310TRIX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_311TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TRIX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIX") < 0)) __PYX_ERR(2, 10737, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10737, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TRIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10737, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10737, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_310TRIX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_310TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TRIX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10759 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10760 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10760, __pyx_L1_error) + + /* "talib/_func.pxi":10759 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10761 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10762 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10762, __pyx_L1_error) + + /* "talib/_func.pxi":10761 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10763 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10764 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10764, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10763 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10765 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10766 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10767 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10768 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10769 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10770 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10771 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10770 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10772 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10773 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10775 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10775, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10776 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10777 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TRIX_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":10778 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10778, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10779 + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10780 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10781 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIX", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10782 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRIX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRIX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10783 + * outreal_data[i] = NaN + * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10784 + * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TRIX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10737 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10788 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_313TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_312TSF[] = " TSF(real[, timeperiod=?])\n\n Time Series Forecast (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_313TSF = {"TSF", (PyCFunction)__pyx_pw_5talib_7_ta_lib_313TSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_312TSF}; +static PyObject *__pyx_pw_5talib_7_ta_lib_313TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TSF (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TSF") < 0)) __PYX_ERR(2, 10788, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10788, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TSF", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10788, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10788, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_312TSF(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_312TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TSF", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":10810 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10811 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10811, __pyx_L1_error) + + /* "talib/_func.pxi":10810 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":10812 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10813 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10813, __pyx_L1_error) + + /* "talib/_func.pxi":10812 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10814 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10815 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10815, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10814 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":10816 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":10817 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":10818 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10819 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10820 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":10821 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10822 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":10821 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10823 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10824 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10826 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10826, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":10827 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10828 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TSF_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":10829 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10829, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10830 + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10831 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10832 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TSF", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10833 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TSF", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TSF(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10834 + * outreal_data[i] = NaN + * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TSF", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TSF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10835 + * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TSF", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10788 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10839 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_315TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_314TYPPRICE[] = " TYPPRICE(high, low, close)\n\n Typical Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_315TYPPRICE = {"TYPPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_315TYPPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_314TYPPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_315TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TYPPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 1); __PYX_ERR(2, 10839, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 2); __PYX_ERR(2, 10839, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TYPPRICE") < 0)) __PYX_ERR(2, 10839, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10839, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 10839, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 10839, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 10839, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_314TYPPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_314TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("TYPPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":10861 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10862 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10862, __pyx_L1_error) + + /* "talib/_func.pxi":10861 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":10863 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10864 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10864, __pyx_L1_error) + + /* "talib/_func.pxi":10863 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10865 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10866 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10866, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10865 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":10867 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":10868 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10869 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10869, __pyx_L1_error) + + /* "talib/_func.pxi":10868 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":10870 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10871 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10871, __pyx_L1_error) + + /* "talib/_func.pxi":10870 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10872 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10873 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10873, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10872 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":10874 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":10875 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10876 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10876, __pyx_L1_error) + + /* "talib/_func.pxi":10875 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":10877 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10878 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10878, __pyx_L1_error) + + /* "talib/_func.pxi":10877 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10879 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10880 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10880, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10879 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":10881 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":10882 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":10883 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10884 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10884, __pyx_L1_error) + + /* "talib/_func.pxi":10883 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":10885 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10886 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10886, __pyx_L1_error) + + /* "talib/_func.pxi":10885 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10887 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10888 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10889 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":10890 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10891 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10890 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":10892 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":10893 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10894 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10893 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":10895 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":10896 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10897 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10896 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10898 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10899 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10901 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10901, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":10902 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10903 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_TYPPRICE_Lookback()); + + /* "talib/_func.pxi":10904 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10904, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10905 + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10906 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10907 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TYPPRICE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10908 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TYPPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TYPPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10909 + * outreal_data[i] = NaN + * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TYPPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TYPPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10910 + * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_TYPPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10839 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_317ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_316ULTOSC[] = " ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?])\n\n Ultimate Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod1: 7\n timeperiod2: 14\n timeperiod3: 28\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_317ULTOSC = {"ULTOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_317ULTOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_316ULTOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_317ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod1; + int __pyx_v_timeperiod2; + int __pyx_v_timeperiod3; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ULTOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod1,&__pyx_n_s_timeperiod2,&__pyx_n_s_timeperiod3,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 1); __PYX_ERR(2, 10914, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 2); __PYX_ERR(2, 10914, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod1); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod2); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod3); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ULTOSC") < 0)) __PYX_ERR(2, 10914, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10914, __pyx_L3_error) + } else { + __pyx_v_timeperiod1 = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_timeperiod2 = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10914, __pyx_L3_error) + } else { + __pyx_v_timeperiod2 = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_timeperiod3 = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_timeperiod3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10914, __pyx_L3_error) + } else { + __pyx_v_timeperiod3 = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10914, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 10914, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 10914, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 10914, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_316ULTOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_316ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("ULTOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":10940 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10941 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10941, __pyx_L1_error) + + /* "talib/_func.pxi":10940 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":10942 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10943 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10943, __pyx_L1_error) + + /* "talib/_func.pxi":10942 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10944 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10945 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10945, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10944 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":10946 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":10947 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10948 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10948, __pyx_L1_error) + + /* "talib/_func.pxi":10947 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":10949 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10950 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10950, __pyx_L1_error) + + /* "talib/_func.pxi":10949 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10951 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10952 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10952, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10951 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":10953 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":10954 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10955 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10955, __pyx_L1_error) + + /* "talib/_func.pxi":10954 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":10956 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10957 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10957, __pyx_L1_error) + + /* "talib/_func.pxi":10956 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":10958 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10959 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10959, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10958 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":10960 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":10961 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":10962 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10963 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10963, __pyx_L1_error) + + /* "talib/_func.pxi":10962 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":10964 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10965 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10965, __pyx_L1_error) + + /* "talib/_func.pxi":10964 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":10966 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":10967 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10968 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":10969 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10970 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10969 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":10971 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":10972 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10973 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10972 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":10974 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":10975 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":10976 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":10975 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":10977 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":10978 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":10980 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 10980, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":10981 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":10982 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_ULTOSC_Lookback(__pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3)); + + /* "talib/_func.pxi":10983 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 10983, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":10984 + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":10985 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":10986 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ULTOSC", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":10987 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ULTOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ULTOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":10988 + * outreal_data[i] = NaN + * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ULTOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ULTOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":10989 + * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_ULTOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":10993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_319VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_318VAR[] = " VAR(real[, timeperiod=?, nbdev=?])\n\n Variance (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_319VAR = {"VAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_319VAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_318VAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_319VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdev; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("VAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "VAR") < 0)) __PYX_ERR(2, 10993, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10993, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 10993, __pyx_L3_error) + } else { + __pyx_v_nbdev = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("VAR", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 10993, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 10993, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_318VAR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_318VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("VAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":11016 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11017 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11017, __pyx_L1_error) + + /* "talib/_func.pxi":11016 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":11018 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11019 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11019, __pyx_L1_error) + + /* "talib/_func.pxi":11018 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11020 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11021 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11021, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11020 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":11022 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":11023 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":11024 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":11025 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11026 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":11027 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11028 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":11027 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":11029 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":11030 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":11032 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11032, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":11033 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":11034 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_VAR_Lookback(__pyx_v_timeperiod, __pyx_v_nbdev)); + + /* "talib/_func.pxi":11035 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11035, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11036 + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":11037 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11038 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_VAR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":11039 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_VAR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_VAR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":11040 + * outreal_data[i] = NaN + * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_VAR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_VAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":11041 + * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_VAR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":10993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":11045 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_321WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_320WCLPRICE[] = " WCLPRICE(high, low, close)\n\n Weighted Close Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_321WCLPRICE = {"WCLPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_321WCLPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_320WCLPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_321WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("WCLPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 1); __PYX_ERR(2, 11045, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 2); __PYX_ERR(2, 11045, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WCLPRICE") < 0)) __PYX_ERR(2, 11045, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 11045, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 11045, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 11045, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 11045, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_320WCLPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_320WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("WCLPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":11067 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11068 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11068, __pyx_L1_error) + + /* "talib/_func.pxi":11067 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":11069 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11070 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11070, __pyx_L1_error) + + /* "talib/_func.pxi":11069 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11071 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11072 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11072, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11071 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":11073 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":11074 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11075 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11075, __pyx_L1_error) + + /* "talib/_func.pxi":11074 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":11076 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11077 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11077, __pyx_L1_error) + + /* "talib/_func.pxi":11076 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11078 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11079 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11079, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11078 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":11080 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":11081 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11082 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11082, __pyx_L1_error) + + /* "talib/_func.pxi":11081 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":11083 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11084 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11084, __pyx_L1_error) + + /* "talib/_func.pxi":11083 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11085 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11086 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11086, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11085 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":11087 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":11088 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":11089 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11090 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11090, __pyx_L1_error) + + /* "talib/_func.pxi":11089 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":11091 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11092 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11092, __pyx_L1_error) + + /* "talib/_func.pxi":11091 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":11093 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":11094 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11095 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":11096 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11097 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11096 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":11098 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":11099 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11100 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11099 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":11101 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":11102 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11103 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11102 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":11104 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":11105 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":11107 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11107, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":11108 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":11109 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_WCLPRICE_Lookback()); + + /* "talib/_func.pxi":11110 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11110, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11111 + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":11112 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11113 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WCLPRICE", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":11114 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WCLPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WCLPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":11115 + * outreal_data[i] = NaN + * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WCLPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WCLPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":11116 + * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WCLPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":11045 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":11120 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_323WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_322WILLR[] = " WILLR(high, low, close[, timeperiod=?])\n\n Williams' %R (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_323WILLR = {"WILLR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_323WILLR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_322WILLR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_323WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("WILLR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 1); __PYX_ERR(2, 11120, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 2); __PYX_ERR(2, 11120, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WILLR") < 0)) __PYX_ERR(2, 11120, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 11120, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 11120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(2, 11120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(2, 11120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(2, 11120, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_322WILLR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_322WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("WILLR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_func.pxi":11144 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11145 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11145, __pyx_L1_error) + + /* "talib/_func.pxi":11144 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_func.pxi":11146 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11147 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11147, __pyx_L1_error) + + /* "talib/_func.pxi":11146 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11148 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11149 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11149, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11148 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_func.pxi":11150 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_func.pxi":11151 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11152 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11152, __pyx_L1_error) + + /* "talib/_func.pxi":11151 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_func.pxi":11153 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11154 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11154, __pyx_L1_error) + + /* "talib/_func.pxi":11153 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11155 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11156 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11156, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11155 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_func.pxi":11157 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_func.pxi":11158 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11159 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11159, __pyx_L1_error) + + /* "talib/_func.pxi":11158 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_func.pxi":11160 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11161 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11161, __pyx_L1_error) + + /* "talib/_func.pxi":11160 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11162 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11163 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11163, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11162 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_func.pxi":11164 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_func.pxi":11165 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_func.pxi":11166 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11167 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11167, __pyx_L1_error) + + /* "talib/_func.pxi":11166 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_func.pxi":11168 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11169 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11169, __pyx_L1_error) + + /* "talib/_func.pxi":11168 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * begidx = 0 + */ + } + + /* "talib/_func.pxi":11170 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = high_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":11171 + * raise Exception("input lengths are different") + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = high_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11172 + * begidx = 0 + * for i from 0 <= i < length: + * val = high_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); + + /* "talib/_func.pxi":11173 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11174 + * val = high_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = low_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11173 + * for i from 0 <= i < length: + * val = high_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = low_data[i] + */ + } + + /* "talib/_func.pxi":11175 + * if val != val: + * continue + * val = low_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); + + /* "talib/_func.pxi":11176 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11177 + * val = low_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * val = close_data[i] + * if val != val: + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11176 + * continue + * val = low_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * val = close_data[i] + */ + } + + /* "talib/_func.pxi":11178 + * if val != val: + * continue + * val = close_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); + + /* "talib/_func.pxi":11179 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11180 + * val = close_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L14_continue; + + /* "talib/_func.pxi":11179 + * continue + * val = close_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":11181 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":11182 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L15_break; + __pyx_L14_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":11184 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11184, __pyx_L1_error) + } + __pyx_L15_break:; + + /* "talib/_func.pxi":11185 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":11186 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_WILLR_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":11187 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11187, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11188 + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":11189 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11190 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WILLR", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":11191 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WILLR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WILLR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":11192 + * outreal_data[i] = NaN + * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WILLR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WILLR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":11193 + * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WILLR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":11120 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_func.pxi":11197 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_325WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_324WMA[] = " WMA(real[, timeperiod=?])\n\n Weighted Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_325WMA = {"WMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_325WMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_324WMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_325WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("WMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WMA") < 0)) __PYX_ERR(2, 11197, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 11197, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("WMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 11197, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(2, 11197, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_324WMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_324WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + double __pyx_v_val; + int __pyx_v_begidx; + int __pyx_v_endidx; + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + PyArrayObject *__pyx_v_outreal = 0; + double *__pyx_v_outreal_data; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + npy_intp __pyx_t_3; + int __pyx_t_4; + npy_intp __pyx_t_5; + __Pyx_RefNannySetupContext("WMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_func.pxi":11219 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11220 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11220, __pyx_L1_error) + + /* "talib/_func.pxi":11219 + * np.ndarray outreal + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_func.pxi":11221 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11222 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11222, __pyx_L1_error) + + /* "talib/_func.pxi":11221 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_func.pxi":11223 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11224 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11224, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11223 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_func.pxi":11225 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * begidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_func.pxi":11226 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_func.pxi":11227 + * real_data = real.data + * length = real.shape[0] + * begidx = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * val = real_data[i] + */ + __pyx_v_begidx = 0; + + /* "talib/_func.pxi":11228 + * length = real.shape[0] + * begidx = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * val = real_data[i] + * if val != val: + */ + __pyx_t_3 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11229 + * begidx = 0 + * for i from 0 <= i < length: + * val = real_data[i] # <<<<<<<<<<<<<< + * if val != val: + * continue + */ + __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); + + /* "talib/_func.pxi":11230 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "talib/_func.pxi":11231 + * val = real_data[i] + * if val != val: + * continue # <<<<<<<<<<<<<< + * begidx = i + * break + */ + goto __pyx_L6_continue; + + /* "talib/_func.pxi":11230 + * for i from 0 <= i < length: + * val = real_data[i] + * if val != val: # <<<<<<<<<<<<<< + * continue + * begidx = i + */ + } + + /* "talib/_func.pxi":11232 + * if val != val: + * continue + * begidx = i # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_begidx = __pyx_v_i; + + /* "talib/_func.pxi":11233 + * continue + * begidx = i + * break # <<<<<<<<<<<<<< + * else: + * raise Exception("inputs are all NaN") + */ + goto __pyx_L7_break; + __pyx_L6_continue:; + } + /*else*/ { + + /* "talib/_func.pxi":11235 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 11235, __pyx_L1_error) + } + __pyx_L7_break:; + + /* "talib/_func.pxi":11236 + * else: + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 # <<<<<<<<<<<<<< + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + */ + __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); + + /* "talib/_func.pxi":11237 + * raise Exception("inputs are all NaN") + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + */ + __pyx_v_lookback = (__pyx_v_begidx + TA_WMA_Lookback(__pyx_v_timeperiod)); + + /* "talib/_func.pxi":11238 + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + */ + __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 11238, __pyx_L1_error) + __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_func.pxi":11239 + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data # <<<<<<<<<<<<<< + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + */ + __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); + + /* "talib/_func.pxi":11240 + * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< + * outreal_data[i] = NaN + * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + */ + __pyx_t_3 = __pyx_v_length; + __pyx_t_4 = __pyx_v_lookback; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_t_3 = __pyx_t_5; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "talib/_func.pxi":11241 + * outreal_data = outreal.data + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WMA", retCode) + */ + (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_7_ta_lib_NaN; + } + + /* "talib/_func.pxi":11242 + * for i from 0 <= i < min(lookback, length): + * outreal_data[i] = NaN + * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); + + /* "talib/_func.pxi":11243 + * outreal_data[i] = NaN + * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_func.pxi":11244 + * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) + * _ta_check_success("TA_WMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * __TA_FUNCTION_NAMES__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); + __pyx_r = ((PyObject *)__pyx_v_outreal); + goto __pyx_L0; + + /* "talib/_func.pxi":11197 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_outreal); + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":47 + * if sys.version >= '3': + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return bytes(s, 'ascii') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_327str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_327str2bytes = {"str2bytes", (PyCFunction)__pyx_pw_5talib_7_ta_lib_327str2bytes, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_327str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("str2bytes (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_326str2bytes(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_326str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("str2bytes", 0); + + /* "talib/_abstract.pxi":48 + * + * def str2bytes(s): + * return bytes(s, 'ascii') # <<<<<<<<<<<<<< + * + * def bytes2str(b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s); + __Pyx_INCREF(__pyx_n_s_ascii); + __Pyx_GIVEREF(__pyx_n_s_ascii); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":47 + * if sys.version >= '3': + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return bytes(s, 'ascii') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.str2bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":50 + * return bytes(s, 'ascii') + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b.decode('ascii') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_329bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_329bytes2str = {"bytes2str", (PyCFunction)__pyx_pw_5talib_7_ta_lib_329bytes2str, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_329bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("bytes2str (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_328bytes2str(__pyx_self, ((PyObject *)__pyx_v_b)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_328bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("bytes2str", 0); + + /* "talib/_abstract.pxi":51 + * + * def bytes2str(b): + * return b.decode('ascii') # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__1207, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":50 + * return bytes(s, 'ascii') + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b.decode('ascii') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.bytes2str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":55 + * else: + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return s + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_331str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_331str2bytes = {"str2bytes", (PyCFunction)__pyx_pw_5talib_7_ta_lib_331str2bytes, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_331str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("str2bytes (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_330str2bytes(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_330str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("str2bytes", 0); + + /* "talib/_abstract.pxi":56 + * + * def str2bytes(s): + * return s # <<<<<<<<<<<<<< + * + * def bytes2str(b): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + goto __pyx_L0; + + /* "talib/_abstract.pxi":55 + * else: + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return s + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":58 + * return s + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_333bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_333bytes2str = {"bytes2str", (PyCFunction)__pyx_pw_5talib_7_ta_lib_333bytes2str, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_333bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("bytes2str (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_332bytes2str(__pyx_self, ((PyObject *)__pyx_v_b)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_332bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("bytes2str", 0); + + /* "talib/_abstract.pxi":59 + * + * def bytes2str(b): + * return b # <<<<<<<<<<<<<< + * + * class Function(object): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_b); + __pyx_r = __pyx_v_b; + goto __pyx_L0; + + /* "talib/_abstract.pxi":58 + * return s + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":90 + * """ + * + * def __init__(self, function_name, func_object, *args, **kwargs): # <<<<<<<<<<<<<< + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_function_name = 0; + PyObject *__pyx_v_func_object = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 3) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_function_name,&__pyx_n_s_func_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 3, 1); __PYX_ERR(1, 90, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 3, 2); __PYX_ERR(1, 90, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 90, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_function_name = values[1]; + __pyx_v_func_object = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 90, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("talib._ta_lib.Function.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function___init__(__pyx_self, __pyx_v_self, __pyx_v_function_name, __pyx_v_func_object, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_function_name, PyObject *__pyx_v_func_object, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "talib/_abstract.pxi":92 + * def __init__(self, function_name, func_object, *args, **kwargs): + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() # <<<<<<<<<<<<<< + * self.__namestr = self.__name + * self.__name = str2bytes(self.__name) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_function_name, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__name, __pyx_t_1) < 0) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":93 + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() + * self.__namestr = self.__name # <<<<<<<<<<<<<< + * self.__name = str2bytes(self.__name) + * self.__info = None + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__namestr, __pyx_t_1) < 0) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":94 + * self.__name = function_name.upper() + * self.__namestr = self.__name + * self.__name = str2bytes(self.__name) # <<<<<<<<<<<<<< + * self.__info = None + * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_str2bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__name, __pyx_t_1) < 0) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":95 + * self.__namestr = self.__name + * self.__name = str2bytes(self.__name) + * self.__info = None # <<<<<<<<<<<<<< + * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__info, Py_None) < 0) __PYX_ERR(1, 95, __pyx_L1_error) + + /* "talib/_abstract.pxi":96 + * self.__name = str2bytes(self.__name) + * self.__info = None + * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS # <<<<<<<<<<<<<< + * + * # dictionaries of function args. keys are input/opt_input/output parameter names + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_ARRAYS_DEFAULTS); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays, __pyx_t_1) < 0) __PYX_ERR(1, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":99 + * + * # dictionaries of function args. keys are input/opt_input/output parameter names + * self.__input_names = OrderedDict() # <<<<<<<<<<<<<< + * self.__opt_inputs = OrderedDict() + * self.__outputs = OrderedDict() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names, __pyx_t_1) < 0) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":100 + * # dictionaries of function args. keys are input/opt_input/output parameter names + * self.__input_names = OrderedDict() + * self.__opt_inputs = OrderedDict() # <<<<<<<<<<<<<< + * self.__outputs = OrderedDict() + * self.__outputs_valid = False + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs, __pyx_t_1) < 0) __PYX_ERR(1, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":101 + * self.__input_names = OrderedDict() + * self.__opt_inputs = OrderedDict() + * self.__outputs = OrderedDict() # <<<<<<<<<<<<<< + * self.__outputs_valid = False + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs, __pyx_t_1) < 0) __PYX_ERR(1, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":102 + * self.__opt_inputs = OrderedDict() + * self.__outputs = OrderedDict() + * self.__outputs_valid = False # <<<<<<<<<<<<<< + * + * # finish initializing: query the TALIB abstract interface and set arguments + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) __PYX_ERR(1, 102, __pyx_L1_error) + + /* "talib/_abstract.pxi":105 + * + * # finish initializing: query the TALIB abstract interface and set arguments + * self.__initialize_function_info() # <<<<<<<<<<<<<< + * self.set_function_args(*args, **kwargs) + * self.func_object = func_object + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__initialize_function_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":106 + * # finish initializing: query the TALIB abstract interface and set arguments + * self.__initialize_function_info() + * self.set_function_args(*args, **kwargs) # <<<<<<<<<<<<<< + * self.func_object = func_object + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_function_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":107 + * self.__initialize_function_info() + * self.set_function_args(*args, **kwargs) + * self.func_object = func_object # <<<<<<<<<<<<<< + * + * def __initialize_function_info(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_func_object, __pyx_v_func_object) < 0) __PYX_ERR(1, 107, __pyx_L1_error) + + /* "talib/_abstract.pxi":90 + * """ + * + * def __init__(self, function_name, func_object, *args, **kwargs): # <<<<<<<<<<<<<< + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.Function.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":109 + * self.func_object = func_object + * + * def __initialize_function_info(self): # <<<<<<<<<<<<<< + * # function info + * self.__info = _ta_getFuncInfo(self.__name) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_3__initialize_function_info(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_3__initialize_function_info = {"__initialize_function_info", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_3__initialize_function_info, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_3__initialize_function_info(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__initialize_function_info (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_2__initialize_function_info(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_2__initialize_function_info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_info = NULL; + PyObject *__pyx_v_input_name = NULL; + PyObject *__pyx_v_param_name = NULL; + PyObject *__pyx_v_output_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("__initialize_function_info", 0); + + /* "talib/_abstract.pxi":111 + * def __initialize_function_info(self): + * # function info + * self.__info = _ta_getFuncInfo(self.__name) # <<<<<<<<<<<<<< + * + * # inputs (price series names) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getFuncInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__info, __pyx_t_1) < 0) __PYX_ERR(1, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":114 + * + * # inputs (price series names) + * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__1208, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 114, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 114, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 114, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 114, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":115 + * # inputs (price series names) + * for i in xrange(self.__info.pop('num_inputs')): + * info = _ta_getInputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< + * input_name = info['name'] + * if info['price_series'] is None: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getInputParameterInfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_8 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); + __Pyx_INCREF(__pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_i); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":116 + * for i in xrange(self.__info.pop('num_inputs')): + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] # <<<<<<<<<<<<<< + * if info['price_series'] is None: + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":117 + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] + * if info['price_series'] is None: # <<<<<<<<<<<<<< + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] + * self.__input_names[input_name] = info + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_price_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "talib/_abstract.pxi":118 + * input_name = info['name'] + * if info['price_series'] is None: + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] # <<<<<<<<<<<<<< + * self.__input_names[input_name] = info + * self.__info['input_names'] = self.input_names + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_info, __pyx_n_s_price_series, __pyx_t_5) < 0)) __PYX_ERR(1, 118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":117 + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] + * if info['price_series'] is None: # <<<<<<<<<<<<<< + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] + * self.__input_names[input_name] = info + */ + } + + /* "talib/_abstract.pxi":119 + * if info['price_series'] is None: + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] + * self.__input_names[input_name] = info # <<<<<<<<<<<<<< + * self.__info['input_names'] = self.input_names + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_input_name, __pyx_v_info) < 0)) __PYX_ERR(1, 119, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":114 + * + * # inputs (price series names) + * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":120 + * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] + * self.__input_names[input_name] = info + * self.__info['input_names'] = self.input_names # <<<<<<<<<<<<<< + * + * # optional inputs (function parameters) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_input_names, __pyx_t_2) < 0)) __PYX_ERR(1, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":123 + * + * # optional inputs (function parameters) + * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getOptInputParameterInfo(self.__name, i) + * param_name = info['name'] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pop); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__1209, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 123, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 123, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 123, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_7(__pyx_t_5); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 123, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":124 + * # optional inputs (function parameters) + * for i in xrange(self.__info.pop('num_opt_inputs')): + * info = _ta_getOptInputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< + * param_name = info['name'] + * self.__opt_inputs[param_name] = info + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getOptInputParameterInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = NULL; + __pyx_t_8 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_9); + __Pyx_INCREF(__pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_i); + __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":125 + * for i in xrange(self.__info.pop('num_opt_inputs')): + * info = _ta_getOptInputParameterInfo(self.__name, i) + * param_name = info['name'] # <<<<<<<<<<<<<< + * self.__opt_inputs[param_name] = info + * self.__info['parameters'] = self.parameters + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_param_name, __pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":126 + * info = _ta_getOptInputParameterInfo(self.__name, i) + * param_name = info['name'] + * self.__opt_inputs[param_name] = info # <<<<<<<<<<<<<< + * self.__info['parameters'] = self.parameters + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_param_name, __pyx_v_info) < 0)) __PYX_ERR(1, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":123 + * + * # optional inputs (function parameters) + * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getOptInputParameterInfo(self.__name, i) + * param_name = info['name'] + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":127 + * param_name = info['name'] + * self.__opt_inputs[param_name] = info + * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< + * + * # outputs + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_parameters, __pyx_t_5) < 0)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":130 + * + * # outputs + * self.__info['output_flags'] = OrderedDict() # <<<<<<<<<<<<<< + * for i in xrange(self.__info.pop('num_outputs')): + * info = _ta_getOutputParameterInfo(self.__name, i) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_1) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 130, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_output_flags, __pyx_t_5) < 0)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":131 + * # outputs + * self.__info['output_flags'] = OrderedDict() + * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< + * info = _ta_getOutputParameterInfo(self.__name, i) + * output_name = info['name'] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__1210, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 131, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 131, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 131, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 131, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":132 + * self.__info['output_flags'] = OrderedDict() + * for i in xrange(self.__info.pop('num_outputs')): + * info = _ta_getOutputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< + * output_name = info['name'] + * self.__info['output_flags'][output_name] = info['flags'] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getOutputParameterInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = NULL; + __pyx_t_8 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_4); + __Pyx_INCREF(__pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_i); + __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":133 + * for i in xrange(self.__info.pop('num_outputs')): + * info = _ta_getOutputParameterInfo(self.__name, i) + * output_name = info['name'] # <<<<<<<<<<<<<< + * self.__info['output_flags'][output_name] = info['flags'] + * self.__outputs[output_name] = None + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_output_name, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":134 + * info = _ta_getOutputParameterInfo(self.__name, i) + * output_name = info['name'] + * self.__info['output_flags'][output_name] = info['flags'] # <<<<<<<<<<<<<< + * self.__outputs[output_name] = None + * self.__info['output_names'] = self.output_names + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_output_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_output_name, __pyx_t_5) < 0)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":135 + * output_name = info['name'] + * self.__info['output_flags'][output_name] = info['flags'] + * self.__outputs[output_name] = None # <<<<<<<<<<<<<< + * self.__info['output_names'] = self.output_names + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_output_name, Py_None) < 0)) __PYX_ERR(1, 135, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":131 + * # outputs + * self.__info['output_flags'] = OrderedDict() + * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< + * info = _ta_getOutputParameterInfo(self.__name, i) + * output_name = info['name'] + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":136 + * self.__info['output_flags'][output_name] = info['flags'] + * self.__outputs[output_name] = None + * self.__info['output_names'] = self.output_names # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_output_names, __pyx_t_2) < 0)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":109 + * self.func_object = func_object + * + * def __initialize_function_info(self): # <<<<<<<<<<<<<< + * # function info + * self.__info = _ta_getFuncInfo(self.__name) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("talib._ta_lib.Function.__initialize_function_info", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_info); + __Pyx_XDECREF(__pyx_v_input_name); + __Pyx_XDECREF(__pyx_v_param_name); + __Pyx_XDECREF(__pyx_v_output_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":139 + * + * @property + * def info(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the function's info dict. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_5info(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_4info[] = "\n Returns a copy of the function's info dict.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_5info = {"info", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_5info, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_4info}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_5info(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("info (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_4info(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_4info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("info", 0); + + /* "talib/_abstract.pxi":143 + * Returns a copy of the function's info dict. + * """ + * return self.__info.copy() # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 143, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":139 + * + * @property + * def info(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the function's info dict. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.info", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":146 + * + * @property + * def function_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns any function flags defined for this indicator function. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_7function_flags(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_6function_flags[] = "\n Returns any function flags defined for this indicator function.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_7function_flags = {"function_flags", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_7function_flags, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_6function_flags}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_7function_flags(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("function_flags (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_6function_flags(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_6function_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("function_flags", 0); + + /* "talib/_abstract.pxi":150 + * Returns any function flags defined for this indicator function. + * """ + * return self.__info['function_flags'] # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_function_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":146 + * + * @property + * def function_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns any function flags defined for this indicator function. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.Function.function_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":153 + * + * @property + * def output_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns the flags for each output for this indicator function. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_9output_flags(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_8output_flags[] = "\n Returns the flags for each output for this indicator function.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_9output_flags = {"output_flags", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_9output_flags, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_8output_flags}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_9output_flags(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("output_flags (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_8output_flags(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_8output_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("output_flags", 0); + + /* "talib/_abstract.pxi":157 + * Returns the flags for each output for this indicator function. + * """ + * return self.__info['output_flags'].copy() # <<<<<<<<<<<<<< + * + * def get_input_names(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_output_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":153 + * + * @property + * def output_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns the flags for each output for this indicator function. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.output_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":159 + * return self.__info['output_flags'].copy() + * + * def get_input_names(self): # <<<<<<<<<<<<<< + * """ + * Returns the dict of input price series names that specifies which + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_11get_input_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_10get_input_names[] = "\n Returns the dict of input price series names that specifies which\n of the ndarrays in input_arrays will be used to calculate the function.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_11get_input_names = {"get_input_names", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_11get_input_names, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_10get_input_names}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_11get_input_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_input_names (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_10get_input_names(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_10get_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_input_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + __Pyx_RefNannySetupContext("get_input_names", 0); + + /* "talib/_abstract.pxi":164 + * of the ndarrays in input_arrays will be used to calculate the function. + * """ + * ret = OrderedDict() # <<<<<<<<<<<<<< + * for input_name in self.__input_names: + * ret[input_name] = self.__input_names[input_name]['price_series'] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 164, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":165 + * """ + * ret = OrderedDict() + * for input_name in self.__input_names: # <<<<<<<<<<<<<< + * ret[input_name] = self.__input_names[input_name]['price_series'] + * return ret + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 165, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 165, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 165, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 165, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":166 + * ret = OrderedDict() + * for input_name in self.__input_names: + * ret[input_name] = self.__input_names[input_name]['price_series'] # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_price_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_v_input_name, __pyx_t_1) < 0)) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":165 + * """ + * ret = OrderedDict() + * for input_name in self.__input_names: # <<<<<<<<<<<<<< + * ret[input_name] = self.__input_names[input_name]['price_series'] + * return ret + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":167 + * for input_name in self.__input_names: + * ret[input_name] = self.__input_names[input_name]['price_series'] + * return ret # <<<<<<<<<<<<<< + * + * def set_input_names(self, input_names): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "talib/_abstract.pxi":159 + * return self.__info['output_flags'].copy() + * + * def get_input_names(self): # <<<<<<<<<<<<<< + * """ + * Returns the dict of input price series names that specifies which + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.get_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_input_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":169 + * return ret + * + * def set_input_names(self, input_names): # <<<<<<<<<<<<<< + * """ + * Sets the input price series names to use. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_13set_input_names(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_12set_input_names[] = "\n Sets the input price series names to use.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_13set_input_names = {"set_input_names", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_13set_input_names, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_12set_input_names}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_13set_input_names(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_input_names = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_input_names (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_names,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_names)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_input_names", 1, 2, 2, 1); __PYX_ERR(1, 169, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_names") < 0)) __PYX_ERR(1, 169, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_input_names = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_input_names", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 169, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.Function.set_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_12set_input_names(__pyx_self, __pyx_v_self, __pyx_v_input_names); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_12set_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_names) { + PyObject *__pyx_v_input_name = NULL; + PyObject *__pyx_v_price_series = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + __Pyx_RefNannySetupContext("set_input_names", 0); + + /* "talib/_abstract.pxi":173 + * Sets the input price series names to use. + * """ + * for input_name, price_series in input_names.items(): # <<<<<<<<<<<<<< + * self.__input_names[input_name]['price_series'] = price_series + * self.__info['input_names'][input_name] = price_series + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_names, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 173, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 173, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 173, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 173, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 173, __pyx_L1_error) + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 173, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 173, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_6); + __pyx_t_6 = 0; + + /* "talib/_abstract.pxi":174 + * """ + * for input_name, price_series in input_names.items(): + * self.__input_names[input_name]['price_series'] = price_series # <<<<<<<<<<<<<< + * self.__info['input_names'][input_name] = price_series + * self.__outputs_valid = False + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_price_series, __pyx_v_price_series) < 0)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "talib/_abstract.pxi":175 + * for input_name, price_series in input_names.items(): + * self.__input_names[input_name]['price_series'] = price_series + * self.__info['input_names'][input_name] = price_series # <<<<<<<<<<<<<< + * self.__outputs_valid = False + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_input_name, __pyx_v_price_series) < 0)) __PYX_ERR(1, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":173 + * Sets the input price series names to use. + * """ + * for input_name, price_series in input_names.items(): # <<<<<<<<<<<<<< + * self.__input_names[input_name]['price_series'] = price_series + * self.__info['input_names'][input_name] = price_series + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":176 + * self.__input_names[input_name]['price_series'] = price_series + * self.__info['input_names'][input_name] = price_series + * self.__outputs_valid = False # <<<<<<<<<<<<<< + * + * input_names = property(get_input_names, set_input_names) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) __PYX_ERR(1, 176, __pyx_L1_error) + + /* "talib/_abstract.pxi":169 + * return ret + * + * def set_input_names(self, input_names): # <<<<<<<<<<<<<< + * """ + * Sets the input price series names to use. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("talib._ta_lib.Function.set_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_input_name); + __Pyx_XDECREF(__pyx_v_price_series); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":180 + * input_names = property(get_input_names, set_input_names) + * + * def get_input_arrays(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the dict of input arrays in use. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_15get_input_arrays(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_14get_input_arrays[] = "\n Returns a copy of the dict of input arrays in use.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_15get_input_arrays = {"get_input_arrays", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_15get_input_arrays, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_14get_input_arrays}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_15get_input_arrays(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_input_arrays (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_14get_input_arrays(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_14get_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_input_arrays", 0); + + /* "talib/_abstract.pxi":184 + * Returns a copy of the dict of input arrays in use. + * """ + * return self.__input_arrays.copy() # <<<<<<<<<<<<<< + * + * def set_input_arrays(self, input_arrays): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":180 + * input_names = property(get_input_names, set_input_names) + * + * def get_input_arrays(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the dict of input arrays in use. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.get_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":186 + * return self.__input_arrays.copy() + * + * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< + * """ + * Sets the dict of input_arrays to use. Returns True/False for + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_17set_input_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_16set_input_arrays[] = "\n Sets the dict of input_arrays to use. Returns True/False for\n subclasses:\n\n If input_arrays is a dict with the keys open, high, low, close and\n volume, it is assigned as the input_array to use and this function\n returns True, returning False otherwise. If you implement your own\n data type and wish to subclass Function, you should wrap this function\n with an if-statement:\n\n class CustomFunction(Function):\n def __init__(self, function_name):\n Function.__init__(self, function_name)\n\n def set_input_arrays(self, input_data):\n if Function.set_input_arrays(self, input_data):\n return True\n elif isinstance(input_data, some_module.CustomDataType):\n input_arrays = Function.get_input_arrays(self)\n # convert input_data to input_arrays and then call the super\n Function.set_input_arrays(self, input_arrays)\n return True\n return False\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_17set_input_arrays = {"set_input_arrays", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_17set_input_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_16set_input_arrays}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_17set_input_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_input_arrays = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_input_arrays (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_arrays,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_arrays)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_input_arrays", 1, 2, 2, 1); __PYX_ERR(1, 186, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_arrays") < 0)) __PYX_ERR(1, 186, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_input_arrays = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_input_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 186, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.Function.set_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_16set_input_arrays(__pyx_self, __pyx_v_self, __pyx_v_input_arrays); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_16set_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays) { + PyObject *__pyx_v_missing_keys = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + __Pyx_RefNannySetupContext("set_input_arrays", 0); + + /* "talib/_abstract.pxi":211 + * return False + * """ + * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): # <<<<<<<<<<<<<< + * missing_keys = [] + * for key in self.__input_price_series_names(): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_ARRAYS_TYPES); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_input_arrays, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "talib/_abstract.pxi":212 + * """ + * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): + * missing_keys = [] # <<<<<<<<<<<<<< + * for key in self.__input_price_series_names(): + * if key not in input_arrays: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_missing_keys = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":213 + * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): + * missing_keys = [] + * for key in self.__input_price_series_names(): # <<<<<<<<<<<<<< + * if key not in input_arrays: + * missing_keys.append(key) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_price_series_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 213, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 213, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 213, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 213, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":214 + * missing_keys = [] + * for key in self.__input_price_series_names(): + * if key not in input_arrays: # <<<<<<<<<<<<<< + * missing_keys.append(key) + * if len(missing_keys) == 0: + */ + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_input_arrays, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 214, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "talib/_abstract.pxi":215 + * for key in self.__input_price_series_names(): + * if key not in input_arrays: + * missing_keys.append(key) # <<<<<<<<<<<<<< + * if len(missing_keys) == 0: + * self.__input_arrays = input_arrays + */ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_keys, __pyx_v_key); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 215, __pyx_L1_error) + + /* "talib/_abstract.pxi":214 + * missing_keys = [] + * for key in self.__input_price_series_names(): + * if key not in input_arrays: # <<<<<<<<<<<<<< + * missing_keys.append(key) + * if len(missing_keys) == 0: + */ + } + + /* "talib/_abstract.pxi":213 + * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): + * missing_keys = [] + * for key in self.__input_price_series_names(): # <<<<<<<<<<<<<< + * if key not in input_arrays: + * missing_keys.append(key) + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":216 + * if key not in input_arrays: + * missing_keys.append(key) + * if len(missing_keys) == 0: # <<<<<<<<<<<<<< + * self.__input_arrays = input_arrays + * self.__outputs_valid = False + */ + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_missing_keys); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 216, __pyx_L1_error) + __pyx_t_2 = ((__pyx_t_6 == 0) != 0); + if (__pyx_t_2) { + + /* "talib/_abstract.pxi":217 + * missing_keys.append(key) + * if len(missing_keys) == 0: + * self.__input_arrays = input_arrays # <<<<<<<<<<<<<< + * self.__outputs_valid = False + * return True + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays, __pyx_v_input_arrays) < 0) __PYX_ERR(1, 217, __pyx_L1_error) + + /* "talib/_abstract.pxi":218 + * if len(missing_keys) == 0: + * self.__input_arrays = input_arrays + * self.__outputs_valid = False # <<<<<<<<<<<<<< + * return True + * else: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) __PYX_ERR(1, 218, __pyx_L1_error) + + /* "talib/_abstract.pxi":219 + * self.__input_arrays = input_arrays + * self.__outputs_valid = False + * return True # <<<<<<<<<<<<<< + * else: + * raise Exception('input_arrays parameter missing required data '\ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "talib/_abstract.pxi":216 + * if key not in input_arrays: + * missing_keys.append(key) + * if len(missing_keys) == 0: # <<<<<<<<<<<<<< + * self.__input_arrays = input_arrays + * self.__outputs_valid = False + */ + } + + /* "talib/_abstract.pxi":221 + * return True + * else: + * raise Exception('input_arrays parameter missing required data '\ # <<<<<<<<<<<<<< + * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ + * else '', + */ + /*else*/ { + + /* "talib/_abstract.pxi":222 + * else: + * raise Exception('input_arrays parameter missing required data '\ + * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ # <<<<<<<<<<<<<< + * else '', + * ', '.join(missing_keys))) + */ + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_missing_keys); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 222, __pyx_L1_error) + if (((__pyx_t_6 > 1) != 0)) { + __Pyx_INCREF(__pyx_n_s_s); + __pyx_t_4 = __pyx_n_s_s; + } else { + __Pyx_INCREF(__pyx_kp_s__1211); + __pyx_t_4 = __pyx_kp_s__1211; + } + + /* "talib/_abstract.pxi":224 + * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ + * else '', + * ', '.join(missing_keys))) # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__1212, __pyx_v_missing_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "talib/_abstract.pxi":222 + * else: + * raise Exception('input_arrays parameter missing required data '\ + * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ # <<<<<<<<<<<<<< + * else '', + * ', '.join(missing_keys))) + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_input_arrays_parameter_missing_r, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":221 + * return True + * else: + * raise Exception('input_arrays parameter missing required data '\ # <<<<<<<<<<<<<< + * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ + * else '', + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 221, __pyx_L1_error) + } + + /* "talib/_abstract.pxi":211 + * return False + * """ + * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): # <<<<<<<<<<<<<< + * missing_keys = [] + * for key in self.__input_price_series_names(): + */ + } + + /* "talib/_abstract.pxi":225 + * else '', + * ', '.join(missing_keys))) + * return False # <<<<<<<<<<<<<< + * + * input_arrays = property(get_input_arrays, set_input_arrays) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "talib/_abstract.pxi":186 + * return self.__input_arrays.copy() + * + * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< + * """ + * Sets the dict of input_arrays to use. Returns True/False for + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.Function.set_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_missing_keys); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":229 + * input_arrays = property(get_input_arrays, set_input_arrays) + * + * def get_parameters(self): # <<<<<<<<<<<<<< + * """ + * Returns the function's optional parameters and their default values. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_19get_parameters(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_18get_parameters[] = "\n Returns the function's optional parameters and their default values.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_19get_parameters = {"get_parameters", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_19get_parameters, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_18get_parameters}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_19get_parameters(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_parameters (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_18get_parameters(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_18get_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_opt_input = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("get_parameters", 0); + + /* "talib/_abstract.pxi":233 + * Returns the function's optional parameters and their default values. + * """ + * ret = OrderedDict() # <<<<<<<<<<<<<< + * for opt_input in self.__opt_inputs: + * ret[opt_input] = self.__get_opt_input_value(opt_input) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":234 + * """ + * ret = OrderedDict() + * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< + * ret[opt_input] = self.__get_opt_input_value(opt_input) + * return ret + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 234, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 234, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 234, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 234, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":235 + * ret = OrderedDict() + * for opt_input in self.__opt_inputs: + * ret[opt_input] = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_opt_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v_opt_input); + __Pyx_GIVEREF(__pyx_v_opt_input); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_opt_input); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_v_opt_input, __pyx_t_1) < 0)) __PYX_ERR(1, 235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":234 + * """ + * ret = OrderedDict() + * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< + * ret[opt_input] = self.__get_opt_input_value(opt_input) + * return ret + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":236 + * for opt_input in self.__opt_inputs: + * ret[opt_input] = self.__get_opt_input_value(opt_input) + * return ret # <<<<<<<<<<<<<< + * + * def set_parameters(self, parameters): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "talib/_abstract.pxi":229 + * input_arrays = property(get_input_arrays, set_input_arrays) + * + * def get_parameters(self): # <<<<<<<<<<<<<< + * """ + * Returns the function's optional parameters and their default values. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("talib._ta_lib.Function.get_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_opt_input); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":238 + * return ret + * + * def set_parameters(self, parameters): # <<<<<<<<<<<<<< + * """ + * Sets the function parameter values. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_21set_parameters(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_20set_parameters[] = "\n Sets the function parameter values.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_21set_parameters = {"set_parameters", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_21set_parameters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_20set_parameters}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_21set_parameters(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_parameters = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_parameters (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parameters,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameters)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_parameters", 1, 2, 2, 1); __PYX_ERR(1, 238, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_parameters") < 0)) __PYX_ERR(1, 238, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_parameters = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_parameters", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 238, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.Function.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_20set_parameters(__pyx_self, __pyx_v_self, __pyx_v_parameters); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_20set_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameters) { + PyObject *__pyx_v_param = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + __Pyx_RefNannySetupContext("set_parameters", 0); + + /* "talib/_abstract.pxi":242 + * Sets the function parameter values. + * """ + * for param, value in parameters.items(): # <<<<<<<<<<<<<< + * self.__opt_inputs[param]['value'] = value + * self.__outputs_valid = False + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parameters, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 242, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 242, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 242, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 242, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 242, __pyx_L1_error) + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 242, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 242, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "talib/_abstract.pxi":243 + * """ + * for param, value in parameters.items(): + * self.__opt_inputs[param]['value'] = value # <<<<<<<<<<<<<< + * self.__outputs_valid = False + * self.__info['parameters'] = self.parameters + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_v_param); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_value, __pyx_v_value) < 0)) __PYX_ERR(1, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "talib/_abstract.pxi":242 + * Sets the function parameter values. + * """ + * for param, value in parameters.items(): # <<<<<<<<<<<<<< + * self.__opt_inputs[param]['value'] = value + * self.__outputs_valid = False + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":244 + * for param, value in parameters.items(): + * self.__opt_inputs[param]['value'] = value + * self.__outputs_valid = False # <<<<<<<<<<<<<< + * self.__info['parameters'] = self.parameters + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) __PYX_ERR(1, 244, __pyx_L1_error) + + /* "talib/_abstract.pxi":245 + * self.__opt_inputs[param]['value'] = value + * self.__outputs_valid = False + * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< + * + * parameters = property(get_parameters, set_parameters) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_parameters, __pyx_t_2) < 0)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":238 + * return ret + * + * def set_parameters(self, parameters): # <<<<<<<<<<<<<< + * """ + * Sets the function parameter values. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("talib._ta_lib.Function.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_param); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":249 + * parameters = property(get_parameters, set_parameters) + * + * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_23set_function_args(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_22set_function_args[] = "\n optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_23set_function_args = {"set_function_args", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_23set_function_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_22set_function_args}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_23set_function_args(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_function_args (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "set_function_args") < 0)) __PYX_ERR(1, 249, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_function_args", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 249, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("talib._ta_lib.Function.set_function_args", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_22set_function_args(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_22set_function_args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + int __pyx_v_update_info; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_skip_first = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_param_name = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + __Pyx_RefNannySetupContext("set_function_args", 0); + + /* "talib/_abstract.pxi":253 + * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] + * """ + * update_info = False # <<<<<<<<<<<<<< + * + * for key in kwargs: + */ + __pyx_v_update_info = 0; + + /* "talib/_abstract.pxi":255 + * update_info = False + * + * for key in kwargs: # <<<<<<<<<<<<<< + * if key in self.__opt_inputs: + * self.__opt_inputs[key]['value'] = kwargs[key] + */ + __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, ((PyObject *)NULL), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4); + if (unlikely(__pyx_t_6 == 0)) break; + if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":256 + * + * for key in kwargs: + * if key in self.__opt_inputs: # <<<<<<<<<<<<<< + * self.__opt_inputs[key]['value'] = kwargs[key] + * update_info = True + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "talib/_abstract.pxi":257 + * for key in kwargs: + * if key in self.__opt_inputs: + * self.__opt_inputs[key]['value'] = kwargs[key] # <<<<<<<<<<<<<< + * update_info = True + * elif key in self.__input_names: + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetItem(__pyx_t_9, __pyx_v_key); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_n_s_value, __pyx_t_5) < 0)) __PYX_ERR(1, 257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":258 + * if key in self.__opt_inputs: + * self.__opt_inputs[key]['value'] = kwargs[key] + * update_info = True # <<<<<<<<<<<<<< + * elif key in self.__input_names: + * self.__input_names[key]['price_series'] = kwargs[key] + */ + __pyx_v_update_info = 1; + + /* "talib/_abstract.pxi":256 + * + * for key in kwargs: + * if key in self.__opt_inputs: # <<<<<<<<<<<<<< + * self.__opt_inputs[key]['value'] = kwargs[key] + * update_info = True + */ + goto __pyx_L5; + } + + /* "talib/_abstract.pxi":259 + * self.__opt_inputs[key]['value'] = kwargs[key] + * update_info = True + * elif key in self.__input_names: # <<<<<<<<<<<<<< + * self.__input_names[key]['price_series'] = kwargs[key] + * self.__info['input_names'][key] = kwargs[key] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":260 + * update_info = True + * elif key in self.__input_names: + * self.__input_names[key]['price_series'] = kwargs[key] # <<<<<<<<<<<<<< + * self.__info['input_names'][key] = kwargs[key] + * + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_GetItem(__pyx_t_10, __pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_n_s_price_series, __pyx_t_5) < 0)) __PYX_ERR(1, 260, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":261 + * elif key in self.__input_names: + * self.__input_names[key]['price_series'] = kwargs[key] + * self.__info['input_names'][key] = kwargs[key] # <<<<<<<<<<<<<< + * + * if args: + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetItem(__pyx_t_9, __pyx_n_s_input_names); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(1, 261, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":259 + * self.__opt_inputs[key]['value'] = kwargs[key] + * update_info = True + * elif key in self.__input_names: # <<<<<<<<<<<<<< + * self.__input_names[key]['price_series'] = kwargs[key] + * self.__info['input_names'][key] = kwargs[key] + */ + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":263 + * self.__info['input_names'][key] = kwargs[key] + * + * if args: # <<<<<<<<<<<<<< + * skip_first = 0 + * if self.set_input_arrays(args[0]): + */ + __pyx_t_7 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":264 + * + * if args: + * skip_first = 0 # <<<<<<<<<<<<<< + * if self.set_input_arrays(args[0]): + * skip_first = 1 + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_skip_first = __pyx_int_0; + + /* "talib/_abstract.pxi":265 + * if args: + * skip_first = 0 + * if self.set_input_arrays(args[0]): # <<<<<<<<<<<<<< + * skip_first = 1 + * if len(args) > skip_first: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_input_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_9) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":266 + * skip_first = 0 + * if self.set_input_arrays(args[0]): + * skip_first = 1 # <<<<<<<<<<<<<< + * if len(args) > skip_first: + * for i, param_name in enumerate(self.__opt_inputs): + */ + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_skip_first, __pyx_int_1); + + /* "talib/_abstract.pxi":265 + * if args: + * skip_first = 0 + * if self.set_input_arrays(args[0]): # <<<<<<<<<<<<<< + * skip_first = 1 + * if len(args) > skip_first: + */ + } + + /* "talib/_abstract.pxi":267 + * if self.set_input_arrays(args[0]): + * skip_first = 1 + * if len(args) > skip_first: # <<<<<<<<<<<<<< + * for i, param_name in enumerate(self.__opt_inputs): + * i += skip_first + */ + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 267, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_skip_first, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":268 + * skip_first = 1 + * if len(args) > skip_first: + * for i, param_name in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< + * i += skip_first + * if i < len(args): + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_5 = __pyx_int_0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_3 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 268, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_11))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_11)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 268, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_11)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 268, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_12(__pyx_t_11); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 268, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_param_name, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); + __pyx_t_5 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":269 + * if len(args) > skip_first: + * for i, param_name in enumerate(self.__opt_inputs): + * i += skip_first # <<<<<<<<<<<<<< + * if i < len(args): + * value = args[i] + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_v_skip_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":270 + * for i, param_name in enumerate(self.__opt_inputs): + * i += skip_first + * if i < len(args): # <<<<<<<<<<<<<< + * value = args[i] + * self.__opt_inputs[param_name]['value'] = value + */ + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 270, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":271 + * i += skip_first + * if i < len(args): + * value = args[i] # <<<<<<<<<<<<<< + * self.__opt_inputs[param_name]['value'] = value + * update_info = True + */ + __pyx_t_10 = PyObject_GetItem(__pyx_v_args, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10); + __pyx_t_10 = 0; + + /* "talib/_abstract.pxi":272 + * if i < len(args): + * value = args[i] + * self.__opt_inputs[param_name]['value'] = value # <<<<<<<<<<<<<< + * update_info = True + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyObject_GetItem(__pyx_t_10, __pyx_v_param_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_value, __pyx_v_value) < 0)) __PYX_ERR(1, 272, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":273 + * value = args[i] + * self.__opt_inputs[param_name]['value'] = value + * update_info = True # <<<<<<<<<<<<<< + * + * if args or kwargs: + */ + __pyx_v_update_info = 1; + + /* "talib/_abstract.pxi":270 + * for i, param_name in enumerate(self.__opt_inputs): + * i += skip_first + * if i < len(args): # <<<<<<<<<<<<<< + * value = args[i] + * self.__opt_inputs[param_name]['value'] = value + */ + } + + /* "talib/_abstract.pxi":268 + * skip_first = 1 + * if len(args) > skip_first: + * for i, param_name in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< + * i += skip_first + * if i < len(args): + */ + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":267 + * if self.set_input_arrays(args[0]): + * skip_first = 1 + * if len(args) > skip_first: # <<<<<<<<<<<<<< + * for i, param_name in enumerate(self.__opt_inputs): + * i += skip_first + */ + } + + /* "talib/_abstract.pxi":263 + * self.__info['input_names'][key] = kwargs[key] + * + * if args: # <<<<<<<<<<<<<< + * skip_first = 0 + * if self.set_input_arrays(args[0]): + */ + } + + /* "talib/_abstract.pxi":275 + * update_info = True + * + * if args or kwargs: # <<<<<<<<<<<<<< + * if update_info: + * self.__info['parameters'] = self.parameters + */ + __pyx_t_8 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 275, __pyx_L1_error) + __pyx_t_7 = __pyx_t_8; + __pyx_L13_bool_binop_done:; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":276 + * + * if args or kwargs: + * if update_info: # <<<<<<<<<<<<<< + * self.__info['parameters'] = self.parameters + * self.__outputs_valid = False + */ + __pyx_t_7 = (__pyx_v_update_info != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":277 + * if args or kwargs: + * if update_info: + * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< + * self.__outputs_valid = False + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_n_s_parameters, __pyx_t_5) < 0)) __PYX_ERR(1, 277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":276 + * + * if args or kwargs: + * if update_info: # <<<<<<<<<<<<<< + * self.__info['parameters'] = self.parameters + * self.__outputs_valid = False + */ + } + + /* "talib/_abstract.pxi":278 + * if update_info: + * self.__info['parameters'] = self.parameters + * self.__outputs_valid = False # <<<<<<<<<<<<<< + * + * @property + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) __PYX_ERR(1, 278, __pyx_L1_error) + + /* "talib/_abstract.pxi":275 + * update_info = True + * + * if args or kwargs: # <<<<<<<<<<<<<< + * if update_info: + * self.__info['parameters'] = self.parameters + */ + } + + /* "talib/_abstract.pxi":249 + * parameters = property(get_parameters, set_parameters) + * + * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("talib._ta_lib.Function.set_function_args", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_skip_first); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_param_name); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":281 + * + * @property + * def lookback(self): # <<<<<<<<<<<<<< + * """ + * Returns the lookback window size for the function with the parameter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_25lookback(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_24lookback[] = "\n Returns the lookback window size for the function with the parameter\n values that are currently set.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_25lookback = {"lookback", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_25lookback, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_24lookback}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_25lookback(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookback (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_24lookback(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_24lookback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + TA_ParamHolder *__pyx_v_holder; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_opt_input = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_type_ = NULL; + int __pyx_v_lookback; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("lookback", 0); + + /* "talib/_abstract.pxi":287 + * """ + * cdef lib.TA_ParamHolder *holder + * holder = __ta_paramHolderAlloc(self.__name) # <<<<<<<<<<<<<< + * for i, opt_input in enumerate(self.__opt_inputs): + * value = self.__get_opt_input_value(opt_input) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 287, __pyx_L1_error) + __pyx_v_holder = __pyx_f_5talib_7_ta_lib___ta_paramHolderAlloc(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":288 + * cdef lib.TA_ParamHolder *holder + * holder = __ta_paramHolderAlloc(self.__name) + * for i, opt_input in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< + * value = self.__get_opt_input_value(opt_input) + * type_ = self.__opt_inputs[opt_input]['type'] + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 288, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 288, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 288, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":289 + * holder = __ta_paramHolderAlloc(self.__name) + * for i, opt_input in enumerate(self.__opt_inputs): + * value = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< + * type_ = self.__opt_inputs[opt_input]['type'] + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_8) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_opt_input); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_v_opt_input); + __Pyx_GIVEREF(__pyx_v_opt_input); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_opt_input); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":290 + * for i, opt_input in enumerate(self.__opt_inputs): + * value = self.__get_opt_input_value(opt_input) + * type_ = self.__opt_inputs[opt_input]['type'] # <<<<<<<<<<<<<< + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: + * __ta_setOptInputParamReal(holder, i, value) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_opt_input); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_type_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_3); + __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":291 + * value = self.__get_opt_input_value(opt_input) + * type_ = self.__opt_inputs[opt_input]['type'] + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: # <<<<<<<<<<<<<< + * __ta_setOptInputParamReal(holder, i, value) + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: + */ + __pyx_t_3 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_RealRange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_RealList); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __pyx_t_11; + __pyx_L6_bool_binop_done:; + if (__pyx_t_10) { + + /* "talib/_abstract.pxi":292 + * type_ = self.__opt_inputs[opt_input]['type'] + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: + * __ta_setOptInputParamReal(holder, i, value) # <<<<<<<<<<<<<< + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: + * __ta_setOptInputParamInteger(holder, i, value) + */ + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 292, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 292, __pyx_L1_error) + __pyx_f_5talib_7_ta_lib___ta_setOptInputParamReal(__pyx_v_holder, __pyx_t_12, __pyx_t_13); + + /* "talib/_abstract.pxi":291 + * value = self.__get_opt_input_value(opt_input) + * type_ = self.__opt_inputs[opt_input]['type'] + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: # <<<<<<<<<<<<<< + * __ta_setOptInputParamReal(holder, i, value) + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: + */ + goto __pyx_L5; + } + + /* "talib/_abstract.pxi":293 + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: + * __ta_setOptInputParamReal(holder, i, value) + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: # <<<<<<<<<<<<<< + * __ta_setOptInputParamInteger(holder, i, value) + * + */ + __pyx_t_3 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_IntegerRange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_IntegerList); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __pyx_t_11; + __pyx_L8_bool_binop_done:; + if (__pyx_t_10) { + + /* "talib/_abstract.pxi":294 + * __ta_setOptInputParamReal(holder, i, value) + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: + * __ta_setOptInputParamInteger(holder, i, value) # <<<<<<<<<<<<<< + * + * lookback = __ta_getLookback(holder) + */ + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 294, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 294, __pyx_L1_error) + __pyx_f_5talib_7_ta_lib___ta_setOptInputParamInteger(__pyx_v_holder, __pyx_t_13, __pyx_t_12); + + /* "talib/_abstract.pxi":293 + * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: + * __ta_setOptInputParamReal(holder, i, value) + * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: # <<<<<<<<<<<<<< + * __ta_setOptInputParamInteger(holder, i, value) + * + */ + } + __pyx_L5:; + + /* "talib/_abstract.pxi":288 + * cdef lib.TA_ParamHolder *holder + * holder = __ta_paramHolderAlloc(self.__name) + * for i, opt_input in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< + * value = self.__get_opt_input_value(opt_input) + * type_ = self.__opt_inputs[opt_input]['type'] + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":296 + * __ta_setOptInputParamInteger(holder, i, value) + * + * lookback = __ta_getLookback(holder) # <<<<<<<<<<<<<< + * __ta_paramHolderFree(holder) + * return lookback + */ + __pyx_v_lookback = __pyx_f_5talib_7_ta_lib___ta_getLookback(__pyx_v_holder); + + /* "talib/_abstract.pxi":297 + * + * lookback = __ta_getLookback(holder) + * __ta_paramHolderFree(holder) # <<<<<<<<<<<<<< + * return lookback + * + */ + __pyx_f_5talib_7_ta_lib___ta_paramHolderFree(__pyx_v_holder); + + /* "talib/_abstract.pxi":298 + * lookback = __ta_getLookback(holder) + * __ta_paramHolderFree(holder) + * return lookback # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_lookback); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":281 + * + * @property + * def lookback(self): # <<<<<<<<<<<<<< + * """ + * Returns the lookback window size for the function with the parameter + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("talib._ta_lib.Function.lookback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_opt_input); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_type_); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":301 + * + * @property + * def output_names(self): # <<<<<<<<<<<<<< + * """ + * Returns a list of the output names returned by this function. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_27output_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_26output_names[] = "\n Returns a list of the output names returned by this function.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_27output_names = {"output_names", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_27output_names, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_26output_names}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_27output_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("output_names (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_26output_names(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_26output_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("output_names", 0); + + /* "talib/_abstract.pxi":305 + * Returns a list of the output names returned by this function. + * """ + * ret = self.__outputs.keys() # <<<<<<<<<<<<<< + * if not isinstance(ret, list): + * ret = list(ret) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 305, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":306 + * """ + * ret = self.__outputs.keys() + * if not isinstance(ret, list): # <<<<<<<<<<<<<< + * ret = list(ret) + * return ret + */ + __pyx_t_4 = PyList_Check(__pyx_v_ret); + __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_5) { + + /* "talib/_abstract.pxi":307 + * ret = self.__outputs.keys() + * if not isinstance(ret, list): + * ret = list(ret) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_1 = PySequence_List(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":306 + * """ + * ret = self.__outputs.keys() + * if not isinstance(ret, list): # <<<<<<<<<<<<<< + * ret = list(ret) + * return ret + */ + } + + /* "talib/_abstract.pxi":308 + * if not isinstance(ret, list): + * ret = list(ret) + * return ret # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "talib/_abstract.pxi":301 + * + * @property + * def output_names(self): # <<<<<<<<<<<<<< + * """ + * Returns a list of the output names returned by this function. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.output_names", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":311 + * + * @property + * def outputs(self): # <<<<<<<<<<<<<< + * """ + * Returns the TA function values for the currently set input_arrays and + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_29outputs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_28outputs[] = "\n Returns the TA function values for the currently set input_arrays and\n parameters. Returned values are a ndarray if there is only one output\n or a list of ndarrays for more than one output.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_29outputs = {"outputs", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_29outputs, METH_O, __pyx_doc_5talib_7_ta_lib_8Function_28outputs}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_29outputs(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outputs (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_28outputs(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_28outputs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("outputs", 0); + + /* "talib/_abstract.pxi":317 + * or a list of ndarrays for more than one output. + * """ + * if not self.__outputs_valid: # <<<<<<<<<<<<<< + * self.__call_function() + * ret = self.__outputs.values() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "talib/_abstract.pxi":318 + * """ + * if not self.__outputs_valid: + * self.__call_function() # <<<<<<<<<<<<<< + * ret = self.__outputs.values() + * if not isinstance(ret, list): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 318, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":317 + * or a list of ndarrays for more than one output. + * """ + * if not self.__outputs_valid: # <<<<<<<<<<<<<< + * self.__call_function() + * ret = self.__outputs.values() + */ + } + + /* "talib/_abstract.pxi":319 + * if not self.__outputs_valid: + * self.__call_function() + * ret = self.__outputs.values() # <<<<<<<<<<<<<< + * if not isinstance(ret, list): + * ret = list(ret) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 319, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":320 + * self.__call_function() + * ret = self.__outputs.values() + * if not isinstance(ret, list): # <<<<<<<<<<<<<< + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ + */ + __pyx_t_3 = PyList_Check(__pyx_v_ret); + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_2) { + + /* "talib/_abstract.pxi":321 + * ret = self.__outputs.values() + * if not isinstance(ret, list): + * ret = list(ret) # <<<<<<<<<<<<<< + * if __PANDAS_DATAFRAME is not None and \ + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + */ + __pyx_t_1 = PySequence_List(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":320 + * self.__call_function() + * ret = self.__outputs.values() + * if not isinstance(ret, list): # <<<<<<<<<<<<<< + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ + */ + } + + /* "talib/_abstract.pxi":322 + * if not isinstance(ret, list): + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + } else { + __pyx_t_2 = __pyx_t_6; + goto __pyx_L6_bool_binop_done; + } + + /* "talib/_abstract.pxi":323 + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): # <<<<<<<<<<<<<< + * index = self.__input_arrays.index + * if len(ret) == 1: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_IsInstance(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 323, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L6_bool_binop_done:; + + /* "talib/_abstract.pxi":322 + * if not isinstance(ret, list): + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index + */ + if (__pyx_t_2) { + + /* "talib/_abstract.pxi":324 + * if __PANDAS_DATAFRAME is not None and \ + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index # <<<<<<<<<<<<<< + * if len(ret) == 1: + * return __PANDAS_SERIES(ret[0], index=index) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_index = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":325 + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index + * if len(ret) == 1: # <<<<<<<<<<<<<< + * return __PANDAS_SERIES(ret[0], index=index) + * else: + */ + __pyx_t_7 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 325, __pyx_L1_error) + __pyx_t_2 = ((__pyx_t_7 == 1) != 0); + if (__pyx_t_2) { + + /* "talib/_abstract.pxi":326 + * index = self.__input_arrays.index + * if len(ret) == 1: + * return __PANDAS_SERIES(ret[0], index=index) # <<<<<<<<<<<<<< + * else: + * return __PANDAS_DATAFRAME(numpy.column_stack(ret), + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":325 + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index + * if len(ret) == 1: # <<<<<<<<<<<<<< + * return __PANDAS_SERIES(ret[0], index=index) + * else: + */ + } + + /* "talib/_abstract.pxi":328 + * return __PANDAS_SERIES(ret[0], index=index) + * else: + * return __PANDAS_DATAFRAME(numpy.column_stack(ret), # <<<<<<<<<<<<<< + * index=index, + * columns=self.output_names) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_column_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_4) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } else { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_v_ret); + __Pyx_GIVEREF(__pyx_v_ret); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_ret); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":329 + * else: + * return __PANDAS_DATAFRAME(numpy.column_stack(ret), + * index=index, # <<<<<<<<<<<<<< + * columns=self.output_names) + * else: + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + + /* "talib/_abstract.pxi":330 + * return __PANDAS_DATAFRAME(numpy.column_stack(ret), + * index=index, + * columns=self.output_names) # <<<<<<<<<<<<<< + * else: + * return ret[0] if len(ret) == 1 else ret + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_names); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_columns, __pyx_t_9) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "talib/_abstract.pxi":328 + * return __PANDAS_SERIES(ret[0], index=index) + * else: + * return __PANDAS_DATAFRAME(numpy.column_stack(ret), # <<<<<<<<<<<<<< + * index=index, + * columns=self.output_names) + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "talib/_abstract.pxi":322 + * if not isinstance(ret, list): + * ret = list(ret) + * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< + * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): + * index = self.__input_arrays.index + */ + } + + /* "talib/_abstract.pxi":332 + * columns=self.output_names) + * else: + * return ret[0] if len(ret) == 1 else ret # <<<<<<<<<<<<<< + * + * def run(self, input_arrays=None): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 332, __pyx_L1_error) + if (((__pyx_t_7 == 1) != 0)) { + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_v_ret); + __pyx_t_9 = __pyx_v_ret; + } + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "talib/_abstract.pxi":311 + * + * @property + * def outputs(self): # <<<<<<<<<<<<<< + * """ + * Returns the TA function values for the currently set input_arrays and + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("talib._ta_lib.Function.outputs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":334 + * return ret[0] if len(ret) == 1 else ret + * + * def run(self, input_arrays=None): # <<<<<<<<<<<<<< + * """ + * run([input_arrays=None]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_31run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_30run[] = "\n run([input_arrays=None])\n\n This is a shortcut to the outputs property that also allows setting\n the input_arrays dict.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_31run = {"run", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_31run, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_30run}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_31run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_input_arrays = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_arrays,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_arrays); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(1, 334, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_input_arrays = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 334, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.Function.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_30run(__pyx_self, __pyx_v_self, __pyx_v_input_arrays); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_30run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("run", 0); + + /* "talib/_abstract.pxi":341 + * the input_arrays dict. + * """ + * if input_arrays: # <<<<<<<<<<<<<< + * self.set_input_arrays(input_arrays) + * self.__call_function() + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_input_arrays); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 341, __pyx_L1_error) + if (__pyx_t_1) { + + /* "talib/_abstract.pxi":342 + * """ + * if input_arrays: + * self.set_input_arrays(input_arrays) # <<<<<<<<<<<<<< + * self.__call_function() + * return self.outputs + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_input_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_input_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_v_input_arrays); + __Pyx_GIVEREF(__pyx_v_input_arrays); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_input_arrays); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":341 + * the input_arrays dict. + * """ + * if input_arrays: # <<<<<<<<<<<<<< + * self.set_input_arrays(input_arrays) + * self.__call_function() + */ + } + + /* "talib/_abstract.pxi":343 + * if input_arrays: + * self.set_input_arrays(input_arrays) + * self.__call_function() # <<<<<<<<<<<<<< + * return self.outputs + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 343, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":344 + * self.set_input_arrays(input_arrays) + * self.__call_function() + * return self.outputs # <<<<<<<<<<<<<< + * + * def __call__(self, *args, **kwargs): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":334 + * return ret[0] if len(ret) == 1 else ret + * + * def run(self, input_arrays=None): # <<<<<<<<<<<<<< + * """ + * run([input_arrays=None]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.Function.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":346 + * return self.outputs + * + * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_33__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_32__call__[] = "\n func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs])\n\n This is a shortcut to the outputs property that also allows setting\n the input_arrays dict and function parameters.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_33__call__ = {"__call__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_33__call__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_32__call__}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_33__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("talib._ta_lib.Function.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_32__call__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_32__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "talib/_abstract.pxi":353 + * the input_arrays dict and function parameters. + * """ + * self.set_function_args(*args, **kwargs) # <<<<<<<<<<<<<< + * self.__call_function() + * return self.outputs + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_function_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":354 + * """ + * self.set_function_args(*args, **kwargs) + * self.__call_function() # <<<<<<<<<<<<<< + * return self.outputs + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (__pyx_t_3) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":355 + * self.set_function_args(*args, **kwargs) + * self.__call_function() + * return self.outputs # <<<<<<<<<<<<<< + * + * # figure out which price series names we're using for inputs + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":346 + * return self.outputs + * + * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":358 + * + * # figure out which price series names we're using for inputs + * def __input_price_series_names(self): # <<<<<<<<<<<<<< + * input_price_series_names = [] + * for input_name in self.__input_names: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_35__input_price_series_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_35__input_price_series_names = {"__input_price_series_names", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_35__input_price_series_names, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_35__input_price_series_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__input_price_series_names (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_34__input_price_series_names(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_34__input_price_series_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_input_price_series_names = NULL; + PyObject *__pyx_v_input_name = NULL; + PyObject *__pyx_v_price_series = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + __Pyx_RefNannySetupContext("__input_price_series_names", 0); + + /* "talib/_abstract.pxi":359 + * # figure out which price series names we're using for inputs + * def __input_price_series_names(self): + * input_price_series_names = [] # <<<<<<<<<<<<<< + * for input_name in self.__input_names: + * price_series = self.__input_names[input_name]['price_series'] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_input_price_series_names = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":360 + * def __input_price_series_names(self): + * input_price_series_names = [] + * for input_name in self.__input_names: # <<<<<<<<<<<<<< + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 360, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 360, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 360, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 360, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":361 + * input_price_series_names = [] + * for input_name in self.__input_names: + * price_series = self.__input_names[input_name]['price_series'] # <<<<<<<<<<<<<< + * if isinstance(price_series, list): # TALIB-supplied input names + * for name in price_series: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_price_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":362 + * for input_name in self.__input_names: + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names # <<<<<<<<<<<<<< + * for name in price_series: + * input_price_series_names.append(name) + */ + __pyx_t_6 = PyList_Check(__pyx_v_price_series); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":363 + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names + * for name in price_series: # <<<<<<<<<<<<<< + * input_price_series_names.append(name) + * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS + */ + if (likely(PyList_CheckExact(__pyx_v_price_series)) || PyTuple_CheckExact(__pyx_v_price_series)) { + __pyx_t_1 = __pyx_v_price_series; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_price_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 363, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 363, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 363, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_9(__pyx_t_1); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 363, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":364 + * if isinstance(price_series, list): # TALIB-supplied input names + * for name in price_series: + * input_price_series_names.append(name) # <<<<<<<<<<<<<< + * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS + * input_price_series_names.append(price_series) + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_input_price_series_names, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 364, __pyx_L1_error) + + /* "talib/_abstract.pxi":363 + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names + * for name in price_series: # <<<<<<<<<<<<<< + * input_price_series_names.append(name) + * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":362 + * for input_name in self.__input_names: + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names # <<<<<<<<<<<<<< + * for name in price_series: + * input_price_series_names.append(name) + */ + goto __pyx_L5; + } + + /* "talib/_abstract.pxi":366 + * input_price_series_names.append(name) + * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS + * input_price_series_names.append(price_series) # <<<<<<<<<<<<<< + * return input_price_series_names + * + */ + /*else*/ { + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_input_price_series_names, __pyx_v_price_series); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 366, __pyx_L1_error) + } + __pyx_L5:; + + /* "talib/_abstract.pxi":360 + * def __input_price_series_names(self): + * input_price_series_names = [] + * for input_name in self.__input_names: # <<<<<<<<<<<<<< + * price_series = self.__input_names[input_name]['price_series'] + * if isinstance(price_series, list): # TALIB-supplied input names + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":367 + * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS + * input_price_series_names.append(price_series) + * return input_price_series_names # <<<<<<<<<<<<<< + * + * def __call_function(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input_price_series_names); + __pyx_r = __pyx_v_input_price_series_names; + goto __pyx_L0; + + /* "talib/_abstract.pxi":358 + * + * # figure out which price series names we're using for inputs + * def __input_price_series_names(self): # <<<<<<<<<<<<<< + * input_price_series_names = [] + * for input_name in self.__input_names: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.Function.__input_price_series_names", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_input_price_series_names); + __Pyx_XDECREF(__pyx_v_input_name); + __Pyx_XDECREF(__pyx_v_price_series); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":369 + * return input_price_series_names + * + * def __call_function(self): # <<<<<<<<<<<<<< + * input_price_series_names = self.__input_price_series_names() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_37__call_function(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_37__call_function = {"__call_function", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_37__call_function, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_37__call_function(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call_function (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_36__call_function(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_36__call_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_input_price_series_names = NULL; + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_v_price_series = NULL; + PyObject *__pyx_v_series = NULL; + PyObject *__pyx_v_opt_input = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_results = NULL; + PyObject *__pyx_v_keys = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("__call_function", 0); + + /* "talib/_abstract.pxi":370 + * + * def __call_function(self): + * input_price_series_names = self.__input_price_series_names() # <<<<<<<<<<<<<< + * + * # populate the ordered args we'll call the function with + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_price_series_na); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_input_price_series_names = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":373 + * + * # populate the ordered args we'll call the function with + * args = [] # <<<<<<<<<<<<<< + * for price_series in input_price_series_names: + * series = self.__input_arrays[price_series] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":374 + * # populate the ordered args we'll call the function with + * args = [] + * for price_series in input_price_series_names: # <<<<<<<<<<<<<< + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ + */ + if (likely(PyList_CheckExact(__pyx_v_input_price_series_names)) || PyTuple_CheckExact(__pyx_v_input_price_series_names)) { + __pyx_t_1 = __pyx_v_input_price_series_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_input_price_series_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 374, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 374, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 374, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 374, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":375 + * args = [] + * for price_series in input_price_series_names: + * series = self.__input_arrays[price_series] # <<<<<<<<<<<<<< + * if __PANDAS_SERIES is not None and \ + * isinstance(series, __PANDAS_SERIES): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_price_series); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_series, __pyx_t_3); + __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":376 + * for price_series in input_price_series_names: + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< + * isinstance(series, __PANDAS_SERIES): + * series = series.values + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + } else { + __pyx_t_6 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + + /* "talib/_abstract.pxi":377 + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ + * isinstance(series, __PANDAS_SERIES): # <<<<<<<<<<<<<< + * series = series.values + * args.append(series) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyObject_IsInstance(__pyx_v_series, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 377, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (__pyx_t_8 != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + + /* "talib/_abstract.pxi":376 + * for price_series in input_price_series_names: + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< + * isinstance(series, __PANDAS_SERIES): + * series = series.values + */ + if (__pyx_t_6) { + + /* "talib/_abstract.pxi":378 + * if __PANDAS_SERIES is not None and \ + * isinstance(series, __PANDAS_SERIES): + * series = series.values # <<<<<<<<<<<<<< + * args.append(series) + * for opt_input in self.__opt_inputs: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_series, __pyx_t_3); + __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":376 + * for price_series in input_price_series_names: + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< + * isinstance(series, __PANDAS_SERIES): + * series = series.values + */ + } + + /* "talib/_abstract.pxi":379 + * isinstance(series, __PANDAS_SERIES): + * series = series.values + * args.append(series) # <<<<<<<<<<<<<< + * for opt_input in self.__opt_inputs: + * value = self.__get_opt_input_value(opt_input) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_series); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 379, __pyx_L1_error) + + /* "talib/_abstract.pxi":374 + * # populate the ordered args we'll call the function with + * args = [] + * for price_series in input_price_series_names: # <<<<<<<<<<<<<< + * series = self.__input_arrays[price_series] + * if __PANDAS_SERIES is not None and \ + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":380 + * series = series.values + * args.append(series) + * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< + * value = self.__get_opt_input_value(opt_input) + * args.append(value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 380, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 380, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 380, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":381 + * args.append(series) + * for opt_input in self.__opt_inputs: + * value = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< + * args.append(value) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_10) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_opt_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_v_opt_input); + __Pyx_GIVEREF(__pyx_v_opt_input); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_opt_input); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":382 + * for opt_input in self.__opt_inputs: + * value = self.__get_opt_input_value(opt_input) + * args.append(value) # <<<<<<<<<<<<<< + * + * # Use the func module to actually call the function. + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_value); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 382, __pyx_L1_error) + + /* "talib/_abstract.pxi":380 + * series = series.values + * args.append(series) + * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< + * value = self.__get_opt_input_value(opt_input) + * args.append(value) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":385 + * + * # Use the func module to actually call the function. + * results = self.func_object(*args) # <<<<<<<<<<<<<< + * if isinstance(results, np.ndarray): + * keys = self.__outputs.keys() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_func_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_results = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":386 + * # Use the func module to actually call the function. + * results = self.func_object(*args) + * if isinstance(results, np.ndarray): # <<<<<<<<<<<<<< + * keys = self.__outputs.keys() + * if not isinstance(keys, list): + */ + __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_results, __pyx_ptype_5numpy_ndarray); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":387 + * results = self.func_object(*args) + * if isinstance(results, np.ndarray): + * keys = self.__outputs.keys() # <<<<<<<<<<<<<< + * if not isinstance(keys, list): + * keys = list(keys) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_keys = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":388 + * if isinstance(results, np.ndarray): + * keys = self.__outputs.keys() + * if not isinstance(keys, list): # <<<<<<<<<<<<<< + * keys = list(keys) + * self.__outputs[keys[0]] = results + */ + __pyx_t_7 = PyList_Check(__pyx_v_keys); + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + + /* "talib/_abstract.pxi":389 + * keys = self.__outputs.keys() + * if not isinstance(keys, list): + * keys = list(keys) # <<<<<<<<<<<<<< + * self.__outputs[keys[0]] = results + * else: + */ + __pyx_t_2 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":388 + * if isinstance(results, np.ndarray): + * keys = self.__outputs.keys() + * if not isinstance(keys, list): # <<<<<<<<<<<<<< + * keys = list(keys) + * self.__outputs[keys[0]] = results + */ + } + + /* "talib/_abstract.pxi":390 + * if not isinstance(keys, list): + * keys = list(keys) + * self.__outputs[keys[0]] = results # <<<<<<<<<<<<<< + * else: + * for i, output in enumerate(self.__outputs): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 390, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_keys, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 390, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_v_results) < 0)) __PYX_ERR(1, 390, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":386 + * # Use the func module to actually call the function. + * results = self.func_object(*args) + * if isinstance(results, np.ndarray): # <<<<<<<<<<<<<< + * keys = self.__outputs.keys() + * if not isinstance(keys, list): + */ + goto __pyx_L10; + } + + /* "talib/_abstract.pxi":392 + * self.__outputs[keys[0]] = results + * else: + * for i, output in enumerate(self.__outputs): # <<<<<<<<<<<<<< + * self.__outputs[output] = results[i] + * self.__outputs_valid = True + */ + /*else*/ { + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 392, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":393 + * else: + * for i, output in enumerate(self.__outputs): + * self.__outputs[output] = results[i] # <<<<<<<<<<<<<< + * self.__outputs_valid = True + * + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_results, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_v_output, __pyx_t_2) < 0)) __PYX_ERR(1, 393, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":392 + * self.__outputs[keys[0]] = results + * else: + * for i, output in enumerate(self.__outputs): # <<<<<<<<<<<<<< + * self.__outputs[output] = results[i] + * self.__outputs_valid = True + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L10:; + + /* "talib/_abstract.pxi":394 + * for i, output in enumerate(self.__outputs): + * self.__outputs[output] = results[i] + * self.__outputs_valid = True # <<<<<<<<<<<<<< + * + * def __get_opt_input_value(self, input_name): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_True) < 0) __PYX_ERR(1, 394, __pyx_L1_error) + + /* "talib/_abstract.pxi":369 + * return input_price_series_names + * + * def __call_function(self): # <<<<<<<<<<<<<< + * input_price_series_names = self.__input_price_series_names() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("talib._ta_lib.Function.__call_function", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_input_price_series_names); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_price_series); + __Pyx_XDECREF(__pyx_v_series); + __Pyx_XDECREF(__pyx_v_opt_input); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_results); + __Pyx_XDECREF(__pyx_v_keys); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":396 + * self.__outputs_valid = True + * + * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< + * """ + * Returns the user-set value if there is one, otherwise the default. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_39__get_opt_input_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_8Function_38__get_opt_input_value[] = "\n Returns the user-set value if there is one, otherwise the default.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_39__get_opt_input_value = {"__get_opt_input_value", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_39__get_opt_input_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_8Function_38__get_opt_input_value}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_39__get_opt_input_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_input_name = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get_opt_input_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__get_opt_input_value", 1, 2, 2, 1); __PYX_ERR(1, 396, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get_opt_input_value") < 0)) __PYX_ERR(1, 396, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_input_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__get_opt_input_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 396, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.Function.__get_opt_input_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_38__get_opt_input_value(__pyx_self, __pyx_v_self, __pyx_v_input_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_38__get_opt_input_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_name) { + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__get_opt_input_value", 0); + + /* "talib/_abstract.pxi":400 + * Returns the user-set value if there is one, otherwise the default. + * """ + * value = self.__opt_inputs[input_name]['value'] # <<<<<<<<<<<<<< + * if value is None: + * value = self.__opt_inputs[input_name]['default_value'] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":401 + * """ + * value = self.__opt_inputs[input_name]['value'] + * if value is None: # <<<<<<<<<<<<<< + * value = self.__opt_inputs[input_name]['default_value'] + * return value + */ + __pyx_t_3 = (__pyx_v_value == Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "talib/_abstract.pxi":402 + * value = self.__opt_inputs[input_name]['value'] + * if value is None: + * value = self.__opt_inputs[input_name]['default_value'] # <<<<<<<<<<<<<< + * return value + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_default_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":401 + * """ + * value = self.__opt_inputs[input_name]['value'] + * if value is None: # <<<<<<<<<<<<<< + * value = self.__opt_inputs[input_name]['default_value'] + * return value + */ + } + + /* "talib/_abstract.pxi":403 + * if value is None: + * value = self.__opt_inputs[input_name]['default_value'] + * return value # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "talib/_abstract.pxi":396 + * self.__outputs_valid = True + * + * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< + * """ + * Returns the user-set value if there is one, otherwise the default. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.Function.__get_opt_input_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":405 + * return value + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '%s' % self.info + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_41__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_41__repr__ = {"__repr__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_41__repr__, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_41__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_40__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_40__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "talib/_abstract.pxi":406 + * + * def __repr__(self): + * return '%s' % self.info # <<<<<<<<<<<<<< + * + * def __unicode__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":405 + * return value + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '%s' % self.info + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.Function.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":408 + * return '%s' % self.info + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * return unicode(self.__str__()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_43__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_43__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_43__unicode__, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_43__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_42__unicode__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_42__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__unicode__", 0); + + /* "talib/_abstract.pxi":409 + * + * def __unicode__(self): + * return unicode(self.__str__()) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":408 + * return '%s' % self.info + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * return unicode(self.__str__()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("talib._ta_lib.Function.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":411 + * return unicode(self.__str__()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_45__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_8Function_45__str__ = {"__str__", (PyCFunction)__pyx_pw_5talib_7_ta_lib_8Function_45__str__, METH_O, 0}; +static PyObject *__pyx_pw_5talib_7_ta_lib_8Function_45__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_8Function_44__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_8Function_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "talib/_abstract.pxi":412 + * + * def __str__(self): + * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_defaults_and_docs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":411 + * return unicode(self.__str__()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.Function.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":425 + * # therefore recommended over using these functions directly. + * + * def _ta_getGroupTable(): # <<<<<<<<<<<<<< + * """ + * Returns the list of available TALIB function group names. *slow* + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_335_ta_getGroupTable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_334_ta_getGroupTable[] = "\n Returns the list of available TALIB function group names. *slow*\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_335_ta_getGroupTable = {"_ta_getGroupTable", (PyCFunction)__pyx_pw_5talib_7_ta_lib_335_ta_getGroupTable, METH_NOARGS, __pyx_doc_5talib_7_ta_lib_334_ta_getGroupTable}; +static PyObject *__pyx_pw_5talib_7_ta_lib_335_ta_getGroupTable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getGroupTable (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_334_ta_getGroupTable(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_334_ta_getGroupTable(CYTHON_UNUSED PyObject *__pyx_self) { + TA_StringTable *__pyx_v_table; + PyObject *__pyx_v_groups = NULL; + unsigned int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + unsigned int __pyx_t_2; + unsigned int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("_ta_getGroupTable", 0); + + /* "talib/_abstract.pxi":430 + * """ + * cdef lib.TA_StringTable *table + * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) # <<<<<<<<<<<<<< + * groups = [] + * for i in xrange(table.size): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GroupTableAlloc, TA_GroupTableAlloc((&__pyx_v_table)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":431 + * cdef lib.TA_StringTable *table + * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) + * groups = [] # <<<<<<<<<<<<<< + * for i in xrange(table.size): + * groups.append(deref(&table.string[i])) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_groups = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":432 + * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) + * groups = [] + * for i in xrange(table.size): # <<<<<<<<<<<<<< + * groups.append(deref(&table.string[i])) + * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) + */ + __pyx_t_2 = __pyx_v_table->size; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "talib/_abstract.pxi":433 + * groups = [] + * for i in xrange(table.size): + * groups.append(deref(&table.string[i])) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) + * return groups + */ + __pyx_t_1 = __Pyx_PyBytes_FromString((*(&(__pyx_v_table->string[__pyx_v_i])))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_groups, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "talib/_abstract.pxi":434 + * for i in xrange(table.size): + * groups.append(deref(&table.string[i])) + * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) # <<<<<<<<<<<<<< + * return groups + * + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GroupTableFree, TA_GroupTableFree(__pyx_v_table), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":435 + * groups.append(deref(&table.string[i])) + * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) + * return groups # <<<<<<<<<<<<<< + * + * def _ta_getFuncTable(char *group): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_groups); + __pyx_r = __pyx_v_groups; + goto __pyx_L0; + + /* "talib/_abstract.pxi":425 + * # therefore recommended over using these functions directly. + * + * def _ta_getGroupTable(): # <<<<<<<<<<<<<< + * """ + * Returns the list of available TALIB function group names. *slow* + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("talib._ta_lib._ta_getGroupTable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_groups); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":437 + * return groups + * + * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< + * """ + * Returns a list of the functions for the specified group name. *slow* + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_337_ta_getFuncTable(PyObject *__pyx_self, PyObject *__pyx_arg_group); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_336_ta_getFuncTable[] = "\n Returns a list of the functions for the specified group name. *slow*\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_337_ta_getFuncTable = {"_ta_getFuncTable", (PyCFunction)__pyx_pw_5talib_7_ta_lib_337_ta_getFuncTable, METH_O, __pyx_doc_5talib_7_ta_lib_336_ta_getFuncTable}; +static PyObject *__pyx_pw_5talib_7_ta_lib_337_ta_getFuncTable(PyObject *__pyx_self, PyObject *__pyx_arg_group) { + char *__pyx_v_group; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getFuncTable (wrapper)", 0); + assert(__pyx_arg_group); { + __pyx_v_group = __Pyx_PyObject_AsString(__pyx_arg_group); if (unlikely((!__pyx_v_group) && PyErr_Occurred())) __PYX_ERR(1, 437, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_getFuncTable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_336_ta_getFuncTable(__pyx_self, ((char *)__pyx_v_group)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_336_ta_getFuncTable(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_group) { + TA_StringTable *__pyx_v_table; + PyObject *__pyx_v_functions = NULL; + unsigned int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + unsigned int __pyx_t_2; + unsigned int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("_ta_getFuncTable", 0); + + /* "talib/_abstract.pxi":442 + * """ + * cdef lib.TA_StringTable *table + * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) # <<<<<<<<<<<<<< + * functions = [] + * for i in xrange(table.size): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_FuncTableAlloc, TA_FuncTableAlloc(__pyx_v_group, (&__pyx_v_table)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":443 + * cdef lib.TA_StringTable *table + * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) + * functions = [] # <<<<<<<<<<<<<< + * for i in xrange(table.size): + * functions.append(deref(&table.string[i])) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_functions = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":444 + * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) + * functions = [] + * for i in xrange(table.size): # <<<<<<<<<<<<<< + * functions.append(deref(&table.string[i])) + * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) + */ + __pyx_t_2 = __pyx_v_table->size; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "talib/_abstract.pxi":445 + * functions = [] + * for i in xrange(table.size): + * functions.append(deref(&table.string[i])) # <<<<<<<<<<<<<< + * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) + * return functions + */ + __pyx_t_1 = __Pyx_PyBytes_FromString((*(&(__pyx_v_table->string[__pyx_v_i])))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_functions, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "talib/_abstract.pxi":446 + * for i in xrange(table.size): + * functions.append(deref(&table.string[i])) + * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) # <<<<<<<<<<<<<< + * return functions + * + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_FuncTableFree, TA_FuncTableFree(__pyx_v_table), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":447 + * functions.append(deref(&table.string[i])) + * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) + * return functions # <<<<<<<<<<<<<< + * + * def __get_flags(int flag, dict flags_lookup_dict): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_functions); + __pyx_r = __pyx_v_functions; + goto __pyx_L0; + + /* "talib/_abstract.pxi":437 + * return groups + * + * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< + * """ + * Returns a list of the functions for the specified group name. *slow* + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("talib._ta_lib._ta_getFuncTable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_functions); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":449 + * return functions + * + * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< + * """ + * TA-LIB provides hints for multiple flags as a bitwise-ORed int. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_339__get_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_338__get_flags[] = "\n TA-LIB provides hints for multiple flags as a bitwise-ORed int.\n This function returns the flags from flag found in the provided\n flags_lookup_dict.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_339__get_flags = {"__get_flags", (PyCFunction)__pyx_pw_5talib_7_ta_lib_339__get_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_338__get_flags}; +static PyObject *__pyx_pw_5talib_7_ta_lib_339__get_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_flag; + PyObject *__pyx_v_flags_lookup_dict = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get_flags (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_flags_lookup_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags_lookup_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__get_flags", 1, 2, 2, 1); __PYX_ERR(1, 449, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get_flags") < 0)) __PYX_ERR(1, 449, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_flag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L3_error) + __pyx_v_flags_lookup_dict = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__get_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 449, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.__get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flags_lookup_dict), (&PyDict_Type), 1, "flags_lookup_dict", 1))) __PYX_ERR(1, 449, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_338__get_flags(__pyx_self, __pyx_v_flag, __pyx_v_flags_lookup_dict); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_338__get_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flag, PyObject *__pyx_v_flags_lookup_dict) { + PyObject *__pyx_v_value_range = NULL; + PyObject *__pyx_v_min_int = NULL; + PyObject *__pyx_v_max_int = NULL; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + __Pyx_RefNannySetupContext("__get_flags", 0); + + /* "talib/_abstract.pxi":455 + * flags_lookup_dict. + * """ + * value_range = flags_lookup_dict.keys() # <<<<<<<<<<<<<< + * if not isinstance(value_range, list): + * value_range = list(value_range) + */ + if (unlikely(__pyx_v_flags_lookup_dict == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys"); + __PYX_ERR(1, 455, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_flags_lookup_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_value_range = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":456 + * """ + * value_range = flags_lookup_dict.keys() + * if not isinstance(value_range, list): # <<<<<<<<<<<<<< + * value_range = list(value_range) + * min_int = int(math.log(min(value_range), 2)) + */ + __pyx_t_2 = PyList_Check(__pyx_v_value_range); + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_3) { + + /* "talib/_abstract.pxi":457 + * value_range = flags_lookup_dict.keys() + * if not isinstance(value_range, list): + * value_range = list(value_range) # <<<<<<<<<<<<<< + * min_int = int(math.log(min(value_range), 2)) + * max_int = int(math.log(max(value_range), 2)) + */ + __pyx_t_1 = PySequence_List(__pyx_v_value_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_value_range, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":456 + * """ + * value_range = flags_lookup_dict.keys() + * if not isinstance(value_range, list): # <<<<<<<<<<<<<< + * value_range = list(value_range) + * min_int = int(math.log(min(value_range), 2)) + */ + } + + /* "talib/_abstract.pxi":458 + * if not isinstance(value_range, list): + * value_range = list(value_range) + * min_int = int(math.log(min(value_range), 2)) # <<<<<<<<<<<<<< + * max_int = int(math.log(max(value_range), 2)) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_value_range); + __Pyx_GIVEREF(__pyx_v_value_range); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value_range); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_6); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_2); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_min_int = __pyx_t_5; + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":459 + * value_range = list(value_range) + * min_int = int(math.log(min(value_range), 2)) + * max_int = int(math.log(max(value_range), 2)) # <<<<<<<<<<<<<< + * + * # if the flag we got is out-of-range, it just means no extra info provided + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_log); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_value_range); + __Pyx_GIVEREF(__pyx_v_value_range); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value_range); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_7 = 1; + } + } + __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_1) { + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_6); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_int_2); + __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_max_int = __pyx_t_8; + __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":462 + * + * # if the flag we got is out-of-range, it just means no extra info provided + * if flag < 1 or flag > 2**max_int: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_2 = ((__pyx_v_flag < 1) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_max_int, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (__pyx_t_3) { + + /* "talib/_abstract.pxi":463 + * # if the flag we got is out-of-range, it just means no extra info provided + * if flag < 1 or flag > 2**max_int: + * return None # <<<<<<<<<<<<<< + * + * # In this loop, i is essentially the bit-position, which represents an + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "talib/_abstract.pxi":462 + * + * # if the flag we got is out-of-range, it just means no extra info provided + * if flag < 1 or flag > 2**max_int: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "talib/_abstract.pxi":468 + * # input from flags_lookup_dict. We loop through as many flags_lookup_dict + * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. + * ret = [] # <<<<<<<<<<<<<< + * for i in xrange(min_int, max_int+1): + * if 2**i & flag: + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ret = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":469 + * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. + * ret = [] + * for i in xrange(min_int, max_int+1): # <<<<<<<<<<<<<< + * if 2**i & flag: + * ret.append(flags_lookup_dict[2**i]) + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_max_int, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_min_int); + __Pyx_GIVEREF(__pyx_v_min_int); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_min_int); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 469, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 469, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 469, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 469, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); + __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":470 + * ret = [] + * for i in xrange(min_int, max_int+1): + * if 2**i & flag: # <<<<<<<<<<<<<< + * ret.append(flags_lookup_dict[2**i]) + * return ret + */ + __pyx_t_4 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyNumber_And(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 470, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + + /* "talib/_abstract.pxi":471 + * for i in xrange(min_int, max_int+1): + * if 2**i & flag: + * ret.append(flags_lookup_dict[2**i]) # <<<<<<<<<<<<<< + * return ret + * + */ + if (unlikely(__pyx_v_flags_lookup_dict == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 471, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_flags_lookup_dict, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 471, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":470 + * ret = [] + * for i in xrange(min_int, max_int+1): + * if 2**i & flag: # <<<<<<<<<<<<<< + * ret.append(flags_lookup_dict[2**i]) + * return ret + */ + } + + /* "talib/_abstract.pxi":469 + * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. + * ret = [] + * for i in xrange(min_int, max_int+1): # <<<<<<<<<<<<<< + * if 2**i & flag: + * ret.append(flags_lookup_dict[2**i]) + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":472 + * if 2**i & flag: + * ret.append(flags_lookup_dict[2**i]) + * return ret # <<<<<<<<<<<<<< + * + * TA_FUNC_FLAGS = { + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "talib/_abstract.pxi":449 + * return functions + * + * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< + * """ + * TA-LIB provides hints for multiple flags as a bitwise-ORed int. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("talib._ta_lib.__get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value_range); + __Pyx_XDECREF(__pyx_v_min_int); + __Pyx_XDECREF(__pyx_v_max_int); + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":508 + * } + * + * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns the info dict for the function. It has the following keys: name, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_341_ta_getFuncInfo(PyObject *__pyx_self, PyObject *__pyx_arg_function_name); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_340_ta_getFuncInfo[] = "\n Returns the info dict for the function. It has the following keys: name,\n group, help, flags, num_inputs, num_opt_inputs and num_outputs.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_341_ta_getFuncInfo = {"_ta_getFuncInfo", (PyCFunction)__pyx_pw_5talib_7_ta_lib_341_ta_getFuncInfo, METH_O, __pyx_doc_5talib_7_ta_lib_340_ta_getFuncInfo}; +static PyObject *__pyx_pw_5talib_7_ta_lib_341_ta_getFuncInfo(PyObject *__pyx_self, PyObject *__pyx_arg_function_name) { + char *__pyx_v_function_name; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getFuncInfo (wrapper)", 0); + assert(__pyx_arg_function_name); { + __pyx_v_function_name = __Pyx_PyObject_AsString(__pyx_arg_function_name); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) __PYX_ERR(1, 508, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_getFuncInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_340_ta_getFuncInfo(__pyx_self, ((char *)__pyx_v_function_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_340_ta_getFuncInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name) { + TA_FuncInfo *__pyx_v_info; + TA_RetCode __pyx_v_retCode; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("_ta_getFuncInfo", 0); + + /* "talib/_abstract.pxi":514 + * """ + * cdef lib.TA_FuncInfo *info + * retCode = lib.TA_GetFuncInfo(__ta_getFuncHandle(function_name), &info) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GetFuncInfo', retCode) + * + */ + __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info)); + + /* "talib/_abstract.pxi":515 + * cdef lib.TA_FuncInfo *info + * retCode = lib.TA_GetFuncInfo(__ta_getFuncHandle(function_name), &info) + * _ta_check_success('TA_GetFuncInfo', retCode) # <<<<<<<<<<<<<< + * + * return { + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncInfo, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":517 + * _ta_check_success('TA_GetFuncInfo', retCode) + * + * return { # <<<<<<<<<<<<<< + * 'name': bytes2str(info.name), + * 'group': bytes2str(info.group), + */ + __Pyx_XDECREF(__pyx_r); + + /* "talib/_abstract.pxi":518 + * + * return { + * 'name': bytes2str(info.name), # <<<<<<<<<<<<<< + * 'group': bytes2str(info.group), + * 'display_name': bytes2str(info.hint), + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_info->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":519 + * return { + * 'name': bytes2str(info.name), + * 'group': bytes2str(info.group), # <<<<<<<<<<<<<< + * 'display_name': bytes2str(info.hint), + * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_info->group); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_group, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":520 + * 'name': bytes2str(info.name), + * 'group': bytes2str(info.group), + * 'display_name': bytes2str(info.hint), # <<<<<<<<<<<<<< + * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), + * 'num_inputs': int(info.nbInput), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_info->hint); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_6) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_display_name, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":521 + * 'group': bytes2str(info.group), + * 'display_name': bytes2str(info.hint), + * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), # <<<<<<<<<<<<<< + * 'num_inputs': int(info.nbInput), + * 'num_opt_inputs': int(info.nbOptInput), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_TA_FuncFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_FUNC_FLAGS); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_function_flags, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":522 + * 'display_name': bytes2str(info.hint), + * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), + * 'num_inputs': int(info.nbInput), # <<<<<<<<<<<<<< + * 'num_opt_inputs': int(info.nbOptInput), + * 'num_outputs': int(info.nbOutput) + */ + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbInput); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_inputs, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":523 + * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), + * 'num_inputs': int(info.nbInput), + * 'num_opt_inputs': int(info.nbOptInput), # <<<<<<<<<<<<<< + * 'num_outputs': int(info.nbOutput) + * } + */ + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbOptInput); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_opt_inputs, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":524 + * 'num_inputs': int(info.nbInput), + * 'num_opt_inputs': int(info.nbOptInput), + * 'num_outputs': int(info.nbOutput) # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbOutput); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_outputs, __pyx_t_2) < 0) __PYX_ERR(1, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":508 + * } + * + * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns the info dict for the function. It has the following keys: name, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("talib._ta_lib._ta_getFuncInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":527 + * } + * + * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's input info dict for the given index. It has two + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_343_ta_getInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_342_ta_getInputParameterInfo[] = "\n Returns the function's input info dict for the given index. It has two\n keys: name and flags.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_343_ta_getInputParameterInfo = {"_ta_getInputParameterInfo", (PyCFunction)__pyx_pw_5talib_7_ta_lib_343_ta_getInputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_342_ta_getInputParameterInfo}; +static PyObject *__pyx_pw_5talib_7_ta_lib_343_ta_getInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + char *__pyx_v_function_name; + int __pyx_v_idx; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getInputParameterInfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_ta_getInputParameterInfo", 1, 2, 2, 1); __PYX_ERR(1, 527, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getInputParameterInfo") < 0)) __PYX_ERR(1, 527, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) __PYX_ERR(1, 527, __pyx_L3_error) + __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 527, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ta_getInputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 527, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_getInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_342_ta_getInputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_342_ta_getInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { + TA_InputParameterInfo *__pyx_v_info; + TA_RetCode __pyx_v_retCode; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("_ta_getInputParameterInfo", 0); + + /* "talib/_abstract.pxi":533 + * """ + * cdef lib.TA_InputParameterInfo *info + * retCode = lib.TA_GetInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GetInputParameterInfo', retCode) + * + */ + __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); + + /* "talib/_abstract.pxi":534 + * cdef lib.TA_InputParameterInfo *info + * retCode = lib.TA_GetInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) + * _ta_check_success('TA_GetInputParameterInfo', retCode) # <<<<<<<<<<<<<< + * + * name = bytes2str(info.paramName) + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetInputParameterInfo, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":536 + * _ta_check_success('TA_GetInputParameterInfo', retCode) + * + * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< + * name = name[len('in'):].lower() + * if 'real' in name: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":537 + * + * name = bytes2str(info.paramName) + * name = name[len('in'):].lower() # <<<<<<<<<<<<<< + * if 'real' in name: + * name = name.replace('real', 'price') + */ + __pyx_t_6 = PyObject_Length(__pyx_n_s_in); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 537, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 537, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":538 + * name = bytes2str(info.paramName) + * name = name[len('in'):].lower() + * if 'real' in name: # <<<<<<<<<<<<<< + * name = name.replace('real', 'price') + * elif 'price' in name: + */ + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_real, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 538, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "talib/_abstract.pxi":539 + * name = name[len('in'):].lower() + * if 'real' in name: + * name = name.replace('real', 'price') # <<<<<<<<<<<<<< + * elif 'price' in name: + * name = 'prices' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__1213, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":538 + * name = bytes2str(info.paramName) + * name = name[len('in'):].lower() + * if 'real' in name: # <<<<<<<<<<<<<< + * name = name.replace('real', 'price') + * elif 'price' in name: + */ + goto __pyx_L3; + } + + /* "talib/_abstract.pxi":540 + * if 'real' in name: + * name = name.replace('real', 'price') + * elif 'price' in name: # <<<<<<<<<<<<<< + * name = 'prices' + * + */ + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_price, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 540, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":541 + * name = name.replace('real', 'price') + * elif 'price' in name: + * name = 'prices' # <<<<<<<<<<<<<< + * + * return { + */ + __Pyx_INCREF(__pyx_n_s_prices); + __Pyx_DECREF_SET(__pyx_v_name, __pyx_n_s_prices); + + /* "talib/_abstract.pxi":540 + * if 'real' in name: + * name = name.replace('real', 'price') + * elif 'price' in name: # <<<<<<<<<<<<<< + * name = 'prices' + * + */ + } + __pyx_L3:; + + /* "talib/_abstract.pxi":543 + * name = 'prices' + * + * return { # <<<<<<<<<<<<<< + * 'name': name, + * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) + */ + __Pyx_XDECREF(__pyx_r); + + /* "talib/_abstract.pxi":544 + * + * return { + * 'name': name, # <<<<<<<<<<<<<< + * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) + * } + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(1, 544, __pyx_L1_error) + + /* "talib/_abstract.pxi":545 + * return { + * 'name': name, + * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_TA_InputFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_INPUT_FLAGS); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = NULL; + __pyx_t_6 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_price_series, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":527 + * } + * + * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's input info dict for the given index. It has two + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("talib._ta_lib._ta_getInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":548 + * } + * + * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's opt_input info dict for the given index. It has the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_345_ta_getOptInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_344_ta_getOptInputParameterInfo[] = "\n Returns the function's opt_input info dict for the given index. It has the\n following keys: name, display_name, type, help, default_value and value.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_345_ta_getOptInputParameterInfo = {"_ta_getOptInputParameterInfo", (PyCFunction)__pyx_pw_5talib_7_ta_lib_345_ta_getOptInputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_344_ta_getOptInputParameterInfo}; +static PyObject *__pyx_pw_5talib_7_ta_lib_345_ta_getOptInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + char *__pyx_v_function_name; + int __pyx_v_idx; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getOptInputParameterInfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_ta_getOptInputParameterInfo", 1, 2, 2, 1); __PYX_ERR(1, 548, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getOptInputParameterInfo") < 0)) __PYX_ERR(1, 548, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) __PYX_ERR(1, 548, __pyx_L3_error) + __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 548, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ta_getOptInputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 548, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_getOptInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_344_ta_getOptInputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_344_ta_getOptInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { + TA_OptInputParameterInfo *__pyx_v_info; + TA_RetCode __pyx_v_retCode; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_default_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("_ta_getOptInputParameterInfo", 0); + + /* "talib/_abstract.pxi":554 + * """ + * cdef lib.TA_OptInputParameterInfo *info + * retCode = lib.TA_GetOptInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GetOptInputParameterInfo', retCode) + * + */ + __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); + + /* "talib/_abstract.pxi":555 + * cdef lib.TA_OptInputParameterInfo *info + * retCode = lib.TA_GetOptInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) + * _ta_check_success('TA_GetOptInputParameterInfo', retCode) # <<<<<<<<<<<<<< + * + * name = bytes2str(info.paramName) + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetOptInputParameterInfo, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":557 + * _ta_check_success('TA_GetOptInputParameterInfo', retCode) + * + * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< + * name = name[len('optIn'):].lower() + * default_value = info.defaultValue + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":558 + * + * name = bytes2str(info.paramName) + * name = name[len('optIn'):].lower() # <<<<<<<<<<<<<< + * default_value = info.defaultValue + * if default_value % 1 == 0: + */ + __pyx_t_6 = PyObject_Length(__pyx_n_s_optIn); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 558, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 558, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":559 + * name = bytes2str(info.paramName) + * name = name[len('optIn'):].lower() + * default_value = info.defaultValue # <<<<<<<<<<<<<< + * if default_value % 1 == 0: + * default_value = int(default_value) + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_info->defaultValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_default_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":560 + * name = name[len('optIn'):].lower() + * default_value = info.defaultValue + * if default_value % 1 == 0: # <<<<<<<<<<<<<< + * default_value = int(default_value) + * + */ + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_default_value, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 560, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":561 + * default_value = info.defaultValue + * if default_value % 1 == 0: + * default_value = int(default_value) # <<<<<<<<<<<<<< + * + * return { + */ + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_default_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_default_value, __pyx_t_5); + __pyx_t_5 = 0; + + /* "talib/_abstract.pxi":560 + * name = name[len('optIn'):].lower() + * default_value = info.defaultValue + * if default_value % 1 == 0: # <<<<<<<<<<<<<< + * default_value = int(default_value) + * + */ + } + + /* "talib/_abstract.pxi":563 + * default_value = int(default_value) + * + * return { # <<<<<<<<<<<<<< + * 'name': name, + * 'display_name': bytes2str(info.displayName), + */ + __Pyx_XDECREF(__pyx_r); + + /* "talib/_abstract.pxi":564 + * + * return { + * 'name': name, # <<<<<<<<<<<<<< + * 'display_name': bytes2str(info.displayName), + * 'type': info.type, + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + + /* "talib/_abstract.pxi":565 + * return { + * 'name': name, + * 'display_name': bytes2str(info.displayName), # <<<<<<<<<<<<<< + * 'type': info.type, + * 'help': bytes2str(info.hint), + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->displayName); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_display_name, __pyx_t_1) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":566 + * 'name': name, + * 'display_name': bytes2str(info.displayName), + * 'type': info.type, # <<<<<<<<<<<<<< + * 'help': bytes2str(info.hint), + * 'default_value': default_value, + */ + __pyx_t_1 = __Pyx_PyInt_From_TA_OptInputParameterType(__pyx_v_info->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type_2, __pyx_t_1) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":567 + * 'display_name': bytes2str(info.displayName), + * 'type': info.type, + * 'help': bytes2str(info.hint), # <<<<<<<<<<<<<< + * 'default_value': default_value, + * 'value': None + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_info->hint); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_help, __pyx_t_1) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":568 + * 'type': info.type, + * 'help': bytes2str(info.hint), + * 'default_value': default_value, # <<<<<<<<<<<<<< + * 'value': None + * } + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_default_value, __pyx_v_default_value) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + + /* "talib/_abstract.pxi":569 + * 'help': bytes2str(info.hint), + * 'default_value': default_value, + * 'value': None # <<<<<<<<<<<<<< + * } + * + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, Py_None) < 0) __PYX_ERR(1, 564, __pyx_L1_error) + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":548 + * } + * + * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's opt_input info dict for the given index. It has the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("talib._ta_lib._ta_getOptInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_default_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":572 + * } + * + * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's output info dict for the given index. It has two + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_347_ta_getOutputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_346_ta_getOutputParameterInfo[] = "\n Returns the function's output info dict for the given index. It has two\n keys: name and flags.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_347_ta_getOutputParameterInfo = {"_ta_getOutputParameterInfo", (PyCFunction)__pyx_pw_5talib_7_ta_lib_347_ta_getOutputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_346_ta_getOutputParameterInfo}; +static PyObject *__pyx_pw_5talib_7_ta_lib_347_ta_getOutputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + char *__pyx_v_function_name; + int __pyx_v_idx; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ta_getOutputParameterInfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_ta_getOutputParameterInfo", 1, 2, 2, 1); __PYX_ERR(1, 572, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getOutputParameterInfo") < 0)) __PYX_ERR(1, 572, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) __PYX_ERR(1, 572, __pyx_L3_error) + __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 572, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ta_getOutputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 572, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib._ta_getOutputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5talib_7_ta_lib_346_ta_getOutputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_346_ta_getOutputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { + TA_OutputParameterInfo *__pyx_v_info; + TA_RetCode __pyx_v_retCode; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("_ta_getOutputParameterInfo", 0); + + /* "talib/_abstract.pxi":578 + * """ + * cdef lib.TA_OutputParameterInfo *info + * retCode = lib.TA_GetOutputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GetOutputParameterInfo', retCode) + * + */ + __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); + + /* "talib/_abstract.pxi":579 + * cdef lib.TA_OutputParameterInfo *info + * retCode = lib.TA_GetOutputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) + * _ta_check_success('TA_GetOutputParameterInfo', retCode) # <<<<<<<<<<<<<< + * + * name = bytes2str(info.paramName) + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetOutputParameterInfo, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":581 + * _ta_check_success('TA_GetOutputParameterInfo', retCode) + * + * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< + * name = name[len('out'):].lower() + * # chop off leading 'real' if a descriptive name follows + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 581, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":582 + * + * name = bytes2str(info.paramName) + * name = name[len('out'):].lower() # <<<<<<<<<<<<<< + * # chop off leading 'real' if a descriptive name follows + * if 'real' in name and name not in ['real', 'real0', 'real1']: + */ + __pyx_t_6 = PyObject_Length(__pyx_n_s_out); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":584 + * name = name[len('out'):].lower() + * # chop off leading 'real' if a descriptive name follows + * if 'real' in name and name not in ['real', 'real0', 'real1']: # <<<<<<<<<<<<<< + * name = name[len('real'):] + * + */ + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_real, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 584, __pyx_L1_error) + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __Pyx_INCREF(__pyx_v_name); + __pyx_t_1 = __pyx_v_name; + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 584, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_9 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real0, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 584, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_9 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 584, __pyx_L1_error) + __pyx_t_9 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_9 != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":585 + * # chop off leading 'real' if a descriptive name follows + * if 'real' in name and name not in ['real', 'real0', 'real1']: + * name = name[len('real'):] # <<<<<<<<<<<<<< + * + * return { + */ + __pyx_t_6 = PyObject_Length(__pyx_n_s_real); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":584 + * name = name[len('out'):].lower() + * # chop off leading 'real' if a descriptive name follows + * if 'real' in name and name not in ['real', 'real0', 'real1']: # <<<<<<<<<<<<<< + * name = name[len('real'):] + * + */ + } + + /* "talib/_abstract.pxi":587 + * name = name[len('real'):] + * + * return { # <<<<<<<<<<<<<< + * 'name': name, + * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) + */ + __Pyx_XDECREF(__pyx_r); + + /* "talib/_abstract.pxi":588 + * + * return { + * 'name': name, # <<<<<<<<<<<<<< + * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) + * } + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(1, 588, __pyx_L1_error) + + /* "talib/_abstract.pxi":589 + * return { + * 'name': name, + * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_TA_OutputFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_OUTPUT_FLAGS); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flags, __pyx_t_5) < 0) __PYX_ERR(1, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":572 + * } + * + * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's output info dict for the given index. It has two + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("talib._ta_lib._ta_getOutputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":592 + * } + * + * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< + * """ + * Returns a tuple with two outputs: defaults, a dict of parameter defaults, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_349_get_defaults_and_docs(PyObject *__pyx_self, PyObject *__pyx_v_func_info); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_348_get_defaults_and_docs[] = "\n Returns a tuple with two outputs: defaults, a dict of parameter defaults,\n and documentation, a formatted docstring for the function.\n .. Note: func_info should come from Function.info, *not* _ta_getFuncInfo.\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_349_get_defaults_and_docs = {"_get_defaults_and_docs", (PyCFunction)__pyx_pw_5talib_7_ta_lib_349_get_defaults_and_docs, METH_O, __pyx_doc_5talib_7_ta_lib_348_get_defaults_and_docs}; +static PyObject *__pyx_pw_5talib_7_ta_lib_349_get_defaults_and_docs(PyObject *__pyx_self, PyObject *__pyx_v_func_info) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_defaults_and_docs (wrapper)", 0); + __pyx_r = __pyx_pf_5talib_7_ta_lib_348_get_defaults_and_docs(__pyx_self, ((PyObject *)__pyx_v_func_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_348_get_defaults_and_docs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_info) { + PyObject *__pyx_v_defaults = NULL; + PyObject *__pyx_v_func_line = NULL; + PyObject *__pyx_v_func_args = NULL; + PyObject *__pyx_v_docs = NULL; + PyObject *__pyx_v_input_names = NULL; + PyObject *__pyx_v_input_name = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_v_param = NULL; + PyObject *__pyx_v_outputs = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_documentation = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("_get_defaults_and_docs", 0); + + /* "talib/_abstract.pxi":598 + * .. Note: func_info should come from Function.info, *not* _ta_getFuncInfo. + * """ + * defaults = {} # <<<<<<<<<<<<<< + * func_line = [func_info['name'], '('] + * func_args = ['[input_arrays]'] + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_defaults = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":599 + * """ + * defaults = {} + * func_line = [func_info['name'], '('] # <<<<<<<<<<<<<< + * func_args = ['[input_arrays]'] + * docs = [] + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s__1214); + __Pyx_GIVEREF(__pyx_kp_s__1214); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s__1214); + __pyx_t_1 = 0; + __pyx_v_func_line = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":600 + * defaults = {} + * func_line = [func_info['name'], '('] + * func_args = ['[input_arrays]'] # <<<<<<<<<<<<<< + * docs = [] + * docs.append('%(display_name)s (%(group)s)\n' % func_info) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_input_arrays_2); + __Pyx_GIVEREF(__pyx_kp_s_input_arrays_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_input_arrays_2); + __pyx_v_func_args = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":601 + * func_line = [func_info['name'], '('] + * func_args = ['[input_arrays]'] + * docs = [] # <<<<<<<<<<<<<< + * docs.append('%(display_name)s (%(group)s)\n' % func_info) + * + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_docs = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":602 + * func_args = ['[input_arrays]'] + * docs = [] + * docs.append('%(display_name)s (%(group)s)\n' % func_info) # <<<<<<<<<<<<<< + * + * input_names = func_info['input_names'] + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_display_name_s_group_s, __pyx_v_func_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":604 + * docs.append('%(display_name)s (%(group)s)\n' % func_info) + * + * input_names = func_info['input_names'] # <<<<<<<<<<<<<< + * docs.append('Inputs:') + * for input_name in input_names: + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_input_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_input_names = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":605 + * + * input_names = func_info['input_names'] + * docs.append('Inputs:') # <<<<<<<<<<<<<< + * for input_name in input_names: + * value = input_names[input_name] + */ + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Inputs); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 605, __pyx_L1_error) + + /* "talib/_abstract.pxi":606 + * input_names = func_info['input_names'] + * docs.append('Inputs:') + * for input_name in input_names: # <<<<<<<<<<<<<< + * value = input_names[input_name] + * if not isinstance(value, list): + */ + if (likely(PyList_CheckExact(__pyx_v_input_names)) || PyTuple_CheckExact(__pyx_v_input_names)) { + __pyx_t_2 = __pyx_v_input_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_input_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 606, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 606, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 606, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 606, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":607 + * docs.append('Inputs:') + * for input_name in input_names: + * value = input_names[input_name] # <<<<<<<<<<<<<< + * if not isinstance(value, list): + * value = '(any ndarray)' + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v_input_names, __pyx_v_input_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":608 + * for input_name in input_names: + * value = input_names[input_name] + * if not isinstance(value, list): # <<<<<<<<<<<<<< + * value = '(any ndarray)' + * docs.append(' %s: %s' % (input_name, value)) + */ + __pyx_t_6 = PyList_Check(__pyx_v_value); + __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0); + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":609 + * value = input_names[input_name] + * if not isinstance(value, list): + * value = '(any ndarray)' # <<<<<<<<<<<<<< + * docs.append(' %s: %s' % (input_name, value)) + * + */ + __Pyx_INCREF(__pyx_kp_s_any_ndarray); + __Pyx_DECREF_SET(__pyx_v_value, __pyx_kp_s_any_ndarray); + + /* "talib/_abstract.pxi":608 + * for input_name in input_names: + * value = input_names[input_name] + * if not isinstance(value, list): # <<<<<<<<<<<<<< + * value = '(any ndarray)' + * docs.append(' %s: %s' % (input_name, value)) + */ + } + + /* "talib/_abstract.pxi":610 + * if not isinstance(value, list): + * value = '(any ndarray)' + * docs.append(' %s: %s' % (input_name, value)) # <<<<<<<<<<<<<< + * + * params = func_info['parameters'] + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_input_name); + __Pyx_GIVEREF(__pyx_v_input_name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_input_name); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 610, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":606 + * input_names = func_info['input_names'] + * docs.append('Inputs:') + * for input_name in input_names: # <<<<<<<<<<<<<< + * value = input_names[input_name] + * if not isinstance(value, list): + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":612 + * docs.append(' %s: %s' % (input_name, value)) + * + * params = func_info['parameters'] # <<<<<<<<<<<<<< + * if params: + * docs.append('Parameters:') + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_params = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":613 + * + * params = func_info['parameters'] + * if params: # <<<<<<<<<<<<<< + * docs.append('Parameters:') + * for param in params: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_params); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 613, __pyx_L1_error) + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":614 + * params = func_info['parameters'] + * if params: + * docs.append('Parameters:') # <<<<<<<<<<<<<< + * for param in params: + * docs.append(' %s: %s' % (param, params[param])) + */ + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Parameters); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 614, __pyx_L1_error) + + /* "talib/_abstract.pxi":613 + * + * params = func_info['parameters'] + * if params: # <<<<<<<<<<<<<< + * docs.append('Parameters:') + * for param in params: + */ + } + + /* "talib/_abstract.pxi":615 + * if params: + * docs.append('Parameters:') + * for param in params: # <<<<<<<<<<<<<< + * docs.append(' %s: %s' % (param, params[param])) + * func_args.append('[%s=%s]' % (param, params[param])) + */ + if (likely(PyList_CheckExact(__pyx_v_params)) || PyTuple_CheckExact(__pyx_v_params)) { + __pyx_t_2 = __pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 615, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 615, __pyx_L1_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 615, __pyx_L1_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } + } else { + __pyx_t_8 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 615, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_8); + __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":616 + * docs.append('Parameters:') + * for param in params: + * docs.append(' %s: %s' % (param, params[param])) # <<<<<<<<<<<<<< + * func_args.append('[%s=%s]' % (param, params[param])) + * defaults[param] = params[param] + */ + __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_param); + __Pyx_GIVEREF(__pyx_v_param); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_param); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":617 + * for param in params: + * docs.append(' %s: %s' % (param, params[param])) + * func_args.append('[%s=%s]' % (param, params[param])) # <<<<<<<<<<<<<< + * defaults[param] = params[param] + * if param == 'matype': + */ + __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_param); + __Pyx_GIVEREF(__pyx_v_param); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_param); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_args, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 617, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":618 + * docs.append(' %s: %s' % (param, params[param])) + * func_args.append('[%s=%s]' % (param, params[param])) + * defaults[param] = params[param] # <<<<<<<<<<<<<< + * if param == 'matype': + * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) + */ + __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(PyDict_SetItem(__pyx_v_defaults, __pyx_v_param, __pyx_t_8) < 0)) __PYX_ERR(1, 618, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "talib/_abstract.pxi":619 + * func_args.append('[%s=%s]' % (param, params[param])) + * defaults[param] = params[param] + * if param == 'matype': # <<<<<<<<<<<<<< + * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) + * + */ + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_param, __pyx_n_s_matype, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 619, __pyx_L1_error) + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":620 + * defaults[param] = params[param] + * if param == 'matype': + * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) # <<<<<<<<<<<<<< + * + * outputs = func_info['output_names'] + */ + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_docs, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetItem(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s__1215, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_docs, -1L, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "talib/_abstract.pxi":619 + * func_args.append('[%s=%s]' % (param, params[param])) + * defaults[param] = params[param] + * if param == 'matype': # <<<<<<<<<<<<<< + * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) + * + */ + } + + /* "talib/_abstract.pxi":615 + * if params: + * docs.append('Parameters:') + * for param in params: # <<<<<<<<<<<<<< + * docs.append(' %s: %s' % (param, params[param])) + * func_args.append('[%s=%s]' % (param, params[param])) + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":622 + * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) + * + * outputs = func_info['output_names'] # <<<<<<<<<<<<<< + * docs.append('Outputs:') + * for output in outputs: + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_output_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_outputs = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":623 + * + * outputs = func_info['output_names'] + * docs.append('Outputs:') # <<<<<<<<<<<<<< + * for output in outputs: + * if output == 'integer': + */ + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Outputs); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 623, __pyx_L1_error) + + /* "talib/_abstract.pxi":624 + * outputs = func_info['output_names'] + * docs.append('Outputs:') + * for output in outputs: # <<<<<<<<<<<<<< + * if output == 'integer': + * output = 'integer (values are -100, 0 or 100)' + */ + if (likely(PyList_CheckExact(__pyx_v_outputs)) || PyTuple_CheckExact(__pyx_v_outputs)) { + __pyx_t_2 = __pyx_v_outputs; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_outputs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 624, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 624, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 624, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 624, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_9); + __pyx_t_9 = 0; + + /* "talib/_abstract.pxi":625 + * docs.append('Outputs:') + * for output in outputs: + * if output == 'integer': # <<<<<<<<<<<<<< + * output = 'integer (values are -100, 0 or 100)' + * docs.append(' %s' % output) + */ + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_output, __pyx_n_s_integer, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 625, __pyx_L1_error) + if (__pyx_t_7) { + + /* "talib/_abstract.pxi":626 + * for output in outputs: + * if output == 'integer': + * output = 'integer (values are -100, 0 or 100)' # <<<<<<<<<<<<<< + * docs.append(' %s' % output) + * + */ + __Pyx_INCREF(__pyx_kp_s_integer_values_are_100_0_or_100); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_kp_s_integer_values_are_100_0_or_100); + + /* "talib/_abstract.pxi":625 + * docs.append('Outputs:') + * for output in outputs: + * if output == 'integer': # <<<<<<<<<<<<<< + * output = 'integer (values are -100, 0 or 100)' + * docs.append(' %s' % output) + */ + } + + /* "talib/_abstract.pxi":627 + * if output == 'integer': + * output = 'integer (values are -100, 0 or 100)' + * docs.append(' %s' % output) # <<<<<<<<<<<<<< + * + * func_line.append(', '.join(func_args)) + */ + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_v_output); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 627, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "talib/_abstract.pxi":624 + * outputs = func_info['output_names'] + * docs.append('Outputs:') + * for output in outputs: # <<<<<<<<<<<<<< + * if output == 'integer': + * output = 'integer (values are -100, 0 or 100)' + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":629 + * docs.append(' %s' % output) + * + * func_line.append(', '.join(func_args)) # <<<<<<<<<<<<<< + * func_line.append(')\n') + * docs.insert(0, ''.join(func_line)) + */ + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__1212, __pyx_v_func_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_line, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":630 + * + * func_line.append(', '.join(func_args)) + * func_line.append(')\n') # <<<<<<<<<<<<<< + * docs.insert(0, ''.join(func_line)) + * documentation = '\n'.join(docs) + */ + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_line, __pyx_kp_s__1216); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 630, __pyx_L1_error) + + /* "talib/_abstract.pxi":631 + * func_line.append(', '.join(func_args)) + * func_line.append(')\n') + * docs.insert(0, ''.join(func_line)) # <<<<<<<<<<<<<< + * documentation = '\n'.join(docs) + * return defaults, documentation + */ + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__1211, __pyx_v_func_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_Insert(__pyx_v_docs, 0, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":632 + * func_line.append(')\n') + * docs.insert(0, ''.join(func_line)) + * documentation = '\n'.join(docs) # <<<<<<<<<<<<<< + * return defaults, documentation + * + */ + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__1217, __pyx_v_docs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_documentation = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":633 + * docs.insert(0, ''.join(func_line)) + * documentation = '\n'.join(docs) + * return defaults, documentation # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_defaults); + __Pyx_GIVEREF(__pyx_v_defaults); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_defaults); + __Pyx_INCREF(__pyx_v_documentation); + __Pyx_GIVEREF(__pyx_v_documentation); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_documentation); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_abstract.pxi":592 + * } + * + * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< + * """ + * Returns a tuple with two outputs: defaults, a dict of parameter defaults, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("talib._ta_lib._get_defaults_and_docs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_defaults); + __Pyx_XDECREF(__pyx_v_func_line); + __Pyx_XDECREF(__pyx_v_func_args); + __Pyx_XDECREF(__pyx_v_docs); + __Pyx_XDECREF(__pyx_v_input_names); + __Pyx_XDECREF(__pyx_v_input_name); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XDECREF(__pyx_v_param); + __Pyx_XDECREF(__pyx_v_outputs); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_documentation); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":644 + * # - Setting TALIB paramholder optInput values and calling the lookback function + * + * cdef lib.TA_FuncHandle* __ta_getFuncHandle(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns a pointer to a function handle for the given function name + */ + +static TA_FuncHandle *__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(char *__pyx_v_function_name) { + TA_FuncHandle *__pyx_v_handle; + TA_FuncHandle *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_getFuncHandle", 0); + + /* "talib/_abstract.pxi":649 + * """ + * cdef lib.TA_FuncHandle *handle + * _ta_check_success('TA_GetFuncHandle', lib.TA_GetFuncHandle(function_name, &handle)) # <<<<<<<<<<<<<< + * return handle + * + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncHandle, TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":650 + * cdef lib.TA_FuncHandle *handle + * _ta_check_success('TA_GetFuncHandle', lib.TA_GetFuncHandle(function_name, &handle)) + * return handle # <<<<<<<<<<<<<< + * + * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): + */ + __pyx_r = __pyx_v_handle; + goto __pyx_L0; + + /* "talib/_abstract.pxi":644 + * # - Setting TALIB paramholder optInput values and calling the lookback function + * + * cdef lib.TA_FuncHandle* __ta_getFuncHandle(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns a pointer to a function handle for the given function name + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_getFuncHandle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":652 + * return handle + * + * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns a pointer to a parameter holder for the given function name + */ + +static TA_ParamHolder *__pyx_f_5talib_7_ta_lib___ta_paramHolderAlloc(char *__pyx_v_function_name) { + TA_ParamHolder *__pyx_v_holder; + TA_RetCode __pyx_v_retCode; + TA_ParamHolder *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_paramHolderAlloc", 0); + + /* "talib/_abstract.pxi":657 + * """ + * cdef lib.TA_ParamHolder *holder + * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) # <<<<<<<<<<<<<< + * _ta_check_success('TA_ParamHolderAlloc', retCode) + * return holder + */ + __pyx_v_retCode = TA_ParamHolderAlloc(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_holder)); + + /* "talib/_abstract.pxi":658 + * cdef lib.TA_ParamHolder *holder + * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) + * _ta_check_success('TA_ParamHolderAlloc', retCode) # <<<<<<<<<<<<<< + * return holder + * + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ParamHolderAlloc, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":659 + * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) + * _ta_check_success('TA_ParamHolderAlloc', retCode) + * return holder # <<<<<<<<<<<<<< + * + * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): + */ + __pyx_r = __pyx_v_holder; + goto __pyx_L0; + + /* "talib/_abstract.pxi":652 + * return handle + * + * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns a pointer to a parameter holder for the given function name + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_paramHolderAlloc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":661 + * return holder + * + * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): # <<<<<<<<<<<<<< + * """ + * Frees the memory allocated by __ta_paramHolderAlloc (call when done with the parameter holder) + */ + +static int __pyx_f_5talib_7_ta_lib___ta_paramHolderFree(TA_ParamHolder *__pyx_v_params) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_paramHolderFree", 0); + + /* "talib/_abstract.pxi":666 + * WARNING: Not properly calling this function will cause memory leaks! + * """ + * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) # <<<<<<<<<<<<<< + * + * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ParamHolderFree, TA_ParamHolderFree(__pyx_v_params), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":661 + * return holder + * + * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): # <<<<<<<<<<<<<< + * """ + * Frees the memory allocated by __ta_paramHolderAlloc (call when done with the parameter holder) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_paramHolderFree", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":668 + * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) + * + * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< + * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamInteger', retCode) + */ + +static int __pyx_f_5talib_7_ta_lib___ta_setOptInputParamInteger(TA_ParamHolder *__pyx_v_holder, int __pyx_v_idx, int __pyx_v_value) { + TA_RetCode __pyx_v_retCode; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_setOptInputParamInteger", 0); + + /* "talib/_abstract.pxi":669 + * + * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): + * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) # <<<<<<<<<<<<<< + * _ta_check_success('TA_SetOptInputParamInteger', retCode) + * + */ + __pyx_v_retCode = TA_SetOptInputParamInteger(__pyx_v_holder, __pyx_v_idx, __pyx_v_value); + + /* "talib/_abstract.pxi":670 + * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): + * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamInteger', retCode) # <<<<<<<<<<<<<< + * + * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SetOptInputParamInteger, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":668 + * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) + * + * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< + * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamInteger', retCode) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_setOptInputParamInteger", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":672 + * _ta_check_success('TA_SetOptInputParamInteger', retCode) + * + * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< + * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamReal', retCode) + */ + +static int __pyx_f_5talib_7_ta_lib___ta_setOptInputParamReal(TA_ParamHolder *__pyx_v_holder, int __pyx_v_idx, int __pyx_v_value) { + TA_RetCode __pyx_v_retCode; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_setOptInputParamReal", 0); + + /* "talib/_abstract.pxi":673 + * + * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): + * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) # <<<<<<<<<<<<<< + * _ta_check_success('TA_SetOptInputParamReal', retCode) + * + */ + __pyx_v_retCode = TA_SetOptInputParamReal(__pyx_v_holder, __pyx_v_idx, __pyx_v_value); + + /* "talib/_abstract.pxi":674 + * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): + * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamReal', retCode) # <<<<<<<<<<<<<< + * + * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SetOptInputParamReal, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":672 + * _ta_check_success('TA_SetOptInputParamInteger', retCode) + * + * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< + * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) + * _ta_check_success('TA_SetOptInputParamReal', retCode) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_setOptInputParamReal", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_abstract.pxi":676 + * _ta_check_success('TA_SetOptInputParamReal', retCode) + * + * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): # <<<<<<<<<<<<<< + * cdef int lookback + * retCode = lib.TA_GetLookback(holder, &lookback) + */ + +static int __pyx_f_5talib_7_ta_lib___ta_getLookback(TA_ParamHolder *__pyx_v_holder) { + int __pyx_v_lookback; + TA_RetCode __pyx_v_retCode; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__ta_getLookback", 0); + + /* "talib/_abstract.pxi":678 + * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): + * cdef int lookback + * retCode = lib.TA_GetLookback(holder, &lookback) # <<<<<<<<<<<<<< + * _ta_check_success('TA_GetLookback', retCode) + * return lookback + */ + __pyx_v_retCode = TA_GetLookback(__pyx_v_holder, (&__pyx_v_lookback)); + + /* "talib/_abstract.pxi":679 + * cdef int lookback + * retCode = lib.TA_GetLookback(holder, &lookback) + * _ta_check_success('TA_GetLookback', retCode) # <<<<<<<<<<<<<< + * return lookback + */ + __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetLookback, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":680 + * retCode = lib.TA_GetLookback(holder, &lookback) + * _ta_check_success('TA_GetLookback', retCode) + * return lookback # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_lookback; + goto __pyx_L0; + + /* "talib/_abstract.pxi":676 + * _ta_check_success('TA_SetOptInputParamReal', retCode) + * + * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): # <<<<<<<<<<<<<< + * cdef int lookback + * retCode = lib.TA_GetLookback(holder, &lookback) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("talib._ta_lib.__ta_getLookback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":10 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_351stream_ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_350stream_ACOS[] = " ACOS(real)\n\n Vector Trigonometric ACos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_351stream_ACOS = {"stream_ACOS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_351stream_ACOS, METH_O, __pyx_doc_5talib_7_ta_lib_350stream_ACOS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_351stream_ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ACOS (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 10, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_350stream_ACOS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_350stream_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ACOS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":29 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":30 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1218, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 30, __pyx_L1_error) + + /* "talib/_stream.pxi":29 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":31 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":32 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 32, __pyx_L1_error) + + /* "talib/_stream.pxi":31 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":33 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":34 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 34, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":33 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":35 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":36 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":37 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ACOS", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":38 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ACOS", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ACOS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":39 + * outreal = NaN + * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ACOS", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ACOS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":40 + * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ACOS", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":10 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ACOS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":44 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_353stream_AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_352stream_AD[] = " AD(high, low, close, volume)\n\n Chaikin A/D Line (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_353stream_AD = {"stream_AD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_353stream_AD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_352stream_AD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_353stream_AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_AD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AD", 1, 4, 4, 1); __PYX_ERR(3, 44, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AD", 1, 4, 4, 2); __PYX_ERR(3, 44, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AD", 1, 4, 4, 3); __PYX_ERR(3, 44, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_AD") < 0)) __PYX_ERR(3, 44, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_AD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 44, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_AD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 44, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 44, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 44, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(3, 44, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_352stream_AD(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_352stream_AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_AD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_stream.pxi":66 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":67 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 67, __pyx_L1_error) + + /* "talib/_stream.pxi":66 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":68 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":69 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 69, __pyx_L1_error) + + /* "talib/_stream.pxi":68 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":70 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":71 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 71, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":70 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":72 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":73 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":74 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 74, __pyx_L1_error) + + /* "talib/_stream.pxi":73 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":75 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":76 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 76, __pyx_L1_error) + + /* "talib/_stream.pxi":75 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":77 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":78 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 78, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":77 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":79 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":80 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":81 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 81, __pyx_L1_error) + + /* "talib/_stream.pxi":80 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":82 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":83 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 83, __pyx_L1_error) + + /* "talib/_stream.pxi":82 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":84 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":85 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 85, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":84 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":86 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":87 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":88 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 88, __pyx_L1_error) + + /* "talib/_stream.pxi":87 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_stream.pxi":89 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":90 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 90, __pyx_L1_error) + + /* "talib/_stream.pxi":89 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":91 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":92 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 92, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":91 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_stream.pxi":93 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_stream.pxi":94 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":95 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":96 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1228, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 96, __pyx_L1_error) + + /* "talib/_stream.pxi":95 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":97 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":98 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1229, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 98, __pyx_L1_error) + + /* "talib/_stream.pxi":97 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_stream.pxi":99 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":100 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1230, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 100, __pyx_L1_error) + + /* "talib/_stream.pxi":99 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":101 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AD", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":102 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":103 + * outreal = NaN + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":104 + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":44 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_AD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_355stream_ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_354stream_ADD[] = " ADD(real0, real1)\n\n Vector Arithmetic Add (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_355stream_ADD = {"stream_ADD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_355stream_ADD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_354stream_ADD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_355stream_ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ADD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADD", 1, 2, 2, 1); __PYX_ERR(3, 108, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ADD") < 0)) __PYX_ERR(3, 108, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ADD", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 108, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 108, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_354stream_ADD(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_354stream_ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ADD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":129 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":130 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1231, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 130, __pyx_L1_error) + + /* "talib/_stream.pxi":129 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":131 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":132 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 132, __pyx_L1_error) + + /* "talib/_stream.pxi":131 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":133 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":134 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 134, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":133 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":135 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":136 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":137 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1233, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 137, __pyx_L1_error) + + /* "talib/_stream.pxi":136 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":138 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":139 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1234, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 139, __pyx_L1_error) + + /* "talib/_stream.pxi":138 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":140 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":141 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 141, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":140 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":142 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":143 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":144 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":145 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1235, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 145, __pyx_L1_error) + + /* "talib/_stream.pxi":144 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":146 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADD", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":147 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":148 + * outreal = NaN + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":149 + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":153 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_357stream_ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_356stream_ADOSC[] = " ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?])\n\n Chaikin A/D Oscillator (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n fastperiod: 3\n slowperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_357stream_ADOSC = {"stream_ADOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_357stream_ADOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_356stream_ADOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_357stream_ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ADOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADOSC", 0, 4, 6, 1); __PYX_ERR(3, 153, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADOSC", 0, 4, 6, 2); __PYX_ERR(3, 153, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADOSC", 0, 4, 6, 3); __PYX_ERR(3, 153, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ADOSC") < 0)) __PYX_ERR(3, 153, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 153, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 153, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ADOSC", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 153, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(3, 153, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_356stream_ADOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_fastperiod, __pyx_v_slowperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_356stream_ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ADOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_stream.pxi":178 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":179 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1236, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 179, __pyx_L1_error) + + /* "talib/_stream.pxi":178 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":180 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":181 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1237, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 181, __pyx_L1_error) + + /* "talib/_stream.pxi":180 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":182 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":183 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 183, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":182 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":184 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":185 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":186 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 186, __pyx_L1_error) + + /* "talib/_stream.pxi":185 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":187 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":188 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 188, __pyx_L1_error) + + /* "talib/_stream.pxi":187 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":189 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":190 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 190, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":189 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":191 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":192 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":193 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1240, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 193, __pyx_L1_error) + + /* "talib/_stream.pxi":192 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":194 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":195 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1241, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 195, __pyx_L1_error) + + /* "talib/_stream.pxi":194 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":196 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":197 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 197, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":196 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":198 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":199 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":200 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1242, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 200, __pyx_L1_error) + + /* "talib/_stream.pxi":199 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_stream.pxi":201 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":202 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1243, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 202, __pyx_L1_error) + + /* "talib/_stream.pxi":201 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":203 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":204 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 204, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":203 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_stream.pxi":205 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_stream.pxi":206 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":207 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":208 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1244, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 208, __pyx_L1_error) + + /* "talib/_stream.pxi":207 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":209 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":210 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1245, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 210, __pyx_L1_error) + + /* "talib/_stream.pxi":209 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_stream.pxi":211 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":212 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1246, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 212, __pyx_L1_error) + + /* "talib/_stream.pxi":211 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":213 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADOSC", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":214 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, __pyx_v_fastperiod, __pyx_v_slowperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":215 + * outreal = NaN + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":216 + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":153 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":220 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_359stream_ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_358stream_ADX[] = " ADX(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_359stream_ADX = {"stream_ADX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_359stream_ADX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_358stream_ADX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_359stream_ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ADX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADX", 0, 3, 4, 1); __PYX_ERR(3, 220, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADX", 0, 3, 4, 2); __PYX_ERR(3, 220, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ADX") < 0)) __PYX_ERR(3, 220, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 220, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ADX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 220, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 220, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_358stream_ADX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_358stream_ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ADX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":243 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":244 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1247, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 244, __pyx_L1_error) + + /* "talib/_stream.pxi":243 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":245 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":246 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1248, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 246, __pyx_L1_error) + + /* "talib/_stream.pxi":245 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":247 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":248 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 248, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":247 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":249 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":250 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":251 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1249, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 251, __pyx_L1_error) + + /* "talib/_stream.pxi":250 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":252 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":253 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1250, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 253, __pyx_L1_error) + + /* "talib/_stream.pxi":252 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":254 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":255 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 255, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":254 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":256 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":257 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":258 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1251, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 258, __pyx_L1_error) + + /* "talib/_stream.pxi":257 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":259 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":260 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1252, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 260, __pyx_L1_error) + + /* "talib/_stream.pxi":259 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":261 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":262 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 262, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":261 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":263 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":264 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":265 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":266 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1253, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 266, __pyx_L1_error) + + /* "talib/_stream.pxi":265 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":267 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":268 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1254, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 268, __pyx_L1_error) + + /* "talib/_stream.pxi":267 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":269 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADX", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":270 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":271 + * outreal = NaN + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":272 + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":220 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_361stream_ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_360stream_ADXR[] = " ADXR(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index Rating (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_361stream_ADXR = {"stream_ADXR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_361stream_ADXR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_360stream_ADXR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_361stream_ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ADXR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADXR", 0, 3, 4, 1); __PYX_ERR(3, 276, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ADXR", 0, 3, 4, 2); __PYX_ERR(3, 276, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ADXR") < 0)) __PYX_ERR(3, 276, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 276, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ADXR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 276, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 276, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_360stream_ADXR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_360stream_ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ADXR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":299 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":300 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1255, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 300, __pyx_L1_error) + + /* "talib/_stream.pxi":299 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":301 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":302 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 302, __pyx_L1_error) + + /* "talib/_stream.pxi":301 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":303 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":304 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 304, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":303 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":305 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":306 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":307 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 307, __pyx_L1_error) + + /* "talib/_stream.pxi":306 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":308 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":309 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 309, __pyx_L1_error) + + /* "talib/_stream.pxi":308 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":310 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":311 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 311, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":310 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":312 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":313 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":314 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 314, __pyx_L1_error) + + /* "talib/_stream.pxi":313 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":315 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":316 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 316, __pyx_L1_error) + + /* "talib/_stream.pxi":315 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":317 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":318 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 318, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":317 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":319 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":320 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":321 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":322 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 322, __pyx_L1_error) + + /* "talib/_stream.pxi":321 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":323 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":324 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 324, __pyx_L1_error) + + /* "talib/_stream.pxi":323 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":325 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADXR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":326 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ADXR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ADXR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":327 + * outreal = NaN + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADXR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ADXR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":328 + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ADXR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":332 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_363stream_APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_362stream_APO[] = " APO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Absolute Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_363stream_APO = {"stream_APO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_363stream_APO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_362stream_APO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_363stream_APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_APO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_APO") < 0)) __PYX_ERR(3, 332, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 332, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 332, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 332, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_APO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 332, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_APO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 332, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_362stream_APO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_362stream_APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_APO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":355 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":356 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 356, __pyx_L1_error) + + /* "talib/_stream.pxi":355 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":357 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":358 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 358, __pyx_L1_error) + + /* "talib/_stream.pxi":357 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":359 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":360 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 360, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":359 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":361 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":362 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":363 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_APO", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":364 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_APO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_APO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":365 + * outreal = NaN + * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_APO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_APO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":366 + * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_APO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":332 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_APO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":370 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_365stream_AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_364stream_AROON[] = " AROON(high, low[, timeperiod=?])\n\n Aroon (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n aroondown\n aroonup\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_365stream_AROON = {"stream_AROON", (PyCFunction)__pyx_pw_5talib_7_ta_lib_365stream_AROON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_364stream_AROON}; +static PyObject *__pyx_pw_5talib_7_ta_lib_365stream_AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_AROON (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AROON", 0, 2, 3, 1); __PYX_ERR(3, 370, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_AROON") < 0)) __PYX_ERR(3, 370, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 370, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_AROON", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 370, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 370, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 370, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_364stream_AROON(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_364stream_AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outaroondown; + double __pyx_v_outaroonup; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_AROON", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":394 + * double outaroondown + * double outaroonup + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":395 + * double outaroonup + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1265, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 395, __pyx_L1_error) + + /* "talib/_stream.pxi":394 + * double outaroondown + * double outaroonup + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":396 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":397 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1266, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 397, __pyx_L1_error) + + /* "talib/_stream.pxi":396 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":398 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":399 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":398 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":400 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":401 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":402 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1267, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 402, __pyx_L1_error) + + /* "talib/_stream.pxi":401 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":403 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":404 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1268, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 404, __pyx_L1_error) + + /* "talib/_stream.pxi":403 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":405 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":406 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 406, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":405 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":407 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":408 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":409 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outaroondown = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":410 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outaroondown = NaN + * outaroonup = NaN + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1269, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 410, __pyx_L1_error) + + /* "talib/_stream.pxi":409 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outaroondown = NaN + */ + } + + /* "talib/_stream.pxi":411 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outaroondown = NaN # <<<<<<<<<<<<<< + * outaroonup = NaN + * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) + */ + __pyx_v_outaroondown = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":412 + * raise Exception("input lengths are different") + * outaroondown = NaN + * outaroonup = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) + * _ta_check_success("TA_AROON", retCode) + */ + __pyx_v_outaroonup = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":413 + * outaroondown = NaN + * outaroonup = NaN + * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AROON", retCode) + * return outaroondown , outaroonup + */ + __pyx_v_retCode = TA_AROON((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outaroondown), (&__pyx_v_outaroonup)); + + /* "talib/_stream.pxi":414 + * outaroonup = NaN + * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) + * _ta_check_success("TA_AROON", retCode) # <<<<<<<<<<<<<< + * return outaroondown , outaroonup + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AROON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":415 + * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) + * _ta_check_success("TA_AROON", retCode) + * return outaroondown , outaroonup # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outaroondown); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outaroonup); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":370 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_367stream_AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_366stream_AROONOSC[] = " AROONOSC(high, low[, timeperiod=?])\n\n Aroon Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_367stream_AROONOSC = {"stream_AROONOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_367stream_AROONOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_366stream_AROONOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_367stream_AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_AROONOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AROONOSC", 0, 2, 3, 1); __PYX_ERR(3, 419, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_AROONOSC") < 0)) __PYX_ERR(3, 419, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 419, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_AROONOSC", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 419, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 419, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 419, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_366stream_AROONOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_366stream_AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_AROONOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":441 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":442 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1270, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 442, __pyx_L1_error) + + /* "talib/_stream.pxi":441 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":443 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":444 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1271, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 444, __pyx_L1_error) + + /* "talib/_stream.pxi":443 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":445 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":446 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 446, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":445 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":447 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":448 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":449 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1272, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 449, __pyx_L1_error) + + /* "talib/_stream.pxi":448 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":450 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":451 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1273, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 451, __pyx_L1_error) + + /* "talib/_stream.pxi":450 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":452 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":453 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 453, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":452 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":454 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":455 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":456 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":457 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1274, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 457, __pyx_L1_error) + + /* "talib/_stream.pxi":456 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":458 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AROONOSC", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":459 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AROONOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AROONOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":460 + * outreal = NaN + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AROONOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AROONOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":461 + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AROONOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":465 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_369stream_ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_368stream_ASIN[] = " ASIN(real)\n\n Vector Trigonometric ASin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_369stream_ASIN = {"stream_ASIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_369stream_ASIN, METH_O, __pyx_doc_5talib_7_ta_lib_368stream_ASIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_369stream_ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ASIN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 465, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_368stream_ASIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_368stream_ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ASIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":484 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":485 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1275, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 485, __pyx_L1_error) + + /* "talib/_stream.pxi":484 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":486 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":487 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1276, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 487, __pyx_L1_error) + + /* "talib/_stream.pxi":486 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":488 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":489 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 489, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":488 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":490 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":491 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":492 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ASIN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":493 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ASIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ASIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":494 + * outreal = NaN + * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ASIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ASIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":495 + * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ASIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":465 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ASIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":499 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_371stream_ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_370stream_ATAN[] = " ATAN(real)\n\n Vector Trigonometric ATan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_371stream_ATAN = {"stream_ATAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_371stream_ATAN, METH_O, __pyx_doc_5talib_7_ta_lib_370stream_ATAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_371stream_ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ATAN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_370stream_ATAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_370stream_ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ATAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":518 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":519 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1277, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 519, __pyx_L1_error) + + /* "talib/_stream.pxi":518 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":520 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":521 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1278, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 521, __pyx_L1_error) + + /* "talib/_stream.pxi":520 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":522 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":523 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 523, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":522 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":524 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":525 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":526 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATAN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":527 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ATAN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ATAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":528 + * outreal = NaN + * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATAN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ATAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":529 + * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATAN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":499 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ATAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":533 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_373stream_ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_372stream_ATR[] = " ATR(high, low, close[, timeperiod=?])\n\n Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_373stream_ATR = {"stream_ATR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_373stream_ATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_372stream_ATR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_373stream_ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ATR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ATR", 0, 3, 4, 1); __PYX_ERR(3, 533, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ATR", 0, 3, 4, 2); __PYX_ERR(3, 533, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ATR") < 0)) __PYX_ERR(3, 533, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 533, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 533, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 533, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 533, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 533, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_372stream_ATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_372stream_ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ATR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":556 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":557 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1279, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 557, __pyx_L1_error) + + /* "talib/_stream.pxi":556 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":558 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":559 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1280, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 559, __pyx_L1_error) + + /* "talib/_stream.pxi":558 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":560 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":561 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 561, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":560 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":562 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":563 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":564 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1281, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 564, __pyx_L1_error) + + /* "talib/_stream.pxi":563 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":565 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":566 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1282, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 566, __pyx_L1_error) + + /* "talib/_stream.pxi":565 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":567 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":568 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 568, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":567 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":569 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":570 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":571 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1283, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 571, __pyx_L1_error) + + /* "talib/_stream.pxi":570 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":572 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":573 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 573, __pyx_L1_error) + + /* "talib/_stream.pxi":572 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":574 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":575 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 575, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":574 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":576 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":577 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":578 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":579 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1285, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 579, __pyx_L1_error) + + /* "talib/_stream.pxi":578 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":580 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":581 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1286, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 581, __pyx_L1_error) + + /* "talib/_stream.pxi":580 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":582 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":583 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ATR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ATR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":584 + * outreal = NaN + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":585 + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ATR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":533 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":589 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_375stream_AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_374stream_AVGPRICE[] = " AVGPRICE(open, high, low, close)\n\n Average Price (Price Transform)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_375stream_AVGPRICE = {"stream_AVGPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_375stream_AVGPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_374stream_AVGPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_375stream_AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_AVGPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AVGPRICE", 1, 4, 4, 1); __PYX_ERR(3, 589, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AVGPRICE", 1, 4, 4, 2); __PYX_ERR(3, 589, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_AVGPRICE", 1, 4, 4, 3); __PYX_ERR(3, 589, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_AVGPRICE") < 0)) __PYX_ERR(3, 589, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_AVGPRICE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 589, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 589, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 589, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 589, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 589, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_374stream_AVGPRICE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_374stream_AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_AVGPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":611 + * int outnbelement + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":612 + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1287, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 612, __pyx_L1_error) + + /* "talib/_stream.pxi":611 + * int outnbelement + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":613 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":614 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1288, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 614, __pyx_L1_error) + + /* "talib/_stream.pxi":613 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":615 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":616 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 616, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":615 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":617 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":618 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":619 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1289, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 619, __pyx_L1_error) + + /* "talib/_stream.pxi":618 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":620 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":621 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1290, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 621, __pyx_L1_error) + + /* "talib/_stream.pxi":620 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":622 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":623 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 623, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":622 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":624 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":625 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":626 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1291, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 626, __pyx_L1_error) + + /* "talib/_stream.pxi":625 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":627 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":628 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1292, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 628, __pyx_L1_error) + + /* "talib/_stream.pxi":627 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":629 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":630 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 630, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":629 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":631 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":632 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":633 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1293, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 633, __pyx_L1_error) + + /* "talib/_stream.pxi":632 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":634 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":635 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1294, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 635, __pyx_L1_error) + + /* "talib/_stream.pxi":634 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":636 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":637 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 637, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":636 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":638 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":639 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":640 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":641 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1295, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 641, __pyx_L1_error) + + /* "talib/_stream.pxi":640 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":642 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":643 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1296, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 643, __pyx_L1_error) + + /* "talib/_stream.pxi":642 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":644 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":645 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1297, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 645, __pyx_L1_error) + + /* "talib/_stream.pxi":644 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":646 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AVGPRICE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":647 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_AVGPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_AVGPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":648 + * outreal = NaN + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AVGPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_AVGPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":649 + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_AVGPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":589 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":653 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_377stream_BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_376stream_BBANDS[] = " BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?])\n\n Bollinger Bands (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdevup: 2\n nbdevdn: 2\n matype: 0 (Simple Moving Average)\n Outputs:\n upperband\n middleband\n lowerband\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_377stream_BBANDS = {"stream_BBANDS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_377stream_BBANDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_376stream_BBANDS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_377stream_BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdevup; + double __pyx_v_nbdevdn; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_BBANDS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdevup,&__pyx_n_s_nbdevdn,&__pyx_n_s_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevup); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevdn); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_BBANDS") < 0)) __PYX_ERR(3, 653, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 653, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdevup = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdevup == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 653, __pyx_L3_error) + } else { + __pyx_v_nbdevup = ((double)-4e37); + } + if (values[3]) { + __pyx_v_nbdevdn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_nbdevdn == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 653, __pyx_L3_error) + } else { + __pyx_v_nbdevdn = ((double)-4e37); + } + if (values[4]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 653, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_BBANDS", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 653, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 653, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_376stream_BBANDS(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_376stream_BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outrealupperband; + double __pyx_v_outrealmiddleband; + double __pyx_v_outreallowerband; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("stream_BBANDS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":681 + * double outrealmiddleband + * double outreallowerband + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":682 + * double outreallowerband + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1298, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 682, __pyx_L1_error) + + /* "talib/_stream.pxi":681 + * double outrealmiddleband + * double outreallowerband + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":683 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":684 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1299, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 684, __pyx_L1_error) + + /* "talib/_stream.pxi":683 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":685 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":686 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 686, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":685 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":687 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outrealupperband = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":688 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outrealupperband = NaN + * outrealmiddleband = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":689 + * real_data = real.data + * length = real.shape[0] + * outrealupperband = NaN # <<<<<<<<<<<<<< + * outrealmiddleband = NaN + * outreallowerband = NaN + */ + __pyx_v_outrealupperband = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":690 + * length = real.shape[0] + * outrealupperband = NaN + * outrealmiddleband = NaN # <<<<<<<<<<<<<< + * outreallowerband = NaN + * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) + */ + __pyx_v_outrealmiddleband = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":691 + * outrealupperband = NaN + * outrealmiddleband = NaN + * outreallowerband = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) + * _ta_check_success("TA_BBANDS", retCode) + */ + __pyx_v_outreallowerband = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":692 + * outrealmiddleband = NaN + * outreallowerband = NaN + * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BBANDS", retCode) + * return outrealupperband , outrealmiddleband , outreallowerband + */ + __pyx_v_retCode = TA_BBANDS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outrealupperband), (&__pyx_v_outrealmiddleband), (&__pyx_v_outreallowerband)); + + /* "talib/_stream.pxi":693 + * outreallowerband = NaN + * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) + * _ta_check_success("TA_BBANDS", retCode) # <<<<<<<<<<<<<< + * return outrealupperband , outrealmiddleband , outreallowerband + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BBANDS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":694 + * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) + * _ta_check_success("TA_BBANDS", retCode) + * return outrealupperband , outrealmiddleband , outreallowerband # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outrealupperband); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outrealmiddleband); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outreallowerband); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":653 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.stream_BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":698 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_379stream_BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_378stream_BETA[] = " BETA(real0, real1[, timeperiod=?])\n\n Beta (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 5\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_379stream_BETA = {"stream_BETA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_379stream_BETA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_378stream_BETA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_379stream_BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_BETA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_BETA", 0, 2, 3, 1); __PYX_ERR(3, 698, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_BETA") < 0)) __PYX_ERR(3, 698, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 698, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_BETA", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 698, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 698, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 698, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_378stream_BETA(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_378stream_BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_BETA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":721 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":722 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1300, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 722, __pyx_L1_error) + + /* "talib/_stream.pxi":721 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":723 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":724 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1301, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 724, __pyx_L1_error) + + /* "talib/_stream.pxi":723 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":725 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":726 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 726, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":725 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":727 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":728 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":729 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1302, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 729, __pyx_L1_error) + + /* "talib/_stream.pxi":728 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":730 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":731 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1303, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 731, __pyx_L1_error) + + /* "talib/_stream.pxi":730 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":732 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":733 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 733, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":732 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":734 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":735 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":736 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":737 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1304, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 737, __pyx_L1_error) + + /* "talib/_stream.pxi":736 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":738 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BETA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":739 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BETA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_BETA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":740 + * outreal = NaN + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BETA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BETA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":741 + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BETA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":698 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":745 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_381stream_BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_380stream_BOP[] = " BOP(open, high, low, close)\n\n Balance Of Power (Momentum Indicators)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_381stream_BOP = {"stream_BOP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_381stream_BOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_380stream_BOP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_381stream_BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_BOP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_BOP", 1, 4, 4, 1); __PYX_ERR(3, 745, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_BOP", 1, 4, 4, 2); __PYX_ERR(3, 745, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_BOP", 1, 4, 4, 3); __PYX_ERR(3, 745, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_BOP") < 0)) __PYX_ERR(3, 745, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_BOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 745, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 745, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 745, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 745, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 745, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_380stream_BOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_380stream_BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_BOP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":767 + * int outnbelement + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":768 + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1305, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 768, __pyx_L1_error) + + /* "talib/_stream.pxi":767 + * int outnbelement + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":769 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":770 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1306, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 770, __pyx_L1_error) + + /* "talib/_stream.pxi":769 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":771 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":772 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 772, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":771 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":773 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":774 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":775 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1307, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 775, __pyx_L1_error) + + /* "talib/_stream.pxi":774 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":776 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":777 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1308, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 777, __pyx_L1_error) + + /* "talib/_stream.pxi":776 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":778 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":779 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 779, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":778 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":780 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":781 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":782 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1309, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 782, __pyx_L1_error) + + /* "talib/_stream.pxi":781 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":783 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":784 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1310, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 784, __pyx_L1_error) + + /* "talib/_stream.pxi":783 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":785 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":786 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 786, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":785 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":787 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":788 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":789 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1311, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 789, __pyx_L1_error) + + /* "talib/_stream.pxi":788 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":790 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":791 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1312, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 791, __pyx_L1_error) + + /* "talib/_stream.pxi":790 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":792 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":793 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 793, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":792 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":794 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":795 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":796 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":797 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1313, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 797, __pyx_L1_error) + + /* "talib/_stream.pxi":796 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":798 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":799 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1314, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) + + /* "talib/_stream.pxi":798 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":800 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":801 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1315, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 801, __pyx_L1_error) + + /* "talib/_stream.pxi":800 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":802 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BOP", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":803 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_BOP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_BOP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":804 + * outreal = NaN + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BOP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_BOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":805 + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_BOP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":745 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":809 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_383stream_CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_382stream_CCI[] = " CCI(high, low, close[, timeperiod=?])\n\n Commodity Channel Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_383stream_CCI = {"stream_CCI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_383stream_CCI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_382stream_CCI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_383stream_CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CCI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CCI", 0, 3, 4, 1); __PYX_ERR(3, 809, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CCI", 0, 3, 4, 2); __PYX_ERR(3, 809, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CCI") < 0)) __PYX_ERR(3, 809, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CCI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 809, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 809, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_382stream_CCI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_382stream_CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CCI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":832 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":833 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1316, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 833, __pyx_L1_error) + + /* "talib/_stream.pxi":832 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":834 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":835 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1317, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 835, __pyx_L1_error) + + /* "talib/_stream.pxi":834 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":836 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":837 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":836 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":838 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":839 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":840 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1318, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 840, __pyx_L1_error) + + /* "talib/_stream.pxi":839 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":841 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":842 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1319, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 842, __pyx_L1_error) + + /* "talib/_stream.pxi":841 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":843 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":844 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":843 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":845 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":846 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":847 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1320, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 847, __pyx_L1_error) + + /* "talib/_stream.pxi":846 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":848 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":849 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1321, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 849, __pyx_L1_error) + + /* "talib/_stream.pxi":848 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":850 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":851 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 851, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":850 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":852 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":853 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":854 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":855 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1322, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 855, __pyx_L1_error) + + /* "talib/_stream.pxi":854 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":856 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":857 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1323, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 857, __pyx_L1_error) + + /* "talib/_stream.pxi":856 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":858 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CCI", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":859 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CCI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CCI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":860 + * outreal = NaN + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CCI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CCI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":861 + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CCI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":809 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":865 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_385stream_CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_384stream_CDL2CROWS[] = " CDL2CROWS(open, high, low, close)\n\n Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_385stream_CDL2CROWS = {"stream_CDL2CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_385stream_CDL2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_384stream_CDL2CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_385stream_CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL2CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL2CROWS", 1, 4, 4, 1); __PYX_ERR(3, 865, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL2CROWS", 1, 4, 4, 2); __PYX_ERR(3, 865, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL2CROWS", 1, 4, 4, 3); __PYX_ERR(3, 865, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL2CROWS") < 0)) __PYX_ERR(3, 865, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 865, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 865, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 865, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 865, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 865, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_384stream_CDL2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_384stream_CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL2CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":887 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":888 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1324, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 888, __pyx_L1_error) + + /* "talib/_stream.pxi":887 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":889 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":890 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1325, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 890, __pyx_L1_error) + + /* "talib/_stream.pxi":889 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":891 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":892 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 892, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":891 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":893 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":894 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":895 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1326, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 895, __pyx_L1_error) + + /* "talib/_stream.pxi":894 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":896 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":897 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1327, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 897, __pyx_L1_error) + + /* "talib/_stream.pxi":896 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":898 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":899 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 899, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":898 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":900 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":901 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":902 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1328, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 902, __pyx_L1_error) + + /* "talib/_stream.pxi":901 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":903 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":904 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1329, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 904, __pyx_L1_error) + + /* "talib/_stream.pxi":903 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":905 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":906 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 906, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":905 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":907 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":908 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":909 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1330, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 909, __pyx_L1_error) + + /* "talib/_stream.pxi":908 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":910 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":911 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1331, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 911, __pyx_L1_error) + + /* "talib/_stream.pxi":910 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":912 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":913 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 913, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":912 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":914 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":915 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":916 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":917 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1332, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 917, __pyx_L1_error) + + /* "talib/_stream.pxi":916 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":918 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":919 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1333, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 919, __pyx_L1_error) + + /* "talib/_stream.pxi":918 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":920 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":921 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1334, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 921, __pyx_L1_error) + + /* "talib/_stream.pxi":920 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":922 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL2CROWS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":923 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL2CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL2CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":924 + * outinteger = 0 + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL2CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":925 + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL2CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":865 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":929 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_387stream_CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_386stream_CDL3BLACKCROWS[] = " CDL3BLACKCROWS(open, high, low, close)\n\n Three Black Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_387stream_CDL3BLACKCROWS = {"stream_CDL3BLACKCROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_387stream_CDL3BLACKCROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_386stream_CDL3BLACKCROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_387stream_CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3BLACKCROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3BLACKCROWS", 1, 4, 4, 1); __PYX_ERR(3, 929, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3BLACKCROWS", 1, 4, 4, 2); __PYX_ERR(3, 929, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3BLACKCROWS", 1, 4, 4, 3); __PYX_ERR(3, 929, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3BLACKCROWS") < 0)) __PYX_ERR(3, 929, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3BLACKCROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 929, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 929, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 929, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 929, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 929, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_386stream_CDL3BLACKCROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_386stream_CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3BLACKCROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":951 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":952 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1335, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 952, __pyx_L1_error) + + /* "talib/_stream.pxi":951 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":953 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":954 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1336, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 954, __pyx_L1_error) + + /* "talib/_stream.pxi":953 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":955 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":956 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 956, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":955 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":957 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":958 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":959 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1337, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 959, __pyx_L1_error) + + /* "talib/_stream.pxi":958 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":960 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":961 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1338, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 961, __pyx_L1_error) + + /* "talib/_stream.pxi":960 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":962 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":963 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 963, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":962 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":964 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":965 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":966 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1339, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 966, __pyx_L1_error) + + /* "talib/_stream.pxi":965 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":967 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":968 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1340, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 968, __pyx_L1_error) + + /* "talib/_stream.pxi":967 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":969 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":970 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 970, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":969 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":971 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":972 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":973 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1341, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 973, __pyx_L1_error) + + /* "talib/_stream.pxi":972 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":974 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":975 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1342, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 975, __pyx_L1_error) + + /* "talib/_stream.pxi":974 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":976 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":977 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 977, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":976 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":978 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":979 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":980 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":981 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1343, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 981, __pyx_L1_error) + + /* "talib/_stream.pxi":980 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":982 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":983 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1344, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 983, __pyx_L1_error) + + /* "talib/_stream.pxi":982 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":984 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":985 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1345, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 985, __pyx_L1_error) + + /* "talib/_stream.pxi":984 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":986 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":987 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3BLACKCROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":988 + * outinteger = 0 + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":989 + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3BLACKCROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":929 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_389stream_CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_388stream_CDL3INSIDE[] = " CDL3INSIDE(open, high, low, close)\n\n Three Inside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_389stream_CDL3INSIDE = {"stream_CDL3INSIDE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_389stream_CDL3INSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_388stream_CDL3INSIDE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_389stream_CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3INSIDE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3INSIDE", 1, 4, 4, 1); __PYX_ERR(3, 993, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3INSIDE", 1, 4, 4, 2); __PYX_ERR(3, 993, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3INSIDE", 1, 4, 4, 3); __PYX_ERR(3, 993, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3INSIDE") < 0)) __PYX_ERR(3, 993, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3INSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 993, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 993, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 993, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 993, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 993, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_388stream_CDL3INSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_388stream_CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3INSIDE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1015 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1016 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1346, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1016, __pyx_L1_error) + + /* "talib/_stream.pxi":1015 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1017 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1018 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1347, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1018, __pyx_L1_error) + + /* "talib/_stream.pxi":1017 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1019 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1020 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1020, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1019 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1021 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1022 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1023 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1348, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1023, __pyx_L1_error) + + /* "talib/_stream.pxi":1022 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1024 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1025 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1349, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1025, __pyx_L1_error) + + /* "talib/_stream.pxi":1024 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1026 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1027 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1027, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1026 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1028 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1029 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1030 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1350, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1030, __pyx_L1_error) + + /* "talib/_stream.pxi":1029 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1031 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1032 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1351, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1032, __pyx_L1_error) + + /* "talib/_stream.pxi":1031 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1033 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1034 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1034, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1033 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1035 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1036 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1037 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1352, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1037, __pyx_L1_error) + + /* "talib/_stream.pxi":1036 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1038 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1039 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1353, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1039, __pyx_L1_error) + + /* "talib/_stream.pxi":1038 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1040 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1041 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1041, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1040 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1042 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1043 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1044 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1045 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1354, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1045, __pyx_L1_error) + + /* "talib/_stream.pxi":1044 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1046 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1047 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1355, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1047, __pyx_L1_error) + + /* "talib/_stream.pxi":1046 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1048 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1049 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1356, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1049, __pyx_L1_error) + + /* "talib/_stream.pxi":1048 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1050 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3INSIDE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1051 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3INSIDE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3INSIDE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1052 + * outinteger = 0 + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3INSIDE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3INSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1053 + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3INSIDE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1057 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_391stream_CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_390stream_CDL3LINESTRIKE[] = " CDL3LINESTRIKE(open, high, low, close)\n\n Three-Line Strike (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_391stream_CDL3LINESTRIKE = {"stream_CDL3LINESTRIKE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_391stream_CDL3LINESTRIKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_390stream_CDL3LINESTRIKE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_391stream_CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3LINESTRIKE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3LINESTRIKE", 1, 4, 4, 1); __PYX_ERR(3, 1057, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3LINESTRIKE", 1, 4, 4, 2); __PYX_ERR(3, 1057, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3LINESTRIKE", 1, 4, 4, 3); __PYX_ERR(3, 1057, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3LINESTRIKE") < 0)) __PYX_ERR(3, 1057, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3LINESTRIKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1057, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1057, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1057, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1057, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1057, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_390stream_CDL3LINESTRIKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_390stream_CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3LINESTRIKE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1079 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1080 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1357, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1080, __pyx_L1_error) + + /* "talib/_stream.pxi":1079 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1081 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1082 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1358, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1082, __pyx_L1_error) + + /* "talib/_stream.pxi":1081 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1083 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1084 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1084, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1083 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1085 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1086 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1087 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1359, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1087, __pyx_L1_error) + + /* "talib/_stream.pxi":1086 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1088 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1089 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1360, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1089, __pyx_L1_error) + + /* "talib/_stream.pxi":1088 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1090 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1091 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1091, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1090 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1092 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1093 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1094 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1361, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1094, __pyx_L1_error) + + /* "talib/_stream.pxi":1093 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1095 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1096 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1362, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1096, __pyx_L1_error) + + /* "talib/_stream.pxi":1095 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1097 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1098 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1098, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1097 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1099 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1100 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1101 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1363, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1101, __pyx_L1_error) + + /* "talib/_stream.pxi":1100 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1102 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1103 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1364, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1103, __pyx_L1_error) + + /* "talib/_stream.pxi":1102 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1104 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1105 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1105, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1104 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1106 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1107 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1108 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1109 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1365, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1109, __pyx_L1_error) + + /* "talib/_stream.pxi":1108 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1110 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1111 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1366, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1111, __pyx_L1_error) + + /* "talib/_stream.pxi":1110 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1112 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1113 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1367, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1113, __pyx_L1_error) + + /* "talib/_stream.pxi":1112 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1114 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1115 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3LINESTRIKE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1116 + * outinteger = 0 + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1117 + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3LINESTRIKE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1057 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1121 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_393stream_CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_392stream_CDL3OUTSIDE[] = " CDL3OUTSIDE(open, high, low, close)\n\n Three Outside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_393stream_CDL3OUTSIDE = {"stream_CDL3OUTSIDE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_393stream_CDL3OUTSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_392stream_CDL3OUTSIDE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_393stream_CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3OUTSIDE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3OUTSIDE", 1, 4, 4, 1); __PYX_ERR(3, 1121, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3OUTSIDE", 1, 4, 4, 2); __PYX_ERR(3, 1121, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3OUTSIDE", 1, 4, 4, 3); __PYX_ERR(3, 1121, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3OUTSIDE") < 0)) __PYX_ERR(3, 1121, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3OUTSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1121, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1121, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_392stream_CDL3OUTSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_392stream_CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3OUTSIDE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1143 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1144 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1368, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1144, __pyx_L1_error) + + /* "talib/_stream.pxi":1143 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1145 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1146 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1369, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1146, __pyx_L1_error) + + /* "talib/_stream.pxi":1145 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1147 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1148 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1148, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1147 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1149 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1150 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1151 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1370, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1151, __pyx_L1_error) + + /* "talib/_stream.pxi":1150 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1152 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1153 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1371, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1153, __pyx_L1_error) + + /* "talib/_stream.pxi":1152 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1154 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1155 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1155, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1154 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1156 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1157 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1158 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1372, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1158, __pyx_L1_error) + + /* "talib/_stream.pxi":1157 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1159 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1160 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1373, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1160, __pyx_L1_error) + + /* "talib/_stream.pxi":1159 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1161 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1162 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1162, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1161 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1163 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1164 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1165 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1374, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1165, __pyx_L1_error) + + /* "talib/_stream.pxi":1164 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1166 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1167 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1375, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1167, __pyx_L1_error) + + /* "talib/_stream.pxi":1166 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1168 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1169 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1169, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1168 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1170 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1171 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1172 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1173 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1376, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1173, __pyx_L1_error) + + /* "talib/_stream.pxi":1172 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1174 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1175 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1377, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1175, __pyx_L1_error) + + /* "talib/_stream.pxi":1174 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1176 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1177 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1378, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1177, __pyx_L1_error) + + /* "talib/_stream.pxi":1176 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1178 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1179 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3OUTSIDE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1180 + * outinteger = 0 + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3OUTSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1181 + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3OUTSIDE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1121 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1185 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_395stream_CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_394stream_CDL3STARSINSOUTH[] = " CDL3STARSINSOUTH(open, high, low, close)\n\n Three Stars In The South (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_395stream_CDL3STARSINSOUTH = {"stream_CDL3STARSINSOUTH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_395stream_CDL3STARSINSOUTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_394stream_CDL3STARSINSOUTH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_395stream_CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3STARSINSOUTH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3STARSINSOUTH", 1, 4, 4, 1); __PYX_ERR(3, 1185, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3STARSINSOUTH", 1, 4, 4, 2); __PYX_ERR(3, 1185, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3STARSINSOUTH", 1, 4, 4, 3); __PYX_ERR(3, 1185, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3STARSINSOUTH") < 0)) __PYX_ERR(3, 1185, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3STARSINSOUTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1185, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1185, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_394stream_CDL3STARSINSOUTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_394stream_CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3STARSINSOUTH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1207 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1208 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1379, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1208, __pyx_L1_error) + + /* "talib/_stream.pxi":1207 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1209 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1210 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1380, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1210, __pyx_L1_error) + + /* "talib/_stream.pxi":1209 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1211 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1212 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1212, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1211 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1213 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1214 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1215 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1381, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1215, __pyx_L1_error) + + /* "talib/_stream.pxi":1214 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1216 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1217 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1382, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1217, __pyx_L1_error) + + /* "talib/_stream.pxi":1216 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1218 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1219 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1219, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1218 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1220 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1221 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1222 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1383, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1222, __pyx_L1_error) + + /* "talib/_stream.pxi":1221 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1223 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1224 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1384, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1224, __pyx_L1_error) + + /* "talib/_stream.pxi":1223 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1225 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1226 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1226, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1225 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1227 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1228 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1229 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1385, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1229, __pyx_L1_error) + + /* "talib/_stream.pxi":1228 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1230 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1231 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1386, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1231, __pyx_L1_error) + + /* "talib/_stream.pxi":1230 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1232 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1233 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1233, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1232 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1234 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1235 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1236 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1237 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1387, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1237, __pyx_L1_error) + + /* "talib/_stream.pxi":1236 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1238 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1239 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1388, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1239, __pyx_L1_error) + + /* "talib/_stream.pxi":1238 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1240 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1241 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1389, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1241, __pyx_L1_error) + + /* "talib/_stream.pxi":1240 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1242 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1243 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3STARSINSOUTH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1244 + * outinteger = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1245 + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1185 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1249 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_397stream_CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_396stream_CDL3WHITESOLDIERS[] = " CDL3WHITESOLDIERS(open, high, low, close)\n\n Three Advancing White Soldiers (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_397stream_CDL3WHITESOLDIERS = {"stream_CDL3WHITESOLDIERS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_397stream_CDL3WHITESOLDIERS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_396stream_CDL3WHITESOLDIERS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_397stream_CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDL3WHITESOLDIERS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3WHITESOLDIERS", 1, 4, 4, 1); __PYX_ERR(3, 1249, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3WHITESOLDIERS", 1, 4, 4, 2); __PYX_ERR(3, 1249, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDL3WHITESOLDIERS", 1, 4, 4, 3); __PYX_ERR(3, 1249, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDL3WHITESOLDIERS") < 0)) __PYX_ERR(3, 1249, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDL3WHITESOLDIERS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1249, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1249, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1249, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1249, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1249, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_396stream_CDL3WHITESOLDIERS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_396stream_CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDL3WHITESOLDIERS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1271 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1272 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1390, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1272, __pyx_L1_error) + + /* "talib/_stream.pxi":1271 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1273 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1274 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1391, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1274, __pyx_L1_error) + + /* "talib/_stream.pxi":1273 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1275 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1276 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1276, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1275 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1277 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1278 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1279 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1392, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1279, __pyx_L1_error) + + /* "talib/_stream.pxi":1278 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1280 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1281 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1393, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1281, __pyx_L1_error) + + /* "talib/_stream.pxi":1280 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1282 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1283 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1283, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1282 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1284 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1285 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1286 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1394, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1286, __pyx_L1_error) + + /* "talib/_stream.pxi":1285 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1287 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1288 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1395, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1288, __pyx_L1_error) + + /* "talib/_stream.pxi":1287 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1289 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1290 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1290, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1289 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1291 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1292 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1293 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1396, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1293, __pyx_L1_error) + + /* "talib/_stream.pxi":1292 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1294 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1295 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1397, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1295, __pyx_L1_error) + + /* "talib/_stream.pxi":1294 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1296 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1297 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1297, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1296 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1298 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1299 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1300 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1301 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1398, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1301, __pyx_L1_error) + + /* "talib/_stream.pxi":1300 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1302 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1303 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1399, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1303, __pyx_L1_error) + + /* "talib/_stream.pxi":1302 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1304 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1305 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1400, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1305, __pyx_L1_error) + + /* "talib/_stream.pxi":1304 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1306 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1307 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDL3WHITESOLDIERS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1308 + * outinteger = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1309 + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1249 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1313 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_399stream_CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_398stream_CDLABANDONEDBABY[] = " CDLABANDONEDBABY(open, high, low, close[, penetration=?])\n\n Abandoned Baby (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_399stream_CDLABANDONEDBABY = {"stream_CDLABANDONEDBABY", (PyCFunction)__pyx_pw_5talib_7_ta_lib_399stream_CDLABANDONEDBABY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_398stream_CDLABANDONEDBABY}; +static PyObject *__pyx_pw_5talib_7_ta_lib_399stream_CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLABANDONEDBABY (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLABANDONEDBABY", 0, 4, 5, 1); __PYX_ERR(3, 1313, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLABANDONEDBABY", 0, 4, 5, 2); __PYX_ERR(3, 1313, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLABANDONEDBABY", 0, 4, 5, 3); __PYX_ERR(3, 1313, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLABANDONEDBABY") < 0)) __PYX_ERR(3, 1313, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 1313, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLABANDONEDBABY", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1313, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_398stream_CDLABANDONEDBABY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_398stream_CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLABANDONEDBABY", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1337 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1338 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1401, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1338, __pyx_L1_error) + + /* "talib/_stream.pxi":1337 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1339 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1340 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1402, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1340, __pyx_L1_error) + + /* "talib/_stream.pxi":1339 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1341 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1342 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1342, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1341 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1343 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1344 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1345 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1403, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1345, __pyx_L1_error) + + /* "talib/_stream.pxi":1344 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1346 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1347 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1404, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1347, __pyx_L1_error) + + /* "talib/_stream.pxi":1346 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1348 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1349 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1349, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1348 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1350 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1351 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1352 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1405, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1352, __pyx_L1_error) + + /* "talib/_stream.pxi":1351 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1353 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1354 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1406, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1354, __pyx_L1_error) + + /* "talib/_stream.pxi":1353 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1355 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1356 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1356, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1355 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1357 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1358 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1359 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1407, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1359, __pyx_L1_error) + + /* "talib/_stream.pxi":1358 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1360 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1361 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1408, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1361, __pyx_L1_error) + + /* "talib/_stream.pxi":1360 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1362 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1363 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1363, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1362 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1364 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1365 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1366 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1367 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1409, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1367, __pyx_L1_error) + + /* "talib/_stream.pxi":1366 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1368 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1369 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1410, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1369, __pyx_L1_error) + + /* "talib/_stream.pxi":1368 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1370 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1371 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1411, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1371, __pyx_L1_error) + + /* "talib/_stream.pxi":1370 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1372 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1373 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLABANDONEDBABY((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1374 + * outinteger = 0 + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1375 + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLABANDONEDBABY", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1313 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1379 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_401stream_CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_400stream_CDLADVANCEBLOCK[] = " CDLADVANCEBLOCK(open, high, low, close)\n\n Advance Block (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_401stream_CDLADVANCEBLOCK = {"stream_CDLADVANCEBLOCK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_401stream_CDLADVANCEBLOCK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_400stream_CDLADVANCEBLOCK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_401stream_CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLADVANCEBLOCK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLADVANCEBLOCK", 1, 4, 4, 1); __PYX_ERR(3, 1379, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLADVANCEBLOCK", 1, 4, 4, 2); __PYX_ERR(3, 1379, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLADVANCEBLOCK", 1, 4, 4, 3); __PYX_ERR(3, 1379, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLADVANCEBLOCK") < 0)) __PYX_ERR(3, 1379, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLADVANCEBLOCK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1379, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1379, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1379, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1379, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1379, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_400stream_CDLADVANCEBLOCK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_400stream_CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLADVANCEBLOCK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1401 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1402 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1412, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1402, __pyx_L1_error) + + /* "talib/_stream.pxi":1401 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1403 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1404 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1413, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1404, __pyx_L1_error) + + /* "talib/_stream.pxi":1403 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1405 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1406 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1406, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1405 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1407 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1408 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1409 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1414, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1409, __pyx_L1_error) + + /* "talib/_stream.pxi":1408 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1410 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1411 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1415, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1411, __pyx_L1_error) + + /* "talib/_stream.pxi":1410 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1412 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1413 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1413, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1412 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1414 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1415 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1416 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1416, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1416, __pyx_L1_error) + + /* "talib/_stream.pxi":1415 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1417 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1418 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1417, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1418, __pyx_L1_error) + + /* "talib/_stream.pxi":1417 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1419 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1420 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1420, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1419 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1421 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1422 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1423 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1418, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1423, __pyx_L1_error) + + /* "talib/_stream.pxi":1422 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1424 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1425 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1419, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1425, __pyx_L1_error) + + /* "talib/_stream.pxi":1424 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1426 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1427 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1427, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1426 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1428 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1429 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1430 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1431 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1420, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1431, __pyx_L1_error) + + /* "talib/_stream.pxi":1430 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1432 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1433 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1421, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1433, __pyx_L1_error) + + /* "talib/_stream.pxi":1432 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1434 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1435 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1422, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1435, __pyx_L1_error) + + /* "talib/_stream.pxi":1434 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1436 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1437 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLADVANCEBLOCK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1438 + * outinteger = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1439 + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1379 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1443 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_403stream_CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_402stream_CDLBELTHOLD[] = " CDLBELTHOLD(open, high, low, close)\n\n Belt-hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_403stream_CDLBELTHOLD = {"stream_CDLBELTHOLD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_403stream_CDLBELTHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_402stream_CDLBELTHOLD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_403stream_CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLBELTHOLD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBELTHOLD", 1, 4, 4, 1); __PYX_ERR(3, 1443, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBELTHOLD", 1, 4, 4, 2); __PYX_ERR(3, 1443, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBELTHOLD", 1, 4, 4, 3); __PYX_ERR(3, 1443, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLBELTHOLD") < 0)) __PYX_ERR(3, 1443, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLBELTHOLD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1443, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1443, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1443, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1443, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1443, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_402stream_CDLBELTHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_402stream_CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLBELTHOLD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1465 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1466 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1423, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1466, __pyx_L1_error) + + /* "talib/_stream.pxi":1465 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1467 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1468 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1424, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1468, __pyx_L1_error) + + /* "talib/_stream.pxi":1467 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1469 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1470 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1470, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1469 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1471 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1472 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1473 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1425, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1473, __pyx_L1_error) + + /* "talib/_stream.pxi":1472 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1474 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1475 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1426, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1475, __pyx_L1_error) + + /* "talib/_stream.pxi":1474 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1476 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1477 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1477, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1476 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1478 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1479 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1480 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1427, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1480, __pyx_L1_error) + + /* "talib/_stream.pxi":1479 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1481 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1482 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1428, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1482, __pyx_L1_error) + + /* "talib/_stream.pxi":1481 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1483 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1484 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1484, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1483 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1485 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1486 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1487 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1429, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1487, __pyx_L1_error) + + /* "talib/_stream.pxi":1486 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1488 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1489 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1430, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1489, __pyx_L1_error) + + /* "talib/_stream.pxi":1488 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1490 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1491 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1491, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1490 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1492 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1493 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1494 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1495 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1431, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1495, __pyx_L1_error) + + /* "talib/_stream.pxi":1494 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1496 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1497 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1432, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1497, __pyx_L1_error) + + /* "talib/_stream.pxi":1496 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1498 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1499 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1433, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1499, __pyx_L1_error) + + /* "talib/_stream.pxi":1498 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1500 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1501 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLBELTHOLD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLBELTHOLD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1502 + * outinteger = 0 + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLBELTHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1503 + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBELTHOLD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1443 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1507 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_405stream_CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_404stream_CDLBREAKAWAY[] = " CDLBREAKAWAY(open, high, low, close)\n\n Breakaway (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_405stream_CDLBREAKAWAY = {"stream_CDLBREAKAWAY", (PyCFunction)__pyx_pw_5talib_7_ta_lib_405stream_CDLBREAKAWAY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_404stream_CDLBREAKAWAY}; +static PyObject *__pyx_pw_5talib_7_ta_lib_405stream_CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLBREAKAWAY (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBREAKAWAY", 1, 4, 4, 1); __PYX_ERR(3, 1507, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBREAKAWAY", 1, 4, 4, 2); __PYX_ERR(3, 1507, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLBREAKAWAY", 1, 4, 4, 3); __PYX_ERR(3, 1507, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLBREAKAWAY") < 0)) __PYX_ERR(3, 1507, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLBREAKAWAY", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1507, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1507, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1507, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1507, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1507, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_404stream_CDLBREAKAWAY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_404stream_CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLBREAKAWAY", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1529 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1530 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1434, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1530, __pyx_L1_error) + + /* "talib/_stream.pxi":1529 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1531 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1532 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1435, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1532, __pyx_L1_error) + + /* "talib/_stream.pxi":1531 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1533 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1534 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1534, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1533 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1535 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1536 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1537 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1436, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1537, __pyx_L1_error) + + /* "talib/_stream.pxi":1536 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1538 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1539 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1437, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1539, __pyx_L1_error) + + /* "talib/_stream.pxi":1538 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1540 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1541 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1541, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1540 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1542 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1543 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1544 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1438, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1544, __pyx_L1_error) + + /* "talib/_stream.pxi":1543 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1545 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1546 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1439, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1546, __pyx_L1_error) + + /* "talib/_stream.pxi":1545 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1547 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1548 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1548, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1547 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1549 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1550 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1551 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1440, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1551, __pyx_L1_error) + + /* "talib/_stream.pxi":1550 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1552 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1553 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1441, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1553, __pyx_L1_error) + + /* "talib/_stream.pxi":1552 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1554 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1555 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1555, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1554 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1556 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1557 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1558 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1559 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1442, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1559, __pyx_L1_error) + + /* "talib/_stream.pxi":1558 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1560 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1561 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1443, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1561, __pyx_L1_error) + + /* "talib/_stream.pxi":1560 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1562 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1563 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1444, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1563, __pyx_L1_error) + + /* "talib/_stream.pxi":1562 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1564 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1565 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLBREAKAWAY((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1566 + * outinteger = 0 + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLBREAKAWAY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1567 + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLBREAKAWAY", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1507 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_407stream_CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_406stream_CDLCLOSINGMARUBOZU[] = " CDLCLOSINGMARUBOZU(open, high, low, close)\n\n Closing Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_407stream_CDLCLOSINGMARUBOZU = {"stream_CDLCLOSINGMARUBOZU", (PyCFunction)__pyx_pw_5talib_7_ta_lib_407stream_CDLCLOSINGMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_406stream_CDLCLOSINGMARUBOZU}; +static PyObject *__pyx_pw_5talib_7_ta_lib_407stream_CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLCLOSINGMARUBOZU (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCLOSINGMARUBOZU", 1, 4, 4, 1); __PYX_ERR(3, 1571, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCLOSINGMARUBOZU", 1, 4, 4, 2); __PYX_ERR(3, 1571, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCLOSINGMARUBOZU", 1, 4, 4, 3); __PYX_ERR(3, 1571, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLCLOSINGMARUBOZU") < 0)) __PYX_ERR(3, 1571, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLCLOSINGMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1571, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1571, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1571, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1571, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1571, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_406stream_CDLCLOSINGMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_406stream_CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLCLOSINGMARUBOZU", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1593 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1594 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1445, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1594, __pyx_L1_error) + + /* "talib/_stream.pxi":1593 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1446, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1596, __pyx_L1_error) + + /* "talib/_stream.pxi":1595 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1598 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1598, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1597 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1599 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1447, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1601, __pyx_L1_error) + + /* "talib/_stream.pxi":1600 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1448, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1603, __pyx_L1_error) + + /* "talib/_stream.pxi":1602 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1605 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1605, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1604 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1606 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1449, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1608, __pyx_L1_error) + + /* "talib/_stream.pxi":1607 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1450, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1610, __pyx_L1_error) + + /* "talib/_stream.pxi":1609 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1612 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1612, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1611 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1613 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1451, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1615, __pyx_L1_error) + + /* "talib/_stream.pxi":1614 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1452, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1617, __pyx_L1_error) + + /* "talib/_stream.pxi":1616 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1619 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1619, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1618 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1620 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1621 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1453, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1623, __pyx_L1_error) + + /* "talib/_stream.pxi":1622 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1454, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1625, __pyx_L1_error) + + /* "talib/_stream.pxi":1624 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1455, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1627, __pyx_L1_error) + + /* "talib/_stream.pxi":1626 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1628 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1629 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCLOSINGMARUBOZU((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1630 + * outinteger = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1631 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1635 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_409stream_CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_408stream_CDLCONCEALBABYSWALL[] = " CDLCONCEALBABYSWALL(open, high, low, close)\n\n Concealing Baby Swallow (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_409stream_CDLCONCEALBABYSWALL = {"stream_CDLCONCEALBABYSWALL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_409stream_CDLCONCEALBABYSWALL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_408stream_CDLCONCEALBABYSWALL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_409stream_CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLCONCEALBABYSWALL (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCONCEALBABYSWALL", 1, 4, 4, 1); __PYX_ERR(3, 1635, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCONCEALBABYSWALL", 1, 4, 4, 2); __PYX_ERR(3, 1635, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCONCEALBABYSWALL", 1, 4, 4, 3); __PYX_ERR(3, 1635, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLCONCEALBABYSWALL") < 0)) __PYX_ERR(3, 1635, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLCONCEALBABYSWALL", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1635, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1635, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1635, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1635, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1635, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_408stream_CDLCONCEALBABYSWALL(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_408stream_CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLCONCEALBABYSWALL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1657 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1658 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1456, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1658, __pyx_L1_error) + + /* "talib/_stream.pxi":1657 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1659 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1660 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1457, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1660, __pyx_L1_error) + + /* "talib/_stream.pxi":1659 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1661 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1662 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1662, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1661 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1663 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1664 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1665 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1458, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1665, __pyx_L1_error) + + /* "talib/_stream.pxi":1664 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1666 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1667 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1459, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1667, __pyx_L1_error) + + /* "talib/_stream.pxi":1666 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1668 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1669 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1669, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1668 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1670 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1671 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1672 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1460, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1672, __pyx_L1_error) + + /* "talib/_stream.pxi":1671 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1673 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1674 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1461, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1674, __pyx_L1_error) + + /* "talib/_stream.pxi":1673 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1675 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1676 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1676, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1675 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1677 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1678 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1679 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1462, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1679, __pyx_L1_error) + + /* "talib/_stream.pxi":1678 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1680 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1681 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1463, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1681, __pyx_L1_error) + + /* "talib/_stream.pxi":1680 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1682 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1683 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1683, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1682 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1684 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1685 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1686 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1687 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1464, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1687, __pyx_L1_error) + + /* "talib/_stream.pxi":1686 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1688 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1689 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1465, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1689, __pyx_L1_error) + + /* "talib/_stream.pxi":1688 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1690 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1691 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1466, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1691, __pyx_L1_error) + + /* "talib/_stream.pxi":1690 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1692 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1693 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCONCEALBABYSWALL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1694 + * outinteger = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1695 + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1635 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1699 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_411stream_CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_410stream_CDLCOUNTERATTACK[] = " CDLCOUNTERATTACK(open, high, low, close)\n\n Counterattack (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_411stream_CDLCOUNTERATTACK = {"stream_CDLCOUNTERATTACK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_411stream_CDLCOUNTERATTACK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_410stream_CDLCOUNTERATTACK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_411stream_CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLCOUNTERATTACK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCOUNTERATTACK", 1, 4, 4, 1); __PYX_ERR(3, 1699, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCOUNTERATTACK", 1, 4, 4, 2); __PYX_ERR(3, 1699, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLCOUNTERATTACK", 1, 4, 4, 3); __PYX_ERR(3, 1699, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLCOUNTERATTACK") < 0)) __PYX_ERR(3, 1699, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLCOUNTERATTACK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1699, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1699, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1699, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1699, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1699, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_410stream_CDLCOUNTERATTACK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_410stream_CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLCOUNTERATTACK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1721 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1722 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1467, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1722, __pyx_L1_error) + + /* "talib/_stream.pxi":1721 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1723 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1724 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1468, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1724, __pyx_L1_error) + + /* "talib/_stream.pxi":1723 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1725 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1726 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1726, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1725 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1727 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1728 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1729 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1469, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1729, __pyx_L1_error) + + /* "talib/_stream.pxi":1728 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1730 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1731 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1470, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1731, __pyx_L1_error) + + /* "talib/_stream.pxi":1730 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1732 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1733 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1733, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1732 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1734 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1735 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1736 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1471, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1736, __pyx_L1_error) + + /* "talib/_stream.pxi":1735 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1737 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1738 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1472, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1738, __pyx_L1_error) + + /* "talib/_stream.pxi":1737 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1739 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1740 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1740, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1739 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1741 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1742 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1743 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1473, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1743, __pyx_L1_error) + + /* "talib/_stream.pxi":1742 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1744 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1745 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1474, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1745, __pyx_L1_error) + + /* "talib/_stream.pxi":1744 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1746 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1747 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1747, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1746 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1748 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1749 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1750 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1751 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1475, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1751, __pyx_L1_error) + + /* "talib/_stream.pxi":1750 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1752 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1753 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1476, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1753, __pyx_L1_error) + + /* "talib/_stream.pxi":1752 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1754 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1755 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1477, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1755, __pyx_L1_error) + + /* "talib/_stream.pxi":1754 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1756 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1757 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLCOUNTERATTACK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1758 + * outinteger = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1759 + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1699 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1763 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_413stream_CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_412stream_CDLDARKCLOUDCOVER[] = " CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?])\n\n Dark Cloud Cover (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_413stream_CDLDARKCLOUDCOVER = {"stream_CDLDARKCLOUDCOVER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_413stream_CDLDARKCLOUDCOVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_412stream_CDLDARKCLOUDCOVER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_413stream_CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLDARKCLOUDCOVER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDARKCLOUDCOVER", 0, 4, 5, 1); __PYX_ERR(3, 1763, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDARKCLOUDCOVER", 0, 4, 5, 2); __PYX_ERR(3, 1763, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDARKCLOUDCOVER", 0, 4, 5, 3); __PYX_ERR(3, 1763, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLDARKCLOUDCOVER") < 0)) __PYX_ERR(3, 1763, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 1763, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.5); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLDARKCLOUDCOVER", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1763, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1763, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1763, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1763, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1763, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_412stream_CDLDARKCLOUDCOVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_412stream_CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLDARKCLOUDCOVER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1787 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1788 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1478, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1788, __pyx_L1_error) + + /* "talib/_stream.pxi":1787 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1789 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1790 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1479, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1790, __pyx_L1_error) + + /* "talib/_stream.pxi":1789 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1791 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1792 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1792, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1792, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1791 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1793 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1794 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1795 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1480, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1795, __pyx_L1_error) + + /* "talib/_stream.pxi":1794 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1796 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1797 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1481, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1797, __pyx_L1_error) + + /* "talib/_stream.pxi":1796 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1798 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1799 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1799, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1798 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1800 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1801 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1802 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1482, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1802, __pyx_L1_error) + + /* "talib/_stream.pxi":1801 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1803 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1804 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1483, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1804, __pyx_L1_error) + + /* "talib/_stream.pxi":1803 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1805 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1806 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1806, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1805 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1807 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1808 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1809 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1484, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1809, __pyx_L1_error) + + /* "talib/_stream.pxi":1808 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1810 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1811 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1485, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1811, __pyx_L1_error) + + /* "talib/_stream.pxi":1810 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1812 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1813 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1813, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1812 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1814 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1815 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1816 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1817 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1486, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1817, __pyx_L1_error) + + /* "talib/_stream.pxi":1816 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1818 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1819 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1487, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1819, __pyx_L1_error) + + /* "talib/_stream.pxi":1818 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1820 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1821 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1488, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1821, __pyx_L1_error) + + /* "talib/_stream.pxi":1820 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1822 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1823 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDARKCLOUDCOVER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1824 + * outinteger = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1825 + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1763 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1829 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_415stream_CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_414stream_CDLDOJI[] = " CDLDOJI(open, high, low, close)\n\n Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_415stream_CDLDOJI = {"stream_CDLDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_415stream_CDLDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_414stream_CDLDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_415stream_CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJI", 1, 4, 4, 1); __PYX_ERR(3, 1829, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJI", 1, 4, 4, 2); __PYX_ERR(3, 1829, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJI", 1, 4, 4, 3); __PYX_ERR(3, 1829, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLDOJI") < 0)) __PYX_ERR(3, 1829, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1829, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1829, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1829, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1829, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1829, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_414stream_CDLDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_414stream_CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1851 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1852 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1489, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1852, __pyx_L1_error) + + /* "talib/_stream.pxi":1851 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1853 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1854 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1490, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1854, __pyx_L1_error) + + /* "talib/_stream.pxi":1853 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1855 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1856 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1856, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1855 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1857 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1858 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1859 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1491, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1859, __pyx_L1_error) + + /* "talib/_stream.pxi":1858 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1860 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1861 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1492, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1861, __pyx_L1_error) + + /* "talib/_stream.pxi":1860 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1862 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1863 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1863, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1862 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1864 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1865 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1866 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1493, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1866, __pyx_L1_error) + + /* "talib/_stream.pxi":1865 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1867 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1868 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1494, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1868, __pyx_L1_error) + + /* "talib/_stream.pxi":1867 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1869 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1870 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1870, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1869 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1871 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1872 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1873 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1495, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1873, __pyx_L1_error) + + /* "talib/_stream.pxi":1872 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1874 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1875 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1496, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1875, __pyx_L1_error) + + /* "talib/_stream.pxi":1874 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1876 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1877 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1877, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1876 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1878 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1879 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1880 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1881 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1497, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1881, __pyx_L1_error) + + /* "talib/_stream.pxi":1880 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1882 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1883 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1498, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1883, __pyx_L1_error) + + /* "talib/_stream.pxi":1882 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1884 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1885 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1499, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1885, __pyx_L1_error) + + /* "talib/_stream.pxi":1884 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1886 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1887 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1888 + * outinteger = 0 + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1889 + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1829 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1893 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_417stream_CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_416stream_CDLDOJISTAR[] = " CDLDOJISTAR(open, high, low, close)\n\n Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_417stream_CDLDOJISTAR = {"stream_CDLDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_417stream_CDLDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_416stream_CDLDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_417stream_CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJISTAR", 1, 4, 4, 1); __PYX_ERR(3, 1893, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJISTAR", 1, 4, 4, 2); __PYX_ERR(3, 1893, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJISTAR", 1, 4, 4, 3); __PYX_ERR(3, 1893, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLDOJISTAR") < 0)) __PYX_ERR(3, 1893, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLDOJISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1893, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1893, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_416stream_CDLDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_416stream_CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1915 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1916 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1500, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1916, __pyx_L1_error) + + /* "talib/_stream.pxi":1915 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1917 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1918 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1501, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1918, __pyx_L1_error) + + /* "talib/_stream.pxi":1917 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1919 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1920 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1920, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1919 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1921 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1922 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1923 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1502, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1923, __pyx_L1_error) + + /* "talib/_stream.pxi":1922 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1924 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1925 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1503, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1925, __pyx_L1_error) + + /* "talib/_stream.pxi":1924 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1926 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1927 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1927, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1926 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1928 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1929 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1930 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1504, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1930, __pyx_L1_error) + + /* "talib/_stream.pxi":1929 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1931 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1932 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1505, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1932, __pyx_L1_error) + + /* "talib/_stream.pxi":1931 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1933 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1934 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1934, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1933 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1935 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":1936 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1937 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1506, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1937, __pyx_L1_error) + + /* "talib/_stream.pxi":1936 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1938 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1939 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1507, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1939, __pyx_L1_error) + + /* "talib/_stream.pxi":1938 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1940 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1941 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1941, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1940 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":1942 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":1943 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":1944 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1945 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1508, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1945, __pyx_L1_error) + + /* "talib/_stream.pxi":1944 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":1946 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1947 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1509, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1947, __pyx_L1_error) + + /* "talib/_stream.pxi":1946 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":1948 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1949 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1510, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1949, __pyx_L1_error) + + /* "talib/_stream.pxi":1948 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":1950 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":1951 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":1952 + * outinteger = 0 + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1953 + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1893 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":1957 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_419stream_CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_418stream_CDLDRAGONFLYDOJI[] = " CDLDRAGONFLYDOJI(open, high, low, close)\n\n Dragonfly Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_419stream_CDLDRAGONFLYDOJI = {"stream_CDLDRAGONFLYDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_419stream_CDLDRAGONFLYDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_418stream_CDLDRAGONFLYDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_419stream_CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLDRAGONFLYDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDRAGONFLYDOJI", 1, 4, 4, 1); __PYX_ERR(3, 1957, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDRAGONFLYDOJI", 1, 4, 4, 2); __PYX_ERR(3, 1957, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLDRAGONFLYDOJI", 1, 4, 4, 3); __PYX_ERR(3, 1957, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLDRAGONFLYDOJI") < 0)) __PYX_ERR(3, 1957, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLDRAGONFLYDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1957, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 1957, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 1957, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 1957, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 1957, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_418stream_CDLDRAGONFLYDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_418stream_CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLDRAGONFLYDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":1979 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1980 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1511, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1980, __pyx_L1_error) + + /* "talib/_stream.pxi":1979 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1981 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1982 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1512, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1982, __pyx_L1_error) + + /* "talib/_stream.pxi":1981 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1983 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1984 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1984, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1983 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":1985 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":1986 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1987 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1513, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1987, __pyx_L1_error) + + /* "talib/_stream.pxi":1986 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1988 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1989 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1514, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1989, __pyx_L1_error) + + /* "talib/_stream.pxi":1988 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1990 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1991 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1991, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1990 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":1992 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":1993 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1994 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1515, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1994, __pyx_L1_error) + + /* "talib/_stream.pxi":1993 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":1995 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1996 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1516, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 1996, __pyx_L1_error) + + /* "talib/_stream.pxi":1995 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":1997 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":1998 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 1998, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":1997 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":1999 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2000 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2001 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1517, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2001, __pyx_L1_error) + + /* "talib/_stream.pxi":2000 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2002 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2003 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1518, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2003, __pyx_L1_error) + + /* "talib/_stream.pxi":2002 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2004 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2005 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2005, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2004 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2006 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2007 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2008 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2009 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1519, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2009, __pyx_L1_error) + + /* "talib/_stream.pxi":2008 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2010 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2011 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1520, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2011, __pyx_L1_error) + + /* "talib/_stream.pxi":2010 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2012 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2013 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1521, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2013, __pyx_L1_error) + + /* "talib/_stream.pxi":2012 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2014 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2015 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLDRAGONFLYDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2016 + * outinteger = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2017 + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":1957 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2021 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_421stream_CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_420stream_CDLENGULFING[] = " CDLENGULFING(open, high, low, close)\n\n Engulfing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_421stream_CDLENGULFING = {"stream_CDLENGULFING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_421stream_CDLENGULFING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_420stream_CDLENGULFING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_421stream_CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLENGULFING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLENGULFING", 1, 4, 4, 1); __PYX_ERR(3, 2021, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLENGULFING", 1, 4, 4, 2); __PYX_ERR(3, 2021, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLENGULFING", 1, 4, 4, 3); __PYX_ERR(3, 2021, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLENGULFING") < 0)) __PYX_ERR(3, 2021, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLENGULFING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2021, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2021, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2021, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2021, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2021, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_420stream_CDLENGULFING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_420stream_CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLENGULFING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2043 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2044 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1522, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2044, __pyx_L1_error) + + /* "talib/_stream.pxi":2043 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2045 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2046 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1523, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2046, __pyx_L1_error) + + /* "talib/_stream.pxi":2045 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2047 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2048 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2048, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2047 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2049 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2050 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2051 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1524, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2051, __pyx_L1_error) + + /* "talib/_stream.pxi":2050 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2052 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2053 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1525, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2053, __pyx_L1_error) + + /* "talib/_stream.pxi":2052 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2054 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2055 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2055, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2055, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2054 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2056 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2057 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2058 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1526, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2058, __pyx_L1_error) + + /* "talib/_stream.pxi":2057 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2059 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2060 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1527, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2060, __pyx_L1_error) + + /* "talib/_stream.pxi":2059 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2061 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2062 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2062, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2062, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2061 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2063 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2064 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2065 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1528, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2065, __pyx_L1_error) + + /* "talib/_stream.pxi":2064 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2066 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2067 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1529, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2067, __pyx_L1_error) + + /* "talib/_stream.pxi":2066 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2068 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2069 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2069, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2068 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2070 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2071 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2072 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2073 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1530, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2073, __pyx_L1_error) + + /* "talib/_stream.pxi":2072 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2074 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2075 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1531, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2075, __pyx_L1_error) + + /* "talib/_stream.pxi":2074 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2076 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2077 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1532, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2077, __pyx_L1_error) + + /* "talib/_stream.pxi":2076 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2078 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLENGULFING", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2079 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLENGULFING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLENGULFING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2080 + * outinteger = 0 + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLENGULFING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLENGULFING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2081 + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLENGULFING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2021 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2085 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_423stream_CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_422stream_CDLEVENINGDOJISTAR[] = " CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Evening Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_423stream_CDLEVENINGDOJISTAR = {"stream_CDLEVENINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_423stream_CDLEVENINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_422stream_CDLEVENINGDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_423stream_CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLEVENINGDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(3, 2085, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(3, 2085, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(3, 2085, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLEVENINGDOJISTAR") < 0)) __PYX_ERR(3, 2085, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 2085, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2085, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2085, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2085, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2085, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2085, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_422stream_CDLEVENINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_422stream_CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLEVENINGDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2109 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2110 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1533, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2110, __pyx_L1_error) + + /* "talib/_stream.pxi":2109 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2111 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2112 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1534, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2112, __pyx_L1_error) + + /* "talib/_stream.pxi":2111 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2113 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2114 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2114, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2113 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2115 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2116 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2117 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1535, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2117, __pyx_L1_error) + + /* "talib/_stream.pxi":2116 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2118 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2119 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1536, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2119, __pyx_L1_error) + + /* "talib/_stream.pxi":2118 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2120 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2121 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2121, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2120 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2122 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2123 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2124 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1537, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2124, __pyx_L1_error) + + /* "talib/_stream.pxi":2123 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2125 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2126 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1538, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2126, __pyx_L1_error) + + /* "talib/_stream.pxi":2125 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2127 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2128 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2128, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2127 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2129 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2130 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2131 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1539, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2131, __pyx_L1_error) + + /* "talib/_stream.pxi":2130 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2132 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2133 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1540, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2133, __pyx_L1_error) + + /* "talib/_stream.pxi":2132 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2134 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2135 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2135, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2134 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2136 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2137 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2138 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2139 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1541, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2139, __pyx_L1_error) + + /* "talib/_stream.pxi":2138 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2140 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2141 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1542, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2141, __pyx_L1_error) + + /* "talib/_stream.pxi":2140 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2142 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2143 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1543, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2143, __pyx_L1_error) + + /* "talib/_stream.pxi":2142 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2144 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2145 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLEVENINGDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2146 + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2147 + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2085 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2151 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_425stream_CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_424stream_CDLEVENINGSTAR[] = " CDLEVENINGSTAR(open, high, low, close[, penetration=?])\n\n Evening Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_425stream_CDLEVENINGSTAR = {"stream_CDLEVENINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_425stream_CDLEVENINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_424stream_CDLEVENINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_425stream_CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLEVENINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGSTAR", 0, 4, 5, 1); __PYX_ERR(3, 2151, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGSTAR", 0, 4, 5, 2); __PYX_ERR(3, 2151, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGSTAR", 0, 4, 5, 3); __PYX_ERR(3, 2151, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLEVENINGSTAR") < 0)) __PYX_ERR(3, 2151, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 2151, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLEVENINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2151, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2151, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2151, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2151, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2151, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_424stream_CDLEVENINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_424stream_CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLEVENINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2175 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2176 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1544, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2176, __pyx_L1_error) + + /* "talib/_stream.pxi":2175 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2177 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2178 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1545, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2178, __pyx_L1_error) + + /* "talib/_stream.pxi":2177 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2179 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2180 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2180, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2179 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2181 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2182 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2183 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1546, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2183, __pyx_L1_error) + + /* "talib/_stream.pxi":2182 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2184 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2185 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1547, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2185, __pyx_L1_error) + + /* "talib/_stream.pxi":2184 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2186 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2187 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2187, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2186 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2188 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2189 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2190 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1548, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2190, __pyx_L1_error) + + /* "talib/_stream.pxi":2189 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2191 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2192 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1549, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2192, __pyx_L1_error) + + /* "talib/_stream.pxi":2191 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2193 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2194 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2194, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2193 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2195 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2196 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2197 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1550, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2197, __pyx_L1_error) + + /* "talib/_stream.pxi":2196 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2198 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2199 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1551, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2199, __pyx_L1_error) + + /* "talib/_stream.pxi":2198 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2200 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2201 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2201, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2200 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2202 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2203 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2204 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2205 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1552, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2205, __pyx_L1_error) + + /* "talib/_stream.pxi":2204 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2206 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2207 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1553, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2207, __pyx_L1_error) + + /* "talib/_stream.pxi":2206 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2208 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2209 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1554, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2209, __pyx_L1_error) + + /* "talib/_stream.pxi":2208 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2210 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2211 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLEVENINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2212 + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2213 + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLEVENINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2151 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2217 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_427stream_CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_426stream_CDLGAPSIDESIDEWHITE[] = " CDLGAPSIDESIDEWHITE(open, high, low, close)\n\n Up/Down-gap side-by-side white lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_427stream_CDLGAPSIDESIDEWHITE = {"stream_CDLGAPSIDESIDEWHITE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_427stream_CDLGAPSIDESIDEWHITE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_426stream_CDLGAPSIDESIDEWHITE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_427stream_CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLGAPSIDESIDEWHITE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGAPSIDESIDEWHITE", 1, 4, 4, 1); __PYX_ERR(3, 2217, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGAPSIDESIDEWHITE", 1, 4, 4, 2); __PYX_ERR(3, 2217, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGAPSIDESIDEWHITE", 1, 4, 4, 3); __PYX_ERR(3, 2217, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLGAPSIDESIDEWHITE") < 0)) __PYX_ERR(3, 2217, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLGAPSIDESIDEWHITE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2217, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2217, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_426stream_CDLGAPSIDESIDEWHITE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_426stream_CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLGAPSIDESIDEWHITE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2239 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2240 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1555, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2240, __pyx_L1_error) + + /* "talib/_stream.pxi":2239 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2241 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2242 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1556, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2242, __pyx_L1_error) + + /* "talib/_stream.pxi":2241 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2243 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2244 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2244, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2243 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2245 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2246 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2247 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1557, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2247, __pyx_L1_error) + + /* "talib/_stream.pxi":2246 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2248 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2249 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1558, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2249, __pyx_L1_error) + + /* "talib/_stream.pxi":2248 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2250 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2251 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2251, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2250 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2252 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2253 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2254 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1559, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2254, __pyx_L1_error) + + /* "talib/_stream.pxi":2253 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2255 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2256 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1560, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2256, __pyx_L1_error) + + /* "talib/_stream.pxi":2255 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2257 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2258 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2258, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2257 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2259 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2260 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2261 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1561, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2261, __pyx_L1_error) + + /* "talib/_stream.pxi":2260 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2262 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2263 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1562, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2263, __pyx_L1_error) + + /* "talib/_stream.pxi":2262 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2264 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2265 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2265, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2264 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2266 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2267 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2268 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2269 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1563, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2269, __pyx_L1_error) + + /* "talib/_stream.pxi":2268 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2270 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2271 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1564, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2271, __pyx_L1_error) + + /* "talib/_stream.pxi":2270 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2272 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2273 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1565, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2273, __pyx_L1_error) + + /* "talib/_stream.pxi":2272 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2274 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2275 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLGAPSIDESIDEWHITE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2276 + * outinteger = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2277 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2217 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2281 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_429stream_CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_428stream_CDLGRAVESTONEDOJI[] = " CDLGRAVESTONEDOJI(open, high, low, close)\n\n Gravestone Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_429stream_CDLGRAVESTONEDOJI = {"stream_CDLGRAVESTONEDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_429stream_CDLGRAVESTONEDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_428stream_CDLGRAVESTONEDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_429stream_CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLGRAVESTONEDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGRAVESTONEDOJI", 1, 4, 4, 1); __PYX_ERR(3, 2281, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGRAVESTONEDOJI", 1, 4, 4, 2); __PYX_ERR(3, 2281, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLGRAVESTONEDOJI", 1, 4, 4, 3); __PYX_ERR(3, 2281, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLGRAVESTONEDOJI") < 0)) __PYX_ERR(3, 2281, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLGRAVESTONEDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2281, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2281, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_428stream_CDLGRAVESTONEDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_428stream_CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLGRAVESTONEDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2303 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2304 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1566, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2304, __pyx_L1_error) + + /* "talib/_stream.pxi":2303 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2305 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2306 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1567, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2306, __pyx_L1_error) + + /* "talib/_stream.pxi":2305 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2307 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2308 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2308, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2307 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2309 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2310 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2311 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1568, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2311, __pyx_L1_error) + + /* "talib/_stream.pxi":2310 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2312 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2313 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1569, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2313, __pyx_L1_error) + + /* "talib/_stream.pxi":2312 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2314 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2315 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2315, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2314 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2316 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2317 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2318 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1570, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2318, __pyx_L1_error) + + /* "talib/_stream.pxi":2317 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2319 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2320 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1571, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2320, __pyx_L1_error) + + /* "talib/_stream.pxi":2319 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2321 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2322 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2322, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2321 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2323 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2324 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2325 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1572, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2325, __pyx_L1_error) + + /* "talib/_stream.pxi":2324 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2326 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2327 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1573, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2327, __pyx_L1_error) + + /* "talib/_stream.pxi":2326 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2328 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2329 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2329, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2328 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2330 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2331 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2332 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2333 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1574, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2333, __pyx_L1_error) + + /* "talib/_stream.pxi":2332 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2334 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2335 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1575, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2335, __pyx_L1_error) + + /* "talib/_stream.pxi":2334 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2336 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2337 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1576, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2337, __pyx_L1_error) + + /* "talib/_stream.pxi":2336 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2338 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2339 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLGRAVESTONEDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2340 + * outinteger = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2341 + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2281 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2345 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_431stream_CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_430stream_CDLHAMMER[] = " CDLHAMMER(open, high, low, close)\n\n Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_431stream_CDLHAMMER = {"stream_CDLHAMMER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_431stream_CDLHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_430stream_CDLHAMMER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_431stream_CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHAMMER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHAMMER", 1, 4, 4, 1); __PYX_ERR(3, 2345, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHAMMER", 1, 4, 4, 2); __PYX_ERR(3, 2345, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHAMMER", 1, 4, 4, 3); __PYX_ERR(3, 2345, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHAMMER") < 0)) __PYX_ERR(3, 2345, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2345, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2345, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_430stream_CDLHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_430stream_CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHAMMER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2367 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2368 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1577, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2368, __pyx_L1_error) + + /* "talib/_stream.pxi":2367 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2369 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2370 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1578, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2370, __pyx_L1_error) + + /* "talib/_stream.pxi":2369 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2371 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2372 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2372, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2371 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2373 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2374 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2375 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1579, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2375, __pyx_L1_error) + + /* "talib/_stream.pxi":2374 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2376 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2377 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1580, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2377, __pyx_L1_error) + + /* "talib/_stream.pxi":2376 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2378 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2379 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2379, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2378 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2380 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2381 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2382 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1581, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2382, __pyx_L1_error) + + /* "talib/_stream.pxi":2381 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2383 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2384 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1582, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2384, __pyx_L1_error) + + /* "talib/_stream.pxi":2383 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2385 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2386 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2386, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2385 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2387 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2388 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2389 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1583, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2389, __pyx_L1_error) + + /* "talib/_stream.pxi":2388 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2390 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2391 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1584, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2391, __pyx_L1_error) + + /* "talib/_stream.pxi":2390 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2392 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2393 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2393, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2392 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2394 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2395 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2396 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2397 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1585, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2397, __pyx_L1_error) + + /* "talib/_stream.pxi":2396 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2398 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2399 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1586, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2399, __pyx_L1_error) + + /* "talib/_stream.pxi":2398 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2400 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2401 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1587, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2401, __pyx_L1_error) + + /* "talib/_stream.pxi":2400 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2402 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHAMMER", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2403 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHAMMER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHAMMER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2404 + * outinteger = 0 + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHAMMER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2405 + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHAMMER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2345 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2409 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_433stream_CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_432stream_CDLHANGINGMAN[] = " CDLHANGINGMAN(open, high, low, close)\n\n Hanging Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_433stream_CDLHANGINGMAN = {"stream_CDLHANGINGMAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_433stream_CDLHANGINGMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_432stream_CDLHANGINGMAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_433stream_CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHANGINGMAN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHANGINGMAN", 1, 4, 4, 1); __PYX_ERR(3, 2409, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHANGINGMAN", 1, 4, 4, 2); __PYX_ERR(3, 2409, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHANGINGMAN", 1, 4, 4, 3); __PYX_ERR(3, 2409, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHANGINGMAN") < 0)) __PYX_ERR(3, 2409, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHANGINGMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2409, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2409, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2409, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2409, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2409, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_432stream_CDLHANGINGMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_432stream_CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHANGINGMAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2431 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2432 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1588, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2432, __pyx_L1_error) + + /* "talib/_stream.pxi":2431 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2433 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2434 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1589, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2434, __pyx_L1_error) + + /* "talib/_stream.pxi":2433 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2435 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2436 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2436, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2435 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2437 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2438 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2439 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1590, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2439, __pyx_L1_error) + + /* "talib/_stream.pxi":2438 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2440 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2441 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1591, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2441, __pyx_L1_error) + + /* "talib/_stream.pxi":2440 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2442 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2443 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2443, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2442 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2444 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2445 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2446 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1592, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2446, __pyx_L1_error) + + /* "talib/_stream.pxi":2445 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2447 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2448 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1593, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2448, __pyx_L1_error) + + /* "talib/_stream.pxi":2447 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2449 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2450 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2450, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2449 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2451 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2452 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2453 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1594, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2453, __pyx_L1_error) + + /* "talib/_stream.pxi":2452 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2454 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2455 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1595, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2455, __pyx_L1_error) + + /* "talib/_stream.pxi":2454 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2456 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2457 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2457, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2456 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2458 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2459 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2460 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2461 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1596, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2461, __pyx_L1_error) + + /* "talib/_stream.pxi":2460 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2462 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2463 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1597, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2463, __pyx_L1_error) + + /* "talib/_stream.pxi":2462 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2464 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2465 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1598, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2465, __pyx_L1_error) + + /* "talib/_stream.pxi":2464 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2466 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2467 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHANGINGMAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2468 + * outinteger = 0 + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHANGINGMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2469 + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHANGINGMAN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2409 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2473 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_435stream_CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_434stream_CDLHARAMI[] = " CDLHARAMI(open, high, low, close)\n\n Harami Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_435stream_CDLHARAMI = {"stream_CDLHARAMI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_435stream_CDLHARAMI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_434stream_CDLHARAMI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_435stream_CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHARAMI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMI", 1, 4, 4, 1); __PYX_ERR(3, 2473, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMI", 1, 4, 4, 2); __PYX_ERR(3, 2473, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMI", 1, 4, 4, 3); __PYX_ERR(3, 2473, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHARAMI") < 0)) __PYX_ERR(3, 2473, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2473, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2473, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2473, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2473, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2473, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_434stream_CDLHARAMI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_434stream_CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHARAMI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2495 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2496 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1599, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2496, __pyx_L1_error) + + /* "talib/_stream.pxi":2495 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2497 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2498 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1600, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2498, __pyx_L1_error) + + /* "talib/_stream.pxi":2497 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2499 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2500 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2500, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2499 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2501 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2502 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2503 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1601, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2503, __pyx_L1_error) + + /* "talib/_stream.pxi":2502 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2504 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2505 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1602, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2505, __pyx_L1_error) + + /* "talib/_stream.pxi":2504 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2506 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2507 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2507, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2506 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2508 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2509 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2510 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1603, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2510, __pyx_L1_error) + + /* "talib/_stream.pxi":2509 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2511 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2512 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1604, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2512, __pyx_L1_error) + + /* "talib/_stream.pxi":2511 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2513 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2514 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2514, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2513 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2515 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2516 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2517 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1605, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2517, __pyx_L1_error) + + /* "talib/_stream.pxi":2516 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2518 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2519 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1606, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2519, __pyx_L1_error) + + /* "talib/_stream.pxi":2518 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2520 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2521 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2521, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2520 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2522 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2523 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2524 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2525 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1607, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2525, __pyx_L1_error) + + /* "talib/_stream.pxi":2524 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2526 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2527 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1608, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2527, __pyx_L1_error) + + /* "talib/_stream.pxi":2526 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2528 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2529 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1609, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2529, __pyx_L1_error) + + /* "talib/_stream.pxi":2528 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2530 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2531 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHARAMI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHARAMI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2532 + * outinteger = 0 + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHARAMI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2533 + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2473 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_437stream_CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_436stream_CDLHARAMICROSS[] = " CDLHARAMICROSS(open, high, low, close)\n\n Harami Cross Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_437stream_CDLHARAMICROSS = {"stream_CDLHARAMICROSS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_437stream_CDLHARAMICROSS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_436stream_CDLHARAMICROSS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_437stream_CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHARAMICROSS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMICROSS", 1, 4, 4, 1); __PYX_ERR(3, 2537, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMICROSS", 1, 4, 4, 2); __PYX_ERR(3, 2537, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMICROSS", 1, 4, 4, 3); __PYX_ERR(3, 2537, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHARAMICROSS") < 0)) __PYX_ERR(3, 2537, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHARAMICROSS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2537, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2537, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2537, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2537, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2537, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_436stream_CDLHARAMICROSS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_436stream_CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHARAMICROSS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2559 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2560 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1610, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2560, __pyx_L1_error) + + /* "talib/_stream.pxi":2559 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2561 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2562 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1611, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2562, __pyx_L1_error) + + /* "talib/_stream.pxi":2561 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2563 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2564 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2564, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2563 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2565 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2566 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2567 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1612, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2567, __pyx_L1_error) + + /* "talib/_stream.pxi":2566 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2568 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2569 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1613, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2569, __pyx_L1_error) + + /* "talib/_stream.pxi":2568 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2570 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2571 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2571, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2570 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2572 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2573 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2574 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1614, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2574, __pyx_L1_error) + + /* "talib/_stream.pxi":2573 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2575 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2576 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1615, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2576, __pyx_L1_error) + + /* "talib/_stream.pxi":2575 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2577 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2578 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2578, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2577 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2579 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2580 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2581 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1616, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2581, __pyx_L1_error) + + /* "talib/_stream.pxi":2580 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2582 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2583 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1617, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2583, __pyx_L1_error) + + /* "talib/_stream.pxi":2582 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2584 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2585 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2585, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2584 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2586 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2587 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2588 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2589 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1618, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2589, __pyx_L1_error) + + /* "talib/_stream.pxi":2588 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2590 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2591 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1619, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2591, __pyx_L1_error) + + /* "talib/_stream.pxi":2590 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2592 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2593 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1620, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2593, __pyx_L1_error) + + /* "talib/_stream.pxi":2592 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2594 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2595 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHARAMICROSS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2596 + * outinteger = 0 + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHARAMICROSS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2597 + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHARAMICROSS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2601 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_439stream_CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_438stream_CDLHIGHWAVE[] = " CDLHIGHWAVE(open, high, low, close)\n\n High-Wave Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_439stream_CDLHIGHWAVE = {"stream_CDLHIGHWAVE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_439stream_CDLHIGHWAVE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_438stream_CDLHIGHWAVE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_439stream_CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHIGHWAVE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIGHWAVE", 1, 4, 4, 1); __PYX_ERR(3, 2601, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIGHWAVE", 1, 4, 4, 2); __PYX_ERR(3, 2601, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIGHWAVE", 1, 4, 4, 3); __PYX_ERR(3, 2601, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHIGHWAVE") < 0)) __PYX_ERR(3, 2601, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHIGHWAVE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2601, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2601, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2601, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2601, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2601, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_438stream_CDLHIGHWAVE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_438stream_CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHIGHWAVE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2623 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2624 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1621, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2624, __pyx_L1_error) + + /* "talib/_stream.pxi":2623 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2625 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2626 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1622, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2626, __pyx_L1_error) + + /* "talib/_stream.pxi":2625 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2627 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2628 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2628, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2627 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2629 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2630 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2631 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1623, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2631, __pyx_L1_error) + + /* "talib/_stream.pxi":2630 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2632 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2633 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1624, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2633, __pyx_L1_error) + + /* "talib/_stream.pxi":2632 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2634 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2635 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2635, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2634 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2636 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2637 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2638 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1625, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2638, __pyx_L1_error) + + /* "talib/_stream.pxi":2637 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2639 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2640 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1626, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2640, __pyx_L1_error) + + /* "talib/_stream.pxi":2639 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2641 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2642 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2642, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2641 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2643 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2644 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2645 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1627, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2645, __pyx_L1_error) + + /* "talib/_stream.pxi":2644 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2646 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2647 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1628, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2647, __pyx_L1_error) + + /* "talib/_stream.pxi":2646 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2648 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2649 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2649, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2648 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2650 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2651 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2652 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2653 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1629, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2653, __pyx_L1_error) + + /* "talib/_stream.pxi":2652 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2654 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2655 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1630, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2655, __pyx_L1_error) + + /* "talib/_stream.pxi":2654 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2656 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2657 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1631, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2657, __pyx_L1_error) + + /* "talib/_stream.pxi":2656 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2658 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2659 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIGHWAVE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2660 + * outinteger = 0 + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIGHWAVE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2661 + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIGHWAVE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2601 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2665 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_441stream_CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_440stream_CDLHIKKAKE[] = " CDLHIKKAKE(open, high, low, close)\n\n Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_441stream_CDLHIKKAKE = {"stream_CDLHIKKAKE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_441stream_CDLHIKKAKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_440stream_CDLHIKKAKE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_441stream_CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHIKKAKE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKE", 1, 4, 4, 1); __PYX_ERR(3, 2665, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKE", 1, 4, 4, 2); __PYX_ERR(3, 2665, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKE", 1, 4, 4, 3); __PYX_ERR(3, 2665, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHIKKAKE") < 0)) __PYX_ERR(3, 2665, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2665, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2665, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2665, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2665, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2665, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_440stream_CDLHIKKAKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_440stream_CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHIKKAKE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2687 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2688 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1632, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2688, __pyx_L1_error) + + /* "talib/_stream.pxi":2687 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2689 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2690 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1633, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2690, __pyx_L1_error) + + /* "talib/_stream.pxi":2689 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2691 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2692 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2692, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2691 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2693 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2694 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2695 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1634, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2695, __pyx_L1_error) + + /* "talib/_stream.pxi":2694 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2696 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2697 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1635, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2697, __pyx_L1_error) + + /* "talib/_stream.pxi":2696 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2698 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2699 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2699, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2698 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2700 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2701 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2702 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1636, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2702, __pyx_L1_error) + + /* "talib/_stream.pxi":2701 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2703 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2704 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1637, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2704, __pyx_L1_error) + + /* "talib/_stream.pxi":2703 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2705 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2706 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2706, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2705 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2707 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2708 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2709 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1638, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2709, __pyx_L1_error) + + /* "talib/_stream.pxi":2708 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2710 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2711 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1639, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2711, __pyx_L1_error) + + /* "talib/_stream.pxi":2710 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2712 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2713 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2713, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2712 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2714 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2715 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2716 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2717 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1640, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2717, __pyx_L1_error) + + /* "talib/_stream.pxi":2716 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2718 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2719 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1641, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2719, __pyx_L1_error) + + /* "talib/_stream.pxi":2718 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2720 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2721 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1642, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2721, __pyx_L1_error) + + /* "talib/_stream.pxi":2720 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2722 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2723 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIKKAKE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIKKAKE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2724 + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIKKAKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2725 + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2665 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2729 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_443stream_CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_442stream_CDLHIKKAKEMOD[] = " CDLHIKKAKEMOD(open, high, low, close)\n\n Modified Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_443stream_CDLHIKKAKEMOD = {"stream_CDLHIKKAKEMOD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_443stream_CDLHIKKAKEMOD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_442stream_CDLHIKKAKEMOD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_443stream_CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHIKKAKEMOD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKEMOD", 1, 4, 4, 1); __PYX_ERR(3, 2729, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKEMOD", 1, 4, 4, 2); __PYX_ERR(3, 2729, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKEMOD", 1, 4, 4, 3); __PYX_ERR(3, 2729, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHIKKAKEMOD") < 0)) __PYX_ERR(3, 2729, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHIKKAKEMOD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2729, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2729, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2729, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2729, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2729, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_442stream_CDLHIKKAKEMOD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_442stream_CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHIKKAKEMOD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2751 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2752 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1643, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2752, __pyx_L1_error) + + /* "talib/_stream.pxi":2751 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2753 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2754 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1644, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2754, __pyx_L1_error) + + /* "talib/_stream.pxi":2753 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2755 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2756 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2756, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2755 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2757 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2758 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2759 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1645, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2759, __pyx_L1_error) + + /* "talib/_stream.pxi":2758 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2760 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2761 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1646, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2761, __pyx_L1_error) + + /* "talib/_stream.pxi":2760 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2762 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2763 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2763, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2762 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2764 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2765 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2766 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1647, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2766, __pyx_L1_error) + + /* "talib/_stream.pxi":2765 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2767 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2768 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1648, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2768, __pyx_L1_error) + + /* "talib/_stream.pxi":2767 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2769 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2770 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2770, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2769 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2771 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2772 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2773 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1649, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2773, __pyx_L1_error) + + /* "talib/_stream.pxi":2772 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2774 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2775 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1650, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2775, __pyx_L1_error) + + /* "talib/_stream.pxi":2774 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2776 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2777 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2777, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2776 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2778 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2779 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2780 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2781 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1651, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2781, __pyx_L1_error) + + /* "talib/_stream.pxi":2780 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2782 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2783 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1652, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2783, __pyx_L1_error) + + /* "talib/_stream.pxi":2782 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2784 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2785 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1653, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2785, __pyx_L1_error) + + /* "talib/_stream.pxi":2784 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2786 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2787 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHIKKAKEMOD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2788 + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2789 + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2729 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2793 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_445stream_CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_444stream_CDLHOMINGPIGEON[] = " CDLHOMINGPIGEON(open, high, low, close)\n\n Homing Pigeon (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_445stream_CDLHOMINGPIGEON = {"stream_CDLHOMINGPIGEON", (PyCFunction)__pyx_pw_5talib_7_ta_lib_445stream_CDLHOMINGPIGEON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_444stream_CDLHOMINGPIGEON}; +static PyObject *__pyx_pw_5talib_7_ta_lib_445stream_CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLHOMINGPIGEON (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHOMINGPIGEON", 1, 4, 4, 1); __PYX_ERR(3, 2793, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHOMINGPIGEON", 1, 4, 4, 2); __PYX_ERR(3, 2793, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLHOMINGPIGEON", 1, 4, 4, 3); __PYX_ERR(3, 2793, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLHOMINGPIGEON") < 0)) __PYX_ERR(3, 2793, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLHOMINGPIGEON", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2793, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2793, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2793, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2793, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2793, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_444stream_CDLHOMINGPIGEON(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_444stream_CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLHOMINGPIGEON", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2815 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2816 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1654, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2816, __pyx_L1_error) + + /* "talib/_stream.pxi":2815 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2817 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2818 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1655, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2818, __pyx_L1_error) + + /* "talib/_stream.pxi":2817 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2819 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2820 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2820, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2819 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2821 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2822 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2823 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1656, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2823, __pyx_L1_error) + + /* "talib/_stream.pxi":2822 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2824 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2825 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1657, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2825, __pyx_L1_error) + + /* "talib/_stream.pxi":2824 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2826 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2827 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2827, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2826 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2828 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2829 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2830 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1658, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2830, __pyx_L1_error) + + /* "talib/_stream.pxi":2829 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2831 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2832 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1659, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2832, __pyx_L1_error) + + /* "talib/_stream.pxi":2831 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2833 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2834 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2834, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2833 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2835 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2836 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2837 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1660, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2837, __pyx_L1_error) + + /* "talib/_stream.pxi":2836 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2838 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2839 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1661, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2839, __pyx_L1_error) + + /* "talib/_stream.pxi":2838 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2840 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2841 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2841, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2840 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2842 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2843 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2844 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2845 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1662, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2845, __pyx_L1_error) + + /* "talib/_stream.pxi":2844 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2846 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2847 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1663, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2847, __pyx_L1_error) + + /* "talib/_stream.pxi":2846 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2848 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2849 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1664, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2849, __pyx_L1_error) + + /* "talib/_stream.pxi":2848 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2850 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2851 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLHOMINGPIGEON((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2852 + * outinteger = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2853 + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2793 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2857 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_447stream_CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_446stream_CDLIDENTICAL3CROWS[] = " CDLIDENTICAL3CROWS(open, high, low, close)\n\n Identical Three Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_447stream_CDLIDENTICAL3CROWS = {"stream_CDLIDENTICAL3CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_447stream_CDLIDENTICAL3CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_446stream_CDLIDENTICAL3CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_447stream_CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLIDENTICAL3CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLIDENTICAL3CROWS", 1, 4, 4, 1); __PYX_ERR(3, 2857, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLIDENTICAL3CROWS", 1, 4, 4, 2); __PYX_ERR(3, 2857, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLIDENTICAL3CROWS", 1, 4, 4, 3); __PYX_ERR(3, 2857, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLIDENTICAL3CROWS") < 0)) __PYX_ERR(3, 2857, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLIDENTICAL3CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2857, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2857, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2857, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2857, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2857, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_446stream_CDLIDENTICAL3CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_446stream_CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLIDENTICAL3CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2879 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2880 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1665, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2880, __pyx_L1_error) + + /* "talib/_stream.pxi":2879 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2881 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2882 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1666, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2882, __pyx_L1_error) + + /* "talib/_stream.pxi":2881 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2883 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2884 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2884, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2883 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2885 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2886 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2887 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1667, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2887, __pyx_L1_error) + + /* "talib/_stream.pxi":2886 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2888 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2889 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1668, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2889, __pyx_L1_error) + + /* "talib/_stream.pxi":2888 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2890 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2891 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2891, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2890 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2892 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2893 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2894 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1669, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2894, __pyx_L1_error) + + /* "talib/_stream.pxi":2893 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2895 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2896 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1670, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2896, __pyx_L1_error) + + /* "talib/_stream.pxi":2895 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2897 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2898 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2898, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2897 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2899 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2900 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2901 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1671, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2901, __pyx_L1_error) + + /* "talib/_stream.pxi":2900 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2902 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2903 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1672, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2903, __pyx_L1_error) + + /* "talib/_stream.pxi":2902 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2904 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2905 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2905, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2905, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2904 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2906 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2907 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2908 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2909 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1673, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2909, __pyx_L1_error) + + /* "talib/_stream.pxi":2908 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2910 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2911 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1674, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2911, __pyx_L1_error) + + /* "talib/_stream.pxi":2910 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2912 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2913 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1675, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2913, __pyx_L1_error) + + /* "talib/_stream.pxi":2912 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2914 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2915 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLIDENTICAL3CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2916 + * outinteger = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2917 + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2857 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2921 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_449stream_CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_448stream_CDLINNECK[] = " CDLINNECK(open, high, low, close)\n\n In-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_449stream_CDLINNECK = {"stream_CDLINNECK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_449stream_CDLINNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_448stream_CDLINNECK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_449stream_CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLINNECK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINNECK", 1, 4, 4, 1); __PYX_ERR(3, 2921, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINNECK", 1, 4, 4, 2); __PYX_ERR(3, 2921, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINNECK", 1, 4, 4, 3); __PYX_ERR(3, 2921, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLINNECK") < 0)) __PYX_ERR(3, 2921, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLINNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2921, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2921, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2921, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2921, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2921, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_448stream_CDLINNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_448stream_CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLINNECK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":2943 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2944 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1676, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2944, __pyx_L1_error) + + /* "talib/_stream.pxi":2943 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2945 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2946 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1677, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2946, __pyx_L1_error) + + /* "talib/_stream.pxi":2945 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2947 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2948 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2948, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2947 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":2949 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":2950 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2951 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1678, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2951, __pyx_L1_error) + + /* "talib/_stream.pxi":2950 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2952 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2953 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1679, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2953, __pyx_L1_error) + + /* "talib/_stream.pxi":2952 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2954 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2955 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2955, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2954 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":2956 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":2957 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2958 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1680, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2958, __pyx_L1_error) + + /* "talib/_stream.pxi":2957 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2959 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2960 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1681, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2960, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2960, __pyx_L1_error) + + /* "talib/_stream.pxi":2959 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2961 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2962 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2962, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2961 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":2963 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":2964 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2965 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1682, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2965, __pyx_L1_error) + + /* "talib/_stream.pxi":2964 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":2966 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2967 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1683, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2967, __pyx_L1_error) + + /* "talib/_stream.pxi":2966 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":2968 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2969 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 2969, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2968 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":2970 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":2971 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":2972 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2973 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1684, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2973, __pyx_L1_error) + + /* "talib/_stream.pxi":2972 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":2974 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2975 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1685, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2975, __pyx_L1_error) + + /* "talib/_stream.pxi":2974 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":2976 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":2977 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1686, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 2977, __pyx_L1_error) + + /* "talib/_stream.pxi":2976 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":2978 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINNECK", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":2979 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLINNECK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLINNECK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":2980 + * outinteger = 0 + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINNECK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLINNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":2981 + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINNECK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2921 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":2985 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_451stream_CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_450stream_CDLINVERTEDHAMMER[] = " CDLINVERTEDHAMMER(open, high, low, close)\n\n Inverted Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_451stream_CDLINVERTEDHAMMER = {"stream_CDLINVERTEDHAMMER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_451stream_CDLINVERTEDHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_450stream_CDLINVERTEDHAMMER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_451stream_CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLINVERTEDHAMMER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINVERTEDHAMMER", 1, 4, 4, 1); __PYX_ERR(3, 2985, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINVERTEDHAMMER", 1, 4, 4, 2); __PYX_ERR(3, 2985, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLINVERTEDHAMMER", 1, 4, 4, 3); __PYX_ERR(3, 2985, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLINVERTEDHAMMER") < 0)) __PYX_ERR(3, 2985, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLINVERTEDHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2985, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 2985, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 2985, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 2985, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 2985, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_450stream_CDLINVERTEDHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_450stream_CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLINVERTEDHAMMER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3007 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3008 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1687, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3008, __pyx_L1_error) + + /* "talib/_stream.pxi":3007 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3009 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3010 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1688, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3010, __pyx_L1_error) + + /* "talib/_stream.pxi":3009 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3011 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3012 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3012, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3011 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3013 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3014 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3015 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1689, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3015, __pyx_L1_error) + + /* "talib/_stream.pxi":3014 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3016 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3017 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1690, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3017, __pyx_L1_error) + + /* "talib/_stream.pxi":3016 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3018 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3019 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3019, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3018 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3020 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3021 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3022 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1691, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3022, __pyx_L1_error) + + /* "talib/_stream.pxi":3021 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3023 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3024 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1692, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3024, __pyx_L1_error) + + /* "talib/_stream.pxi":3023 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3025 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3026 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3026, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3025 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3027 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3028 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3029 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1693, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3029, __pyx_L1_error) + + /* "talib/_stream.pxi":3028 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3030 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3031 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1694, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3031, __pyx_L1_error) + + /* "talib/_stream.pxi":3030 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3032 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3033 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3033, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3032 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3034 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3035 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3036 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3037 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1695, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3037, __pyx_L1_error) + + /* "talib/_stream.pxi":3036 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3038 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3039 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1696, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3039, __pyx_L1_error) + + /* "talib/_stream.pxi":3038 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3040 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3041 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1697, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3041, __pyx_L1_error) + + /* "talib/_stream.pxi":3040 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3042 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3043 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLINVERTEDHAMMER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3044 + * outinteger = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3045 + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":2985 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_453stream_CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_452stream_CDLKICKING[] = " CDLKICKING(open, high, low, close)\n\n Kicking (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_453stream_CDLKICKING = {"stream_CDLKICKING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_453stream_CDLKICKING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_452stream_CDLKICKING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_453stream_CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLKICKING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKING", 1, 4, 4, 1); __PYX_ERR(3, 3049, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKING", 1, 4, 4, 2); __PYX_ERR(3, 3049, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKING", 1, 4, 4, 3); __PYX_ERR(3, 3049, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLKICKING") < 0)) __PYX_ERR(3, 3049, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3049, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3049, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_452stream_CDLKICKING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_452stream_CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLKICKING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3071 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3072 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1698, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3072, __pyx_L1_error) + + /* "talib/_stream.pxi":3071 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3073 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3074 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1699, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3074, __pyx_L1_error) + + /* "talib/_stream.pxi":3073 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3075 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3076 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3076, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3075 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3077 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3078 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3079 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1700, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3079, __pyx_L1_error) + + /* "talib/_stream.pxi":3078 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3080 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3081 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1701, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3081, __pyx_L1_error) + + /* "talib/_stream.pxi":3080 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3082 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3083 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3083, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3082 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3084 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3085 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3086 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1702, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3086, __pyx_L1_error) + + /* "talib/_stream.pxi":3085 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3087 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3088 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1703, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3088, __pyx_L1_error) + + /* "talib/_stream.pxi":3087 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3089 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3090 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3090, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3089 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3091 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3092 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3093 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1704, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3093, __pyx_L1_error) + + /* "talib/_stream.pxi":3092 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3094 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3095 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1705, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3095, __pyx_L1_error) + + /* "talib/_stream.pxi":3094 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3096 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3097 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3097, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3096 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3098 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3099 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3100 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3101 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1706, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3101, __pyx_L1_error) + + /* "talib/_stream.pxi":3100 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3102 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3103 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1707, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3103, __pyx_L1_error) + + /* "talib/_stream.pxi":3102 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3104 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3105 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1708, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3105, __pyx_L1_error) + + /* "talib/_stream.pxi":3104 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3106 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKING", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3107 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLKICKING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLKICKING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3108 + * outinteger = 0 + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLKICKING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3109 + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3113 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_455stream_CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_454stream_CDLKICKINGBYLENGTH[] = " CDLKICKINGBYLENGTH(open, high, low, close)\n\n Kicking - bull/bear determined by the longer marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_455stream_CDLKICKINGBYLENGTH = {"stream_CDLKICKINGBYLENGTH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_455stream_CDLKICKINGBYLENGTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_454stream_CDLKICKINGBYLENGTH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_455stream_CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLKICKINGBYLENGTH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKINGBYLENGTH", 1, 4, 4, 1); __PYX_ERR(3, 3113, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKINGBYLENGTH", 1, 4, 4, 2); __PYX_ERR(3, 3113, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKINGBYLENGTH", 1, 4, 4, 3); __PYX_ERR(3, 3113, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLKICKINGBYLENGTH") < 0)) __PYX_ERR(3, 3113, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLKICKINGBYLENGTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3113, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3113, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_454stream_CDLKICKINGBYLENGTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_454stream_CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLKICKINGBYLENGTH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3135 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3136 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1709, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3136, __pyx_L1_error) + + /* "talib/_stream.pxi":3135 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3137 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3138 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1710, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3138, __pyx_L1_error) + + /* "talib/_stream.pxi":3137 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3139 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3140 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3140, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3139 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3141 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3142 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3143 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1711, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3143, __pyx_L1_error) + + /* "talib/_stream.pxi":3142 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3144 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3145 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1712, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3145, __pyx_L1_error) + + /* "talib/_stream.pxi":3144 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3146 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3147 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3147, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3146 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3148 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3149 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3150 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1713, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3150, __pyx_L1_error) + + /* "talib/_stream.pxi":3149 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3151 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3152 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1714, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3152, __pyx_L1_error) + + /* "talib/_stream.pxi":3151 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3153 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3154 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3154, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3153 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3155 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3156 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3157 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1715, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3157, __pyx_L1_error) + + /* "talib/_stream.pxi":3156 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3158 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3159 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1716, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3159, __pyx_L1_error) + + /* "talib/_stream.pxi":3158 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3160 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3161 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3161, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3160 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3162 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3163 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3164 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3165 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1717, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3165, __pyx_L1_error) + + /* "talib/_stream.pxi":3164 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3166 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3167 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1718, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3167, __pyx_L1_error) + + /* "talib/_stream.pxi":3166 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3168 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3169 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1719, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3169, __pyx_L1_error) + + /* "talib/_stream.pxi":3168 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3170 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3171 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLKICKINGBYLENGTH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3172 + * outinteger = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3173 + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3113 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_457stream_CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_456stream_CDLLADDERBOTTOM[] = " CDLLADDERBOTTOM(open, high, low, close)\n\n Ladder Bottom (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_457stream_CDLLADDERBOTTOM = {"stream_CDLLADDERBOTTOM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_457stream_CDLLADDERBOTTOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_456stream_CDLLADDERBOTTOM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_457stream_CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLLADDERBOTTOM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLADDERBOTTOM", 1, 4, 4, 1); __PYX_ERR(3, 3177, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLADDERBOTTOM", 1, 4, 4, 2); __PYX_ERR(3, 3177, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLADDERBOTTOM", 1, 4, 4, 3); __PYX_ERR(3, 3177, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLLADDERBOTTOM") < 0)) __PYX_ERR(3, 3177, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLLADDERBOTTOM", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3177, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_456stream_CDLLADDERBOTTOM(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_456stream_CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLLADDERBOTTOM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3199 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3200 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1720, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3200, __pyx_L1_error) + + /* "talib/_stream.pxi":3199 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3201 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3202 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1721, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3202, __pyx_L1_error) + + /* "talib/_stream.pxi":3201 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3203 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3204 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3204, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3203 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3205 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3206 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3207 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1722, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3207, __pyx_L1_error) + + /* "talib/_stream.pxi":3206 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3208 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3209 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1723, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3209, __pyx_L1_error) + + /* "talib/_stream.pxi":3208 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3210 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3211 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3211, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3210 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3212 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3213 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3214 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1724, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3214, __pyx_L1_error) + + /* "talib/_stream.pxi":3213 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3215 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3216 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1725, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3216, __pyx_L1_error) + + /* "talib/_stream.pxi":3215 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3217 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3218 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3218, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3217 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3219 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3220 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3221 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1726, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3221, __pyx_L1_error) + + /* "talib/_stream.pxi":3220 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3222 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3223 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1727, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3223, __pyx_L1_error) + + /* "talib/_stream.pxi":3222 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3224 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3225 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3225, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3224 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3226 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3227 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3228 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3229 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1728, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3229, __pyx_L1_error) + + /* "talib/_stream.pxi":3228 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3230 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3231 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1729, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3231, __pyx_L1_error) + + /* "talib/_stream.pxi":3230 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3232 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3233 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1730, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3233, __pyx_L1_error) + + /* "talib/_stream.pxi":3232 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3234 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3235 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLADDERBOTTOM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3236 + * outinteger = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3237 + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3241 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_459stream_CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_458stream_CDLLONGLEGGEDDOJI[] = " CDLLONGLEGGEDDOJI(open, high, low, close)\n\n Long Legged Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_459stream_CDLLONGLEGGEDDOJI = {"stream_CDLLONGLEGGEDDOJI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_459stream_CDLLONGLEGGEDDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_458stream_CDLLONGLEGGEDDOJI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_459stream_CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLLONGLEGGEDDOJI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLEGGEDDOJI", 1, 4, 4, 1); __PYX_ERR(3, 3241, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLEGGEDDOJI", 1, 4, 4, 2); __PYX_ERR(3, 3241, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLEGGEDDOJI", 1, 4, 4, 3); __PYX_ERR(3, 3241, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLLONGLEGGEDDOJI") < 0)) __PYX_ERR(3, 3241, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLEGGEDDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3241, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3241, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3241, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3241, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3241, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_458stream_CDLLONGLEGGEDDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_458stream_CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLLONGLEGGEDDOJI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3263 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3264 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1731, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3264, __pyx_L1_error) + + /* "talib/_stream.pxi":3263 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3265 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3266 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1732, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3266, __pyx_L1_error) + + /* "talib/_stream.pxi":3265 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3267 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3268 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3268, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3267 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3269 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3270 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3271 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1733, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3271, __pyx_L1_error) + + /* "talib/_stream.pxi":3270 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3272 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3273 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1734, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3273, __pyx_L1_error) + + /* "talib/_stream.pxi":3272 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3274 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3275 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3275, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3274 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3276 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3277 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3278 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1735, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3278, __pyx_L1_error) + + /* "talib/_stream.pxi":3277 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3279 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3280 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1736, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3280, __pyx_L1_error) + + /* "talib/_stream.pxi":3279 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3281 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3282 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3282, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3281 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3283 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3284 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3285 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1737, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3285, __pyx_L1_error) + + /* "talib/_stream.pxi":3284 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3286 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3287 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1738, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3287, __pyx_L1_error) + + /* "talib/_stream.pxi":3286 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3288 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3289 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3289, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3288 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3290 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3291 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3292 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3293 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1739, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3293, __pyx_L1_error) + + /* "talib/_stream.pxi":3292 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3294 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3295 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1740, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3295, __pyx_L1_error) + + /* "talib/_stream.pxi":3294 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3296 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3297 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1741, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3297, __pyx_L1_error) + + /* "talib/_stream.pxi":3296 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3298 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3299 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLONGLEGGEDDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3300 + * outinteger = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3301 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3241 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3305 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_461stream_CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_460stream_CDLLONGLINE[] = " CDLLONGLINE(open, high, low, close)\n\n Long Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_461stream_CDLLONGLINE = {"stream_CDLLONGLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_461stream_CDLLONGLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_460stream_CDLLONGLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_461stream_CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLLONGLINE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLINE", 1, 4, 4, 1); __PYX_ERR(3, 3305, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLINE", 1, 4, 4, 2); __PYX_ERR(3, 3305, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLINE", 1, 4, 4, 3); __PYX_ERR(3, 3305, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLLONGLINE") < 0)) __PYX_ERR(3, 3305, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLLONGLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3305, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3305, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3305, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3305, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3305, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_460stream_CDLLONGLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_460stream_CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLLONGLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3327 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3328 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1742, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3328, __pyx_L1_error) + + /* "talib/_stream.pxi":3327 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3329 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3330 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1743, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3330, __pyx_L1_error) + + /* "talib/_stream.pxi":3329 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3331 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3332 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3332, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3331 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3333 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3334 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3335 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1744, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3335, __pyx_L1_error) + + /* "talib/_stream.pxi":3334 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3336 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3337 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1745, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3337, __pyx_L1_error) + + /* "talib/_stream.pxi":3336 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3338 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3339 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3339, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3338 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3340 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3341 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3342 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1746, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3342, __pyx_L1_error) + + /* "talib/_stream.pxi":3341 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3343 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3344 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1747, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3344, __pyx_L1_error) + + /* "talib/_stream.pxi":3343 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3345 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3346 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3346, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3345 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3347 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3348 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3349 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1748, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3349, __pyx_L1_error) + + /* "talib/_stream.pxi":3348 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3350 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3351 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1749, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3351, __pyx_L1_error) + + /* "talib/_stream.pxi":3350 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3352 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3353 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3353, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3352 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3354 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3355 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3356 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3357 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1750, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3357, __pyx_L1_error) + + /* "talib/_stream.pxi":3356 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3358 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3359 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1751, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3359, __pyx_L1_error) + + /* "talib/_stream.pxi":3358 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3360 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3361 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1752, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3361, __pyx_L1_error) + + /* "talib/_stream.pxi":3360 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3362 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLINE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3363 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLLONGLINE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLLONGLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3364 + * outinteger = 0 + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLINE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLLONGLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3365 + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLLONGLINE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3305 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3369 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_463stream_CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_462stream_CDLMARUBOZU[] = " CDLMARUBOZU(open, high, low, close)\n\n Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_463stream_CDLMARUBOZU = {"stream_CDLMARUBOZU", (PyCFunction)__pyx_pw_5talib_7_ta_lib_463stream_CDLMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_462stream_CDLMARUBOZU}; +static PyObject *__pyx_pw_5talib_7_ta_lib_463stream_CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLMARUBOZU (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMARUBOZU", 1, 4, 4, 1); __PYX_ERR(3, 3369, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMARUBOZU", 1, 4, 4, 2); __PYX_ERR(3, 3369, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMARUBOZU", 1, 4, 4, 3); __PYX_ERR(3, 3369, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLMARUBOZU") < 0)) __PYX_ERR(3, 3369, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3369, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3369, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3369, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3369, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3369, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_462stream_CDLMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_462stream_CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLMARUBOZU", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3391 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3392 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1753, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3392, __pyx_L1_error) + + /* "talib/_stream.pxi":3391 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3393 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3394 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1754, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3394, __pyx_L1_error) + + /* "talib/_stream.pxi":3393 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3395 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3396 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3396, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3395 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3397 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3398 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3399 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1755, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3399, __pyx_L1_error) + + /* "talib/_stream.pxi":3398 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3400 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3401 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1756, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3401, __pyx_L1_error) + + /* "talib/_stream.pxi":3400 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3402 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3403 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3403, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3402 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3404 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3405 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3406 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1757, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3406, __pyx_L1_error) + + /* "talib/_stream.pxi":3405 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3407 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3408 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1758, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3408, __pyx_L1_error) + + /* "talib/_stream.pxi":3407 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3409 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3410 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3410, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3409 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3411 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3412 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3413 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1759, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3413, __pyx_L1_error) + + /* "talib/_stream.pxi":3412 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3414 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3415 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1760, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3415, __pyx_L1_error) + + /* "talib/_stream.pxi":3414 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3416 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3417 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3417, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3416 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3418 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3419 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3420 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3421 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1761, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3421, __pyx_L1_error) + + /* "talib/_stream.pxi":3420 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3422 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3423 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1762, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3423, __pyx_L1_error) + + /* "talib/_stream.pxi":3422 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3424 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3425 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1763, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3425, __pyx_L1_error) + + /* "talib/_stream.pxi":3424 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3426 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3427 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMARUBOZU", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMARUBOZU((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3428 + * outinteger = 0 + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3429 + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMARUBOZU", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3369 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3433 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_465stream_CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_464stream_CDLMATCHINGLOW[] = " CDLMATCHINGLOW(open, high, low, close)\n\n Matching Low (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_465stream_CDLMATCHINGLOW = {"stream_CDLMATCHINGLOW", (PyCFunction)__pyx_pw_5talib_7_ta_lib_465stream_CDLMATCHINGLOW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_464stream_CDLMATCHINGLOW}; +static PyObject *__pyx_pw_5talib_7_ta_lib_465stream_CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLMATCHINGLOW (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATCHINGLOW", 1, 4, 4, 1); __PYX_ERR(3, 3433, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATCHINGLOW", 1, 4, 4, 2); __PYX_ERR(3, 3433, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATCHINGLOW", 1, 4, 4, 3); __PYX_ERR(3, 3433, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLMATCHINGLOW") < 0)) __PYX_ERR(3, 3433, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLMATCHINGLOW", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3433, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3433, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3433, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3433, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3433, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_464stream_CDLMATCHINGLOW(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_464stream_CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLMATCHINGLOW", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3455 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3456 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1764, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3456, __pyx_L1_error) + + /* "talib/_stream.pxi":3455 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3457 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3458 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1765, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3458, __pyx_L1_error) + + /* "talib/_stream.pxi":3457 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3459 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3460 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3460, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3459 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3461 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3462 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3463 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1766, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3463, __pyx_L1_error) + + /* "talib/_stream.pxi":3462 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3464 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3465 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1767, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3465, __pyx_L1_error) + + /* "talib/_stream.pxi":3464 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3466 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3467 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3467, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3466 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3468 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3469 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3470 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1768, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3470, __pyx_L1_error) + + /* "talib/_stream.pxi":3469 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3471 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3472 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1769, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3472, __pyx_L1_error) + + /* "talib/_stream.pxi":3471 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3473 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3474 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3474, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3474, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3473 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3475 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3476 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3477 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1770, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3477, __pyx_L1_error) + + /* "talib/_stream.pxi":3476 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3478 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3479 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1771, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3479, __pyx_L1_error) + + /* "talib/_stream.pxi":3478 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3480 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3481 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3481, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3480 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3482 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3483 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3484 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3485 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1772, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3485, __pyx_L1_error) + + /* "talib/_stream.pxi":3484 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3486 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3487 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1773, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3487, __pyx_L1_error) + + /* "talib/_stream.pxi":3486 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3488 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3489 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1774, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3489, __pyx_L1_error) + + /* "talib/_stream.pxi":3488 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3490 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3491 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMATCHINGLOW((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3492 + * outinteger = 0 + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3493 + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATCHINGLOW", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3433 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3497 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_467stream_CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_466stream_CDLMATHOLD[] = " CDLMATHOLD(open, high, low, close[, penetration=?])\n\n Mat Hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_467stream_CDLMATHOLD = {"stream_CDLMATHOLD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_467stream_CDLMATHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_466stream_CDLMATHOLD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_467stream_CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLMATHOLD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATHOLD", 0, 4, 5, 1); __PYX_ERR(3, 3497, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATHOLD", 0, 4, 5, 2); __PYX_ERR(3, 3497, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMATHOLD", 0, 4, 5, 3); __PYX_ERR(3, 3497, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLMATHOLD") < 0)) __PYX_ERR(3, 3497, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 3497, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.5); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLMATHOLD", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3497, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3497, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3497, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3497, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3497, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_466stream_CDLMATHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_466stream_CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLMATHOLD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3521 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3522 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1775, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3522, __pyx_L1_error) + + /* "talib/_stream.pxi":3521 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3523 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3524 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1776, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3524, __pyx_L1_error) + + /* "talib/_stream.pxi":3523 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3525 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3526 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3526, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3525 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3527 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3528 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3529 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1777, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3529, __pyx_L1_error) + + /* "talib/_stream.pxi":3528 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3530 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3531 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1778, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3531, __pyx_L1_error) + + /* "talib/_stream.pxi":3530 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3532 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3533 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3533, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3532 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3534 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3535 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3536 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1779, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3536, __pyx_L1_error) + + /* "talib/_stream.pxi":3535 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3537 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3538 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1780, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3538, __pyx_L1_error) + + /* "talib/_stream.pxi":3537 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3539 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3540 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3540, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3539 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3541 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3542 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3543 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1781, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3543, __pyx_L1_error) + + /* "talib/_stream.pxi":3542 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3544 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3545 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1782, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3545, __pyx_L1_error) + + /* "talib/_stream.pxi":3544 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3546 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3547 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3547, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3546 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3548 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3549 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3550 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3551 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1783, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3551, __pyx_L1_error) + + /* "talib/_stream.pxi":3550 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3552 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3553 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1784, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3553, __pyx_L1_error) + + /* "talib/_stream.pxi":3552 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3554 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3555 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1785, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3555, __pyx_L1_error) + + /* "talib/_stream.pxi":3554 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3556 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATHOLD", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3557 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMATHOLD", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMATHOLD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3558 + * outinteger = 0 + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATHOLD", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMATHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3559 + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMATHOLD", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3497 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_469stream_CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_468stream_CDLMORNINGDOJISTAR[] = " CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Morning Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_469stream_CDLMORNINGDOJISTAR = {"stream_CDLMORNINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_469stream_CDLMORNINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_468stream_CDLMORNINGDOJISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_469stream_CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLMORNINGDOJISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(3, 3563, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(3, 3563, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(3, 3563, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLMORNINGDOJISTAR") < 0)) __PYX_ERR(3, 3563, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 3563, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3563, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3563, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3563, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3563, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3563, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_468stream_CDLMORNINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_468stream_CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLMORNINGDOJISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3587 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3588 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1786, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3588, __pyx_L1_error) + + /* "talib/_stream.pxi":3587 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3589 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3590 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1787, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3590, __pyx_L1_error) + + /* "talib/_stream.pxi":3589 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3591 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3592 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3592, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3591 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3593 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3594 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3595 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1788, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3595, __pyx_L1_error) + + /* "talib/_stream.pxi":3594 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3596 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3597 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1789, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3597, __pyx_L1_error) + + /* "talib/_stream.pxi":3596 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3598 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3599 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3599, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3598 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3600 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3601 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3602 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1790, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3602, __pyx_L1_error) + + /* "talib/_stream.pxi":3601 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3603 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3604 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1791, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3604, __pyx_L1_error) + + /* "talib/_stream.pxi":3603 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3605 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3606 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3606, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3605 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3607 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3608 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3609 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1792, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3609, __pyx_L1_error) + + /* "talib/_stream.pxi":3608 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3610 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3611 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1793, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3611, __pyx_L1_error) + + /* "talib/_stream.pxi":3610 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3612 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3613 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3613, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3612 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3614 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3615 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3616 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3617 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1794, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3617, __pyx_L1_error) + + /* "talib/_stream.pxi":3616 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3618 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3619 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1795, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3619, __pyx_L1_error) + + /* "talib/_stream.pxi":3618 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3620 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3621 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1796, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3621, __pyx_L1_error) + + /* "talib/_stream.pxi":3620 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3622 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3623 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMORNINGDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3624 + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3625 + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3629 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_471stream_CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_470stream_CDLMORNINGSTAR[] = " CDLMORNINGSTAR(open, high, low, close[, penetration=?])\n\n Morning Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_471stream_CDLMORNINGSTAR = {"stream_CDLMORNINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_471stream_CDLMORNINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_470stream_CDLMORNINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_471stream_CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + double __pyx_v_penetration; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLMORNINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGSTAR", 0, 4, 5, 1); __PYX_ERR(3, 3629, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGSTAR", 0, 4, 5, 2); __PYX_ERR(3, 3629, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGSTAR", 0, 4, 5, 3); __PYX_ERR(3, 3629, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLMORNINGSTAR") < 0)) __PYX_ERR(3, 3629, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 3629, __pyx_L3_error) + } else { + __pyx_v_penetration = ((double)0.3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLMORNINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3629, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3629, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3629, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3629, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3629, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_470stream_CDLMORNINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_470stream_CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLMORNINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3653 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3654 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1797, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3654, __pyx_L1_error) + + /* "talib/_stream.pxi":3653 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3655 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3656 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1798, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3656, __pyx_L1_error) + + /* "talib/_stream.pxi":3655 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3657 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3658 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3658, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3657 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3659 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3660 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3661 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1799, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3661, __pyx_L1_error) + + /* "talib/_stream.pxi":3660 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3662 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3663 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1800, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3663, __pyx_L1_error) + + /* "talib/_stream.pxi":3662 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3664 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3665 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3665, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3664 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3666 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3667 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3668 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1801, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3668, __pyx_L1_error) + + /* "talib/_stream.pxi":3667 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3669 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3670 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1802, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3670, __pyx_L1_error) + + /* "talib/_stream.pxi":3669 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3671 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3672 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3672, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3671 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3673 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3674 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3675 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1803, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3675, __pyx_L1_error) + + /* "talib/_stream.pxi":3674 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3676 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3677 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1804, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3677, __pyx_L1_error) + + /* "talib/_stream.pxi":3676 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3678 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3679 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3679, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3678 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3680 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3681 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3682 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3683 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1805, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3683, __pyx_L1_error) + + /* "talib/_stream.pxi":3682 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3684 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3685 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1806, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3685, __pyx_L1_error) + + /* "talib/_stream.pxi":3684 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3686 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3687 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1807, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3687, __pyx_L1_error) + + /* "talib/_stream.pxi":3686 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3688 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3689 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLMORNINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3690 + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3691 + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLMORNINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3629 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3695 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_473stream_CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_472stream_CDLONNECK[] = " CDLONNECK(open, high, low, close)\n\n On-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_473stream_CDLONNECK = {"stream_CDLONNECK", (PyCFunction)__pyx_pw_5talib_7_ta_lib_473stream_CDLONNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_472stream_CDLONNECK}; +static PyObject *__pyx_pw_5talib_7_ta_lib_473stream_CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLONNECK (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLONNECK", 1, 4, 4, 1); __PYX_ERR(3, 3695, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLONNECK", 1, 4, 4, 2); __PYX_ERR(3, 3695, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLONNECK", 1, 4, 4, 3); __PYX_ERR(3, 3695, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLONNECK") < 0)) __PYX_ERR(3, 3695, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLONNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3695, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3695, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3695, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3695, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3695, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_472stream_CDLONNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_472stream_CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLONNECK", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3717 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3718 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1808, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3718, __pyx_L1_error) + + /* "talib/_stream.pxi":3717 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3719 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3720 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1809, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3720, __pyx_L1_error) + + /* "talib/_stream.pxi":3719 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3721 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3722 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3722, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3721 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3723 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3724 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3725 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1810, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3725, __pyx_L1_error) + + /* "talib/_stream.pxi":3724 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3726 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3727 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1811, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3727, __pyx_L1_error) + + /* "talib/_stream.pxi":3726 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3728 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3729 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3729, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3728 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3730 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3731 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3732 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1812, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3732, __pyx_L1_error) + + /* "talib/_stream.pxi":3731 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3733 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3734 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1813, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3734, __pyx_L1_error) + + /* "talib/_stream.pxi":3733 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3735 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3736 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3736, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3735 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3737 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3738 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3739 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1814, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3739, __pyx_L1_error) + + /* "talib/_stream.pxi":3738 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3740 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3741 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1815, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3741, __pyx_L1_error) + + /* "talib/_stream.pxi":3740 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3742 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3743 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3743, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3742 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3744 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3745 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3746 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3747 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1816, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3747, __pyx_L1_error) + + /* "talib/_stream.pxi":3746 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3748 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3749 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1817, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3749, __pyx_L1_error) + + /* "talib/_stream.pxi":3748 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3750 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3751 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1818, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3751, __pyx_L1_error) + + /* "talib/_stream.pxi":3750 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3752 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLONNECK", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3753 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLONNECK", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLONNECK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3754 + * outinteger = 0 + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLONNECK", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLONNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3755 + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLONNECK", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3695 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3759 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_475stream_CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_474stream_CDLPIERCING[] = " CDLPIERCING(open, high, low, close)\n\n Piercing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_475stream_CDLPIERCING = {"stream_CDLPIERCING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_475stream_CDLPIERCING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_474stream_CDLPIERCING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_475stream_CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLPIERCING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLPIERCING", 1, 4, 4, 1); __PYX_ERR(3, 3759, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLPIERCING", 1, 4, 4, 2); __PYX_ERR(3, 3759, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLPIERCING", 1, 4, 4, 3); __PYX_ERR(3, 3759, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLPIERCING") < 0)) __PYX_ERR(3, 3759, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLPIERCING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3759, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3759, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3759, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3759, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3759, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_474stream_CDLPIERCING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_474stream_CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLPIERCING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3781 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3782 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1819, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3782, __pyx_L1_error) + + /* "talib/_stream.pxi":3781 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3783 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3784 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1820, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3784, __pyx_L1_error) + + /* "talib/_stream.pxi":3783 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3785 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3786 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3786, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3785 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3787 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3788 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3789 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1821, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3789, __pyx_L1_error) + + /* "talib/_stream.pxi":3788 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3790 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3791 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1822, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3791, __pyx_L1_error) + + /* "talib/_stream.pxi":3790 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3792 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3793 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3793, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3792 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3794 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3795 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3796 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1823, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3796, __pyx_L1_error) + + /* "talib/_stream.pxi":3795 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3797 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3798 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1824, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3798, __pyx_L1_error) + + /* "talib/_stream.pxi":3797 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3799 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3800 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3800, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3799 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3801 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3802 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3803 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1825, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3803, __pyx_L1_error) + + /* "talib/_stream.pxi":3802 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3804 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3805 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1826, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3805, __pyx_L1_error) + + /* "talib/_stream.pxi":3804 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3806 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3807 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3807, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3806 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3808 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3809 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3810 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3811 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1827, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3811, __pyx_L1_error) + + /* "talib/_stream.pxi":3810 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3812 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3813 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1828, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3813, __pyx_L1_error) + + /* "talib/_stream.pxi":3812 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3814 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3815 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1829, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3815, __pyx_L1_error) + + /* "talib/_stream.pxi":3814 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3816 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLPIERCING", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3817 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLPIERCING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLPIERCING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3818 + * outinteger = 0 + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLPIERCING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLPIERCING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3819 + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLPIERCING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3759 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_477stream_CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_476stream_CDLRICKSHAWMAN[] = " CDLRICKSHAWMAN(open, high, low, close)\n\n Rickshaw Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_477stream_CDLRICKSHAWMAN = {"stream_CDLRICKSHAWMAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_477stream_CDLRICKSHAWMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_476stream_CDLRICKSHAWMAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_477stream_CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLRICKSHAWMAN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRICKSHAWMAN", 1, 4, 4, 1); __PYX_ERR(3, 3823, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRICKSHAWMAN", 1, 4, 4, 2); __PYX_ERR(3, 3823, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRICKSHAWMAN", 1, 4, 4, 3); __PYX_ERR(3, 3823, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLRICKSHAWMAN") < 0)) __PYX_ERR(3, 3823, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLRICKSHAWMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3823, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3823, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3823, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3823, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3823, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_476stream_CDLRICKSHAWMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_476stream_CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLRICKSHAWMAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3845 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3846 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1830, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3846, __pyx_L1_error) + + /* "talib/_stream.pxi":3845 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3847 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3848 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1831, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3848, __pyx_L1_error) + + /* "talib/_stream.pxi":3847 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3849 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3850 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3850, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3849 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3851 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3852 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3853 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1832, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3853, __pyx_L1_error) + + /* "talib/_stream.pxi":3852 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3854 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3855 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1833, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3855, __pyx_L1_error) + + /* "talib/_stream.pxi":3854 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3856 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3857 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3857, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3856 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3858 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3859 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3860 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1834, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3860, __pyx_L1_error) + + /* "talib/_stream.pxi":3859 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3861 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3862 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1835, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3862, __pyx_L1_error) + + /* "talib/_stream.pxi":3861 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3863 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3864 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3864, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3863 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3865 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3866 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3867 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1836, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3867, __pyx_L1_error) + + /* "talib/_stream.pxi":3866 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3868 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3869 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1837, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3869, __pyx_L1_error) + + /* "talib/_stream.pxi":3868 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3870 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3871 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3871, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3870 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3872 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3873 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3874 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3875 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1838, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3875, __pyx_L1_error) + + /* "talib/_stream.pxi":3874 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3876 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3877 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1839, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3877, __pyx_L1_error) + + /* "talib/_stream.pxi":3876 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3878 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3879 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1840, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3879, __pyx_L1_error) + + /* "talib/_stream.pxi":3878 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3880 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3881 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLRICKSHAWMAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3882 + * outinteger = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3883 + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3887 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_479stream_CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_478stream_CDLRISEFALL3METHODS[] = " CDLRISEFALL3METHODS(open, high, low, close)\n\n Rising/Falling Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_479stream_CDLRISEFALL3METHODS = {"stream_CDLRISEFALL3METHODS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_479stream_CDLRISEFALL3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_478stream_CDLRISEFALL3METHODS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_479stream_CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLRISEFALL3METHODS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRISEFALL3METHODS", 1, 4, 4, 1); __PYX_ERR(3, 3887, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRISEFALL3METHODS", 1, 4, 4, 2); __PYX_ERR(3, 3887, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLRISEFALL3METHODS", 1, 4, 4, 3); __PYX_ERR(3, 3887, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLRISEFALL3METHODS") < 0)) __PYX_ERR(3, 3887, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLRISEFALL3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3887, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3887, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3887, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3887, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3887, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_478stream_CDLRISEFALL3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_478stream_CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLRISEFALL3METHODS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3909 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3910 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1841, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3910, __pyx_L1_error) + + /* "talib/_stream.pxi":3909 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3911 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3912 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1842, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3912, __pyx_L1_error) + + /* "talib/_stream.pxi":3911 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3913 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3914 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3914, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3913 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3915 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3916 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3917 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1843, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3917, __pyx_L1_error) + + /* "talib/_stream.pxi":3916 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3918 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3919 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1844, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3919, __pyx_L1_error) + + /* "talib/_stream.pxi":3918 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3920 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3921 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3921, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3920 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3922 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3923 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3924 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1845, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3924, __pyx_L1_error) + + /* "talib/_stream.pxi":3923 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3925 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3926 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1846, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3926, __pyx_L1_error) + + /* "talib/_stream.pxi":3925 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3927 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3928 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3928, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3927 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3929 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3930 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3931 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1847, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3931, __pyx_L1_error) + + /* "talib/_stream.pxi":3930 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3932 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3933 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1848, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3933, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3933, __pyx_L1_error) + + /* "talib/_stream.pxi":3932 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3934 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3935 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3935, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3935, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3934 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":3936 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":3937 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":3938 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3939 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1849, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3939, __pyx_L1_error) + + /* "talib/_stream.pxi":3938 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":3940 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3941 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1850, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3941, __pyx_L1_error) + + /* "talib/_stream.pxi":3940 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":3942 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3943 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1851, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3943, __pyx_L1_error) + + /* "talib/_stream.pxi":3942 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":3944 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":3945 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLRISEFALL3METHODS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":3946 + * outinteger = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3947 + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3887 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":3951 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_481stream_CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_480stream_CDLSEPARATINGLINES[] = " CDLSEPARATINGLINES(open, high, low, close)\n\n Separating Lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_481stream_CDLSEPARATINGLINES = {"stream_CDLSEPARATINGLINES", (PyCFunction)__pyx_pw_5talib_7_ta_lib_481stream_CDLSEPARATINGLINES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_480stream_CDLSEPARATINGLINES}; +static PyObject *__pyx_pw_5talib_7_ta_lib_481stream_CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSEPARATINGLINES (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSEPARATINGLINES", 1, 4, 4, 1); __PYX_ERR(3, 3951, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSEPARATINGLINES", 1, 4, 4, 2); __PYX_ERR(3, 3951, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSEPARATINGLINES", 1, 4, 4, 3); __PYX_ERR(3, 3951, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSEPARATINGLINES") < 0)) __PYX_ERR(3, 3951, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSEPARATINGLINES", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3951, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 3951, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 3951, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 3951, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 3951, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_480stream_CDLSEPARATINGLINES(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_480stream_CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSEPARATINGLINES", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":3973 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3974 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1852, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3974, __pyx_L1_error) + + /* "talib/_stream.pxi":3973 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3975 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3976 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1853, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3976, __pyx_L1_error) + + /* "talib/_stream.pxi":3975 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3977 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3978 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3978, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3977 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":3979 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":3980 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3981 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1854, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3981, __pyx_L1_error) + + /* "talib/_stream.pxi":3980 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3982 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3983 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1855, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3983, __pyx_L1_error) + + /* "talib/_stream.pxi":3982 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3984 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3985 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3985, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3984 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":3986 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":3987 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3988 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1856, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3988, __pyx_L1_error) + + /* "talib/_stream.pxi":3987 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3989 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3990 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1857, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3990, __pyx_L1_error) + + /* "talib/_stream.pxi":3989 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3991 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3992 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3992, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3991 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":3993 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":3994 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3995 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1858, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3995, __pyx_L1_error) + + /* "talib/_stream.pxi":3994 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":3996 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3997 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1859, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 3997, __pyx_L1_error) + + /* "talib/_stream.pxi":3996 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":3998 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":3999 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 3999, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":3998 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4000 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4001 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4002 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4003 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1860, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4003, __pyx_L1_error) + + /* "talib/_stream.pxi":4002 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4004 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4005 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1861, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4005, __pyx_L1_error) + + /* "talib/_stream.pxi":4004 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4006 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4007 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1862, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4007, __pyx_L1_error) + + /* "talib/_stream.pxi":4006 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4008 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4009 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSEPARATINGLINES((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4010 + * outinteger = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4011 + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":3951 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4015 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_483stream_CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_482stream_CDLSHOOTINGSTAR[] = " CDLSHOOTINGSTAR(open, high, low, close)\n\n Shooting Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_483stream_CDLSHOOTINGSTAR = {"stream_CDLSHOOTINGSTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_483stream_CDLSHOOTINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_482stream_CDLSHOOTINGSTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_483stream_CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSHOOTINGSTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHOOTINGSTAR", 1, 4, 4, 1); __PYX_ERR(3, 4015, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHOOTINGSTAR", 1, 4, 4, 2); __PYX_ERR(3, 4015, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHOOTINGSTAR", 1, 4, 4, 3); __PYX_ERR(3, 4015, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSHOOTINGSTAR") < 0)) __PYX_ERR(3, 4015, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSHOOTINGSTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4015, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4015, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4015, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4015, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4015, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_482stream_CDLSHOOTINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_482stream_CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSHOOTINGSTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4037 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4038 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1863, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4038, __pyx_L1_error) + + /* "talib/_stream.pxi":4037 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4039 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4040 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1864, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4040, __pyx_L1_error) + + /* "talib/_stream.pxi":4039 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4041 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4042 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4042, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4041 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4043 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4044 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4045 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1865, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4045, __pyx_L1_error) + + /* "talib/_stream.pxi":4044 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4046 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4047 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1866, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4047, __pyx_L1_error) + + /* "talib/_stream.pxi":4046 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4048 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4049 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4049, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4048 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4050 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4051 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4052 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1867, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4052, __pyx_L1_error) + + /* "talib/_stream.pxi":4051 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4053 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4054 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1868, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4054, __pyx_L1_error) + + /* "talib/_stream.pxi":4053 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4055 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4056 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4056, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4055 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4057 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4058 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4059 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1869, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4059, __pyx_L1_error) + + /* "talib/_stream.pxi":4058 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4060 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4061 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1870, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4061, __pyx_L1_error) + + /* "talib/_stream.pxi":4060 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4062 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4063 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4063, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4062 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4064 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4065 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4066 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4067 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1871, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4067, __pyx_L1_error) + + /* "talib/_stream.pxi":4066 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4068 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4069 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1872, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4069, __pyx_L1_error) + + /* "talib/_stream.pxi":4068 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4070 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4071 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1873, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4071, __pyx_L1_error) + + /* "talib/_stream.pxi":4070 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4072 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4073 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSHOOTINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4074 + * outinteger = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4075 + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4015 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4079 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_485stream_CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_484stream_CDLSHORTLINE[] = " CDLSHORTLINE(open, high, low, close)\n\n Short Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_485stream_CDLSHORTLINE = {"stream_CDLSHORTLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_485stream_CDLSHORTLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_484stream_CDLSHORTLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_485stream_CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSHORTLINE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHORTLINE", 1, 4, 4, 1); __PYX_ERR(3, 4079, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHORTLINE", 1, 4, 4, 2); __PYX_ERR(3, 4079, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSHORTLINE", 1, 4, 4, 3); __PYX_ERR(3, 4079, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSHORTLINE") < 0)) __PYX_ERR(3, 4079, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSHORTLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4079, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4079, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4079, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4079, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4079, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_484stream_CDLSHORTLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_484stream_CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSHORTLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4101 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4102 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1874, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4102, __pyx_L1_error) + + /* "talib/_stream.pxi":4101 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4103 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4104 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1875, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4104, __pyx_L1_error) + + /* "talib/_stream.pxi":4103 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4105 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4106 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4106, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4105 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4107 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4108 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4109 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1876, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4109, __pyx_L1_error) + + /* "talib/_stream.pxi":4108 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4110 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4111 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1877, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4111, __pyx_L1_error) + + /* "talib/_stream.pxi":4110 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4112 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4113 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4113, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4112 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4114 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4115 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4116 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1878, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4116, __pyx_L1_error) + + /* "talib/_stream.pxi":4115 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4117 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4118 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1879, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4118, __pyx_L1_error) + + /* "talib/_stream.pxi":4117 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4119 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4120 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4120, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4119 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4121 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4122 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4123 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1880, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4123, __pyx_L1_error) + + /* "talib/_stream.pxi":4122 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4124 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4125 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1881, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4125, __pyx_L1_error) + + /* "talib/_stream.pxi":4124 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4126 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4127 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4127, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4126 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4128 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4129 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4130 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4131 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1882, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4131, __pyx_L1_error) + + /* "talib/_stream.pxi":4130 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4132 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4133 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1883, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4133, __pyx_L1_error) + + /* "talib/_stream.pxi":4132 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4134 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4135 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1884, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4135, __pyx_L1_error) + + /* "talib/_stream.pxi":4134 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4136 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4137 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSHORTLINE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSHORTLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4138 + * outinteger = 0 + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSHORTLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4139 + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSHORTLINE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4079 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4143 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_487stream_CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_486stream_CDLSPINNINGTOP[] = " CDLSPINNINGTOP(open, high, low, close)\n\n Spinning Top (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_487stream_CDLSPINNINGTOP = {"stream_CDLSPINNINGTOP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_487stream_CDLSPINNINGTOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_486stream_CDLSPINNINGTOP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_487stream_CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSPINNINGTOP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSPINNINGTOP", 1, 4, 4, 1); __PYX_ERR(3, 4143, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSPINNINGTOP", 1, 4, 4, 2); __PYX_ERR(3, 4143, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSPINNINGTOP", 1, 4, 4, 3); __PYX_ERR(3, 4143, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSPINNINGTOP") < 0)) __PYX_ERR(3, 4143, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSPINNINGTOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4143, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4143, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4143, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4143, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4143, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_486stream_CDLSPINNINGTOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_486stream_CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSPINNINGTOP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4165 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4166 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1885, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4166, __pyx_L1_error) + + /* "talib/_stream.pxi":4165 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4167 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4168 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1886, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4168, __pyx_L1_error) + + /* "talib/_stream.pxi":4167 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4169 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4170 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4170, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4169 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4171 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4172 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4173 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1887, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4173, __pyx_L1_error) + + /* "talib/_stream.pxi":4172 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4174 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4175 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1888, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4175, __pyx_L1_error) + + /* "talib/_stream.pxi":4174 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4176 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4177 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4177, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4176 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4178 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4179 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4180 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1889, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4180, __pyx_L1_error) + + /* "talib/_stream.pxi":4179 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4181 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4182 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1890, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4182, __pyx_L1_error) + + /* "talib/_stream.pxi":4181 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4183 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4184 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4184, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4183 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4185 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4186 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4187 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1891, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4187, __pyx_L1_error) + + /* "talib/_stream.pxi":4186 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4188 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4189 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1892, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4189, __pyx_L1_error) + + /* "talib/_stream.pxi":4188 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4190 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4191 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4191, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4190 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4192 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4193 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4194 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4195 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1893, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4195, __pyx_L1_error) + + /* "talib/_stream.pxi":4194 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4196 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4197 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1894, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4197, __pyx_L1_error) + + /* "talib/_stream.pxi":4196 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4198 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4199 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1895, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4199, __pyx_L1_error) + + /* "talib/_stream.pxi":4198 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4200 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4201 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSPINNINGTOP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4202 + * outinteger = 0 + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4203 + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSPINNINGTOP", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4143 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4207 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_489stream_CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_488stream_CDLSTALLEDPATTERN[] = " CDLSTALLEDPATTERN(open, high, low, close)\n\n Stalled Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_489stream_CDLSTALLEDPATTERN = {"stream_CDLSTALLEDPATTERN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_489stream_CDLSTALLEDPATTERN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_488stream_CDLSTALLEDPATTERN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_489stream_CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSTALLEDPATTERN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTALLEDPATTERN", 1, 4, 4, 1); __PYX_ERR(3, 4207, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTALLEDPATTERN", 1, 4, 4, 2); __PYX_ERR(3, 4207, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTALLEDPATTERN", 1, 4, 4, 3); __PYX_ERR(3, 4207, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSTALLEDPATTERN") < 0)) __PYX_ERR(3, 4207, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSTALLEDPATTERN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4207, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4207, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_488stream_CDLSTALLEDPATTERN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_488stream_CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSTALLEDPATTERN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4229 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4230 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1896, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4230, __pyx_L1_error) + + /* "talib/_stream.pxi":4229 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4231 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4232 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1897, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4232, __pyx_L1_error) + + /* "talib/_stream.pxi":4231 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4233 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4234 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4234, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4233 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4235 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4236 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4237 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1898, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4237, __pyx_L1_error) + + /* "talib/_stream.pxi":4236 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4238 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4239 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1899, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4239, __pyx_L1_error) + + /* "talib/_stream.pxi":4238 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4240 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4241 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4241, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4240 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4242 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4243 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4244 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1900, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4244, __pyx_L1_error) + + /* "talib/_stream.pxi":4243 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4245 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4246 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1901, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4246, __pyx_L1_error) + + /* "talib/_stream.pxi":4245 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4247 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4248 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4248, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4247 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4249 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4250 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4251 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1902, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4251, __pyx_L1_error) + + /* "talib/_stream.pxi":4250 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4252 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4253 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1903, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4253, __pyx_L1_error) + + /* "talib/_stream.pxi":4252 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4254 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4255 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4255, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4254 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4256 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4257 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4258 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4259 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1904, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4259, __pyx_L1_error) + + /* "talib/_stream.pxi":4258 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4260 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4261 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1905, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4261, __pyx_L1_error) + + /* "talib/_stream.pxi":4260 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4262 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4263 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1906, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4263, __pyx_L1_error) + + /* "talib/_stream.pxi":4262 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4264 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4265 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSTALLEDPATTERN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4266 + * outinteger = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4267 + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4207 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4271 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_491stream_CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_490stream_CDLSTICKSANDWICH[] = " CDLSTICKSANDWICH(open, high, low, close)\n\n Stick Sandwich (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_491stream_CDLSTICKSANDWICH = {"stream_CDLSTICKSANDWICH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_491stream_CDLSTICKSANDWICH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_490stream_CDLSTICKSANDWICH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_491stream_CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLSTICKSANDWICH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTICKSANDWICH", 1, 4, 4, 1); __PYX_ERR(3, 4271, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTICKSANDWICH", 1, 4, 4, 2); __PYX_ERR(3, 4271, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLSTICKSANDWICH", 1, 4, 4, 3); __PYX_ERR(3, 4271, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLSTICKSANDWICH") < 0)) __PYX_ERR(3, 4271, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLSTICKSANDWICH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4271, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4271, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4271, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4271, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4271, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_490stream_CDLSTICKSANDWICH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_490stream_CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLSTICKSANDWICH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4293 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4294 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1907, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4294, __pyx_L1_error) + + /* "talib/_stream.pxi":4293 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4295 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4296 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1908, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4296, __pyx_L1_error) + + /* "talib/_stream.pxi":4295 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4297 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4298 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4298, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4297 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4299 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4300 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4301 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1909, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4301, __pyx_L1_error) + + /* "talib/_stream.pxi":4300 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4302 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4303 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1910, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4303, __pyx_L1_error) + + /* "talib/_stream.pxi":4302 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4304 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4305 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4305, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4304 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4306 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4307 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4308 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1911, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4308, __pyx_L1_error) + + /* "talib/_stream.pxi":4307 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4309 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4310 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1912, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4310, __pyx_L1_error) + + /* "talib/_stream.pxi":4309 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4311 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4312 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4312, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4311 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4313 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4314 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4315 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1913, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4315, __pyx_L1_error) + + /* "talib/_stream.pxi":4314 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4316 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4317 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1914, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4317, __pyx_L1_error) + + /* "talib/_stream.pxi":4316 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4318 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4319 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4319, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4318 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4320 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4321 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4322 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4323 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1915, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4323, __pyx_L1_error) + + /* "talib/_stream.pxi":4322 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4324 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4325 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1916, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4325, __pyx_L1_error) + + /* "talib/_stream.pxi":4324 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4326 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4327 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1917, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4327, __pyx_L1_error) + + /* "talib/_stream.pxi":4326 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4328 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4329 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLSTICKSANDWICH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4330 + * outinteger = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4331 + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4271 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4335 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_493stream_CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_492stream_CDLTAKURI[] = " CDLTAKURI(open, high, low, close)\n\n Takuri (Dragonfly Doji with very long lower shadow) (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_493stream_CDLTAKURI = {"stream_CDLTAKURI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_493stream_CDLTAKURI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_492stream_CDLTAKURI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_493stream_CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLTAKURI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTAKURI", 1, 4, 4, 1); __PYX_ERR(3, 4335, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTAKURI", 1, 4, 4, 2); __PYX_ERR(3, 4335, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTAKURI", 1, 4, 4, 3); __PYX_ERR(3, 4335, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLTAKURI") < 0)) __PYX_ERR(3, 4335, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLTAKURI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4335, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4335, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_492stream_CDLTAKURI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_492stream_CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLTAKURI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4357 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4358 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1918, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4358, __pyx_L1_error) + + /* "talib/_stream.pxi":4357 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4359 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4360 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1919, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4360, __pyx_L1_error) + + /* "talib/_stream.pxi":4359 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4361 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4362 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4362, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4361 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4363 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4364 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4365 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1920, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4365, __pyx_L1_error) + + /* "talib/_stream.pxi":4364 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4366 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4367 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1921, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4367, __pyx_L1_error) + + /* "talib/_stream.pxi":4366 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4368 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4369 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4369, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4368 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4370 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4371 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4372 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1922, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4372, __pyx_L1_error) + + /* "talib/_stream.pxi":4371 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4373 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4374 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1923, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4374, __pyx_L1_error) + + /* "talib/_stream.pxi":4373 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4375 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4376 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4376, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4375 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4377 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4378 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4379 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1924, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4379, __pyx_L1_error) + + /* "talib/_stream.pxi":4378 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4380 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4381 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1925, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4381, __pyx_L1_error) + + /* "talib/_stream.pxi":4380 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4382 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4383 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4383, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4382 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4384 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4385 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4386 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4387 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1926, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4387, __pyx_L1_error) + + /* "talib/_stream.pxi":4386 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4388 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4389 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1927, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4389, __pyx_L1_error) + + /* "talib/_stream.pxi":4388 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4390 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4391 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1928, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4391, __pyx_L1_error) + + /* "talib/_stream.pxi":4390 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4392 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTAKURI", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4393 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTAKURI", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTAKURI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4394 + * outinteger = 0 + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTAKURI", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTAKURI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4395 + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTAKURI", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4335 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4399 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_495stream_CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_494stream_CDLTASUKIGAP[] = " CDLTASUKIGAP(open, high, low, close)\n\n Tasuki Gap (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_495stream_CDLTASUKIGAP = {"stream_CDLTASUKIGAP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_495stream_CDLTASUKIGAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_494stream_CDLTASUKIGAP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_495stream_CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLTASUKIGAP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTASUKIGAP", 1, 4, 4, 1); __PYX_ERR(3, 4399, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTASUKIGAP", 1, 4, 4, 2); __PYX_ERR(3, 4399, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTASUKIGAP", 1, 4, 4, 3); __PYX_ERR(3, 4399, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLTASUKIGAP") < 0)) __PYX_ERR(3, 4399, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLTASUKIGAP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4399, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4399, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_494stream_CDLTASUKIGAP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_494stream_CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLTASUKIGAP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4421 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4422 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1929, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4422, __pyx_L1_error) + + /* "talib/_stream.pxi":4421 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4423 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4424 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1930, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4424, __pyx_L1_error) + + /* "talib/_stream.pxi":4423 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4425 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4426 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4426, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4425 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4427 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4428 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4429 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1931, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4429, __pyx_L1_error) + + /* "talib/_stream.pxi":4428 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4430 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4431 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1932, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4431, __pyx_L1_error) + + /* "talib/_stream.pxi":4430 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4432 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4433 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4433, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4432 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4434 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4435 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4436 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1933, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4436, __pyx_L1_error) + + /* "talib/_stream.pxi":4435 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4437 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4438 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1934, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4438, __pyx_L1_error) + + /* "talib/_stream.pxi":4437 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4439 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4440 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4440, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4439 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4441 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4442 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4443 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1935, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4443, __pyx_L1_error) + + /* "talib/_stream.pxi":4442 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4444 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4445 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1936, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4445, __pyx_L1_error) + + /* "talib/_stream.pxi":4444 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4446 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4447 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4447, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4446 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4448 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4449 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4450 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4451 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1937, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4451, __pyx_L1_error) + + /* "talib/_stream.pxi":4450 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4452 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4453 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1938, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4453, __pyx_L1_error) + + /* "talib/_stream.pxi":4452 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4454 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4455 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1939, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4455, __pyx_L1_error) + + /* "talib/_stream.pxi":4454 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4456 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4457 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTASUKIGAP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4458 + * outinteger = 0 + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTASUKIGAP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4459 + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTASUKIGAP", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4399 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4463 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_497stream_CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_496stream_CDLTHRUSTING[] = " CDLTHRUSTING(open, high, low, close)\n\n Thrusting Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_497stream_CDLTHRUSTING = {"stream_CDLTHRUSTING", (PyCFunction)__pyx_pw_5talib_7_ta_lib_497stream_CDLTHRUSTING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_496stream_CDLTHRUSTING}; +static PyObject *__pyx_pw_5talib_7_ta_lib_497stream_CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLTHRUSTING (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTHRUSTING", 1, 4, 4, 1); __PYX_ERR(3, 4463, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTHRUSTING", 1, 4, 4, 2); __PYX_ERR(3, 4463, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTHRUSTING", 1, 4, 4, 3); __PYX_ERR(3, 4463, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLTHRUSTING") < 0)) __PYX_ERR(3, 4463, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLTHRUSTING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4463, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4463, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_496stream_CDLTHRUSTING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_496stream_CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLTHRUSTING", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4485 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4486 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1940, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4486, __pyx_L1_error) + + /* "talib/_stream.pxi":4485 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4487 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4488 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1941, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4488, __pyx_L1_error) + + /* "talib/_stream.pxi":4487 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4489 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4490 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4490, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4489 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4491 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4492 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4493 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1942, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4493, __pyx_L1_error) + + /* "talib/_stream.pxi":4492 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4494 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4495 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1943, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4495, __pyx_L1_error) + + /* "talib/_stream.pxi":4494 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4496 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4497 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4497, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4496 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4498 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4499 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4500 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1944, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4500, __pyx_L1_error) + + /* "talib/_stream.pxi":4499 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4501 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4502 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1945, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4502, __pyx_L1_error) + + /* "talib/_stream.pxi":4501 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4503 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4504 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4504, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4503 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4505 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4506 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4507 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1946, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4507, __pyx_L1_error) + + /* "talib/_stream.pxi":4506 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4508 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4509 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1947, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4509, __pyx_L1_error) + + /* "talib/_stream.pxi":4508 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4510 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4511 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4511, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4510 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4512 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4513 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4514 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4515 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1948, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4515, __pyx_L1_error) + + /* "talib/_stream.pxi":4514 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4516 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4517 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1949, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4517, __pyx_L1_error) + + /* "talib/_stream.pxi":4516 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4518 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4519 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1950, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4519, __pyx_L1_error) + + /* "talib/_stream.pxi":4518 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4520 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4521 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTHRUSTING", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTHRUSTING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4522 + * outinteger = 0 + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTHRUSTING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4523 + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTHRUSTING", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4463 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_499stream_CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_498stream_CDLTRISTAR[] = " CDLTRISTAR(open, high, low, close)\n\n Tristar Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_499stream_CDLTRISTAR = {"stream_CDLTRISTAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_499stream_CDLTRISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_498stream_CDLTRISTAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_499stream_CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLTRISTAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTRISTAR", 1, 4, 4, 1); __PYX_ERR(3, 4527, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTRISTAR", 1, 4, 4, 2); __PYX_ERR(3, 4527, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLTRISTAR", 1, 4, 4, 3); __PYX_ERR(3, 4527, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLTRISTAR") < 0)) __PYX_ERR(3, 4527, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLTRISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4527, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4527, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4527, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4527, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4527, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_498stream_CDLTRISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_498stream_CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLTRISTAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4549 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4550 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1951, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4550, __pyx_L1_error) + + /* "talib/_stream.pxi":4549 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4551 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4552 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1952, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4552, __pyx_L1_error) + + /* "talib/_stream.pxi":4551 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4553 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4554 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4554, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4553 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4555 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4556 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4557 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1953, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4557, __pyx_L1_error) + + /* "talib/_stream.pxi":4556 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4558 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4559 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1954, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4559, __pyx_L1_error) + + /* "talib/_stream.pxi":4558 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4560 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4561 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4561, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4560 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4562 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4563 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4564 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1955, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4564, __pyx_L1_error) + + /* "talib/_stream.pxi":4563 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4565 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4566 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1956, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4566, __pyx_L1_error) + + /* "talib/_stream.pxi":4565 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4567 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4568 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4568, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4567 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4569 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4570 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4571 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1957, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4571, __pyx_L1_error) + + /* "talib/_stream.pxi":4570 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4572 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4573 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1958, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4573, __pyx_L1_error) + + /* "talib/_stream.pxi":4572 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4574 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4575 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4575, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4574 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4576 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4577 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4578 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4579 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1959, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4579, __pyx_L1_error) + + /* "talib/_stream.pxi":4578 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4580 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4581 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1960, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4581, __pyx_L1_error) + + /* "talib/_stream.pxi":4580 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4582 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4583 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1961, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4583, __pyx_L1_error) + + /* "talib/_stream.pxi":4582 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4584 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTRISTAR", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4585 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLTRISTAR", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLTRISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4586 + * outinteger = 0 + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTRISTAR", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLTRISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4587 + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLTRISTAR", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4591 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_501stream_CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_500stream_CDLUNIQUE3RIVER[] = " CDLUNIQUE3RIVER(open, high, low, close)\n\n Unique 3 River (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_501stream_CDLUNIQUE3RIVER = {"stream_CDLUNIQUE3RIVER", (PyCFunction)__pyx_pw_5talib_7_ta_lib_501stream_CDLUNIQUE3RIVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_500stream_CDLUNIQUE3RIVER}; +static PyObject *__pyx_pw_5talib_7_ta_lib_501stream_CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLUNIQUE3RIVER (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUNIQUE3RIVER", 1, 4, 4, 1); __PYX_ERR(3, 4591, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUNIQUE3RIVER", 1, 4, 4, 2); __PYX_ERR(3, 4591, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUNIQUE3RIVER", 1, 4, 4, 3); __PYX_ERR(3, 4591, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLUNIQUE3RIVER") < 0)) __PYX_ERR(3, 4591, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLUNIQUE3RIVER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4591, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4591, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_500stream_CDLUNIQUE3RIVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_500stream_CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLUNIQUE3RIVER", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4613 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4614 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1962, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4614, __pyx_L1_error) + + /* "talib/_stream.pxi":4613 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4615 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4616 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1963, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4616, __pyx_L1_error) + + /* "talib/_stream.pxi":4615 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4617 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4618 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4618, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4617 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4619 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4620 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4621 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1964, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4621, __pyx_L1_error) + + /* "talib/_stream.pxi":4620 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4622 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4623 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1965, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4623, __pyx_L1_error) + + /* "talib/_stream.pxi":4622 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4624 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4625 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4625, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4624 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4626 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4627 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4628 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1966, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4628, __pyx_L1_error) + + /* "talib/_stream.pxi":4627 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4629 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4630 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1967, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4630, __pyx_L1_error) + + /* "talib/_stream.pxi":4629 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4631 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4632 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4632, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4631 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4633 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4634 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4635 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1968, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4635, __pyx_L1_error) + + /* "talib/_stream.pxi":4634 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4636 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4637 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1969, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4637, __pyx_L1_error) + + /* "talib/_stream.pxi":4636 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4638 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4639 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4639, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4638 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4640 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4641 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4642 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4643 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1970, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4643, __pyx_L1_error) + + /* "talib/_stream.pxi":4642 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4644 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4645 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1971, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4645, __pyx_L1_error) + + /* "talib/_stream.pxi":4644 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4646 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4647 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1972, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4647, __pyx_L1_error) + + /* "talib/_stream.pxi":4646 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4648 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4649 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLUNIQUE3RIVER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4650 + * outinteger = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4651 + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4591 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4655 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_503stream_CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_502stream_CDLUPSIDEGAP2CROWS[] = " CDLUPSIDEGAP2CROWS(open, high, low, close)\n\n Upside Gap Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_503stream_CDLUPSIDEGAP2CROWS = {"stream_CDLUPSIDEGAP2CROWS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_503stream_CDLUPSIDEGAP2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_502stream_CDLUPSIDEGAP2CROWS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_503stream_CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLUPSIDEGAP2CROWS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUPSIDEGAP2CROWS", 1, 4, 4, 1); __PYX_ERR(3, 4655, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUPSIDEGAP2CROWS", 1, 4, 4, 2); __PYX_ERR(3, 4655, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLUPSIDEGAP2CROWS", 1, 4, 4, 3); __PYX_ERR(3, 4655, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLUPSIDEGAP2CROWS") < 0)) __PYX_ERR(3, 4655, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLUPSIDEGAP2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4655, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4655, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4655, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4655, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4655, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_502stream_CDLUPSIDEGAP2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_502stream_CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLUPSIDEGAP2CROWS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4677 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4678 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1973, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4678, __pyx_L1_error) + + /* "talib/_stream.pxi":4677 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4679 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4680 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1974, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4680, __pyx_L1_error) + + /* "talib/_stream.pxi":4679 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4681 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4682 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4682, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4681 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4683 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4684 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4685 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1975, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4685, __pyx_L1_error) + + /* "talib/_stream.pxi":4684 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4686 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4687 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1976, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4687, __pyx_L1_error) + + /* "talib/_stream.pxi":4686 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4688 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4689 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4689, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4688 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4690 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4691 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4692 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1977, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4692, __pyx_L1_error) + + /* "talib/_stream.pxi":4691 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4693 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4694 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1978, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4694, __pyx_L1_error) + + /* "talib/_stream.pxi":4693 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4695 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4696 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4696, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4695 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4697 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4698 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4699 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1979, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4699, __pyx_L1_error) + + /* "talib/_stream.pxi":4698 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4700 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4701 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1980, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4701, __pyx_L1_error) + + /* "talib/_stream.pxi":4700 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4702 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4703 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4703, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4702 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4704 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4705 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4706 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4707 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1981, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4707, __pyx_L1_error) + + /* "talib/_stream.pxi":4706 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4708 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4709 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1982, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4709, __pyx_L1_error) + + /* "talib/_stream.pxi":4708 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4710 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4711 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1983, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4711, __pyx_L1_error) + + /* "talib/_stream.pxi":4710 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4712 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4713 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLUPSIDEGAP2CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4714 + * outinteger = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4715 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4655 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4719 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_505stream_CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_504stream_CDLXSIDEGAP3METHODS[] = " CDLXSIDEGAP3METHODS(open, high, low, close)\n\n Upside/Downside Gap Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_505stream_CDLXSIDEGAP3METHODS = {"stream_CDLXSIDEGAP3METHODS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_505stream_CDLXSIDEGAP3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_504stream_CDLXSIDEGAP3METHODS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_505stream_CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_open = 0; + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CDLXSIDEGAP3METHODS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLXSIDEGAP3METHODS", 1, 4, 4, 1); __PYX_ERR(3, 4719, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLXSIDEGAP3METHODS", 1, 4, 4, 2); __PYX_ERR(3, 4719, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CDLXSIDEGAP3METHODS", 1, 4, 4, 3); __PYX_ERR(3, 4719, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CDLXSIDEGAP3METHODS") < 0)) __PYX_ERR(3, 4719, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_open = ((PyArrayObject *)values[0]); + __pyx_v_high = ((PyArrayObject *)values[1]); + __pyx_v_low = ((PyArrayObject *)values[2]); + __pyx_v_close = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CDLXSIDEGAP3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4719, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(3, 4719, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 4719, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 4719, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 4719, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_504stream_CDLXSIDEGAP3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_504stream_CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_open_data; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CDLXSIDEGAP3METHODS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_open); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":4741 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4742 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1984, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4742, __pyx_L1_error) + + /* "talib/_stream.pxi":4741 + * int outnbelement + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("open is not double") + * if open.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4743 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4744 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1985, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4744, __pyx_L1_error) + + /* "talib/_stream.pxi":4743 + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") + * if open.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4745 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4746 + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4746, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4745 + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + */ + } + + /* "talib/_stream.pxi":4747 + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + */ + __pyx_v_open_data = ((double *)__pyx_v_open->data); + + /* "talib/_stream.pxi":4748 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4749 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1986, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4749, __pyx_L1_error) + + /* "talib/_stream.pxi":4748 + * open = PyArray_GETCONTIGUOUS(open) + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4750 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4751 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1987, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4751, __pyx_L1_error) + + /* "talib/_stream.pxi":4750 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4752 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4753 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4753, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4752 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":4754 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":4755 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4756 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1988, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4756, __pyx_L1_error) + + /* "talib/_stream.pxi":4755 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4757 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4758 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1989, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4758, __pyx_L1_error) + + /* "talib/_stream.pxi":4757 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4759 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4760 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4760, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4759 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":4761 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":4762 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4763 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1990, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4763, __pyx_L1_error) + + /* "talib/_stream.pxi":4762 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4764 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4765 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1991, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4765, __pyx_L1_error) + + /* "talib/_stream.pxi":4764 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4766 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4767 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = open.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4767, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4766 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":4768 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = open.shape[0] + * if length != high.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":4769 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = open.shape[0] # <<<<<<<<<<<<<< + * if length != high.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_open->dimensions[0]); + + /* "talib/_stream.pxi":4770 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4771 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1992, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4771, __pyx_L1_error) + + /* "talib/_stream.pxi":4770 + * close_data = close.data + * length = open.shape[0] + * if length != high.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != low.shape[0]: + */ + } + + /* "talib/_stream.pxi":4772 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4773 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1993, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4773, __pyx_L1_error) + + /* "talib/_stream.pxi":4772 + * if length != high.shape[0]: + * raise Exception("input lengths are different") + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":4774 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4775 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1994, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4775, __pyx_L1_error) + + /* "talib/_stream.pxi":4774 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outinteger = 0 + */ + } + + /* "talib/_stream.pxi":4776 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":4777 + * raise Exception("input lengths are different") + * outinteger = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_CDLXSIDEGAP3METHODS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":4778 + * outinteger = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4779 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4719 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_open); + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4783 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_507stream_CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_506stream_CEIL[] = " CEIL(real)\n\n Vector Ceil (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_507stream_CEIL = {"stream_CEIL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_507stream_CEIL, METH_O, __pyx_doc_5talib_7_ta_lib_506stream_CEIL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_507stream_CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CEIL (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 4783, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_506stream_CEIL(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_506stream_CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CEIL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":4802 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4803 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1995, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4803, __pyx_L1_error) + + /* "talib/_stream.pxi":4802 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4804 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4805 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1996, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4805, __pyx_L1_error) + + /* "talib/_stream.pxi":4804 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4806 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4807 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4807, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4806 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":4808 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":4809 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":4810 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CEIL", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4811 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CEIL", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CEIL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4812 + * outreal = NaN + * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CEIL", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CEIL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4812, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4813 + * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CEIL", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4783 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CEIL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4817 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_509stream_CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_508stream_CMO[] = " CMO(real[, timeperiod=?])\n\n Chande Momentum Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_509stream_CMO = {"stream_CMO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_509stream_CMO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_508stream_CMO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_509stream_CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CMO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CMO") < 0)) __PYX_ERR(3, 4817, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4817, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CMO", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4817, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 4817, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_508stream_CMO(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_508stream_CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CMO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":4838 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4839 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1997, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4839, __pyx_L1_error) + + /* "talib/_stream.pxi":4838 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4840 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4841 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1998, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4841, __pyx_L1_error) + + /* "talib/_stream.pxi":4840 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4842 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4843 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4843, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4842 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":4844 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":4845 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":4846 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CMO", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4847 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CMO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CMO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4848 + * outreal = NaN + * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CMO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CMO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4849 + * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CMO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4817 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4853 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_511stream_CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_510stream_CORREL[] = " CORREL(real0, real1[, timeperiod=?])\n\n Pearson's Correlation Coefficient (r) (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_511stream_CORREL = {"stream_CORREL", (PyCFunction)__pyx_pw_5talib_7_ta_lib_511stream_CORREL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_510stream_CORREL}; +static PyObject *__pyx_pw_5talib_7_ta_lib_511stream_CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_CORREL (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_CORREL", 0, 2, 3, 1); __PYX_ERR(3, 4853, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_CORREL") < 0)) __PYX_ERR(3, 4853, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4853, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_CORREL", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4853, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 4853, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 4853, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_510stream_CORREL(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_510stream_CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_CORREL", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":4876 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4877 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1999, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4877, __pyx_L1_error) + + /* "talib/_stream.pxi":4876 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4878 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4879 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2000, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4879, __pyx_L1_error) + + /* "talib/_stream.pxi":4878 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4880 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4881 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4881, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4880 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":4882 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":4883 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4884 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2001, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4884, __pyx_L1_error) + + /* "talib/_stream.pxi":4883 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4885 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4886 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2002, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4886, __pyx_L1_error) + + /* "talib/_stream.pxi":4885 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4887 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4888 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4888, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4887 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":4889 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":4890 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":4891 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4892 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2003, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4892, __pyx_L1_error) + + /* "talib/_stream.pxi":4891 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":4893 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CORREL", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4894 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_CORREL", retCode) + * return outreal + */ + __pyx_v_retCode = TA_CORREL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4895 + * outreal = NaN + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CORREL", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_CORREL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4896 + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_CORREL", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4853 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4900 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_513stream_COS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_512stream_COS[] = " COS(real)\n\n Vector Trigonometric Cos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_513stream_COS = {"stream_COS", (PyCFunction)__pyx_pw_5talib_7_ta_lib_513stream_COS, METH_O, __pyx_doc_5talib_7_ta_lib_512stream_COS}; +static PyObject *__pyx_pw_5talib_7_ta_lib_513stream_COS(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_COS (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 4900, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_512stream_COS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_512stream_COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_COS", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":4919 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4920 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2004, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4920, __pyx_L1_error) + + /* "talib/_stream.pxi":4919 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4921 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4922 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2005, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4922, __pyx_L1_error) + + /* "talib/_stream.pxi":4921 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4923 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4924 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4924, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4923 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":4925 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":4926 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":4927 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COS", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4928 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_COS", retCode) + * return outreal + */ + __pyx_v_retCode = TA_COS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4929 + * outreal = NaN + * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COS", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_COS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4930 + * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COS", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4900 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_COS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4934 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_515stream_COSH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_514stream_COSH[] = " COSH(real)\n\n Vector Trigonometric Cosh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_515stream_COSH = {"stream_COSH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_515stream_COSH, METH_O, __pyx_doc_5talib_7_ta_lib_514stream_COSH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_515stream_COSH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_COSH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 4934, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_514stream_COSH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_514stream_COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_COSH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":4953 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4954 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2006, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4954, __pyx_L1_error) + + /* "talib/_stream.pxi":4953 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4955 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4956 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2007, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4956, __pyx_L1_error) + + /* "talib/_stream.pxi":4955 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4957 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4958 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4958, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4957 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":4959 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":4960 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":4961 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COSH", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4962 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_COSH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_COSH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4963 + * outreal = NaN + * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COSH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_COSH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4964 + * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_COSH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4934 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_COSH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":4968 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_517stream_DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_516stream_DEMA[] = " DEMA(real[, timeperiod=?])\n\n Double Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_517stream_DEMA = {"stream_DEMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_517stream_DEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_516stream_DEMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_517stream_DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_DEMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_DEMA") < 0)) __PYX_ERR(3, 4968, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4968, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_DEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4968, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 4968, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_516stream_DEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_516stream_DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_DEMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":4989 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4990 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2008, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4990, __pyx_L1_error) + + /* "talib/_stream.pxi":4989 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":4991 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4992 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2009, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 4992, __pyx_L1_error) + + /* "talib/_stream.pxi":4991 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":4993 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":4994 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 4994, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":4993 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":4995 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":4996 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":4997 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DEMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":4998 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DEMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DEMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":4999 + * outreal = NaN + * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DEMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5000 + * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DEMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":4968 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5004 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_519stream_DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_518stream_DIV[] = " DIV(real0, real1)\n\n Vector Arithmetic Div (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_519stream_DIV = {"stream_DIV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_519stream_DIV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_518stream_DIV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_519stream_DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_DIV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_DIV", 1, 2, 2, 1); __PYX_ERR(3, 5004, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_DIV") < 0)) __PYX_ERR(3, 5004, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_DIV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5004, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 5004, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 5004, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_518stream_DIV(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_518stream_DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_DIV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":5025 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5026 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2010, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5026, __pyx_L1_error) + + /* "talib/_stream.pxi":5025 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5027 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5028 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2011, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5028, __pyx_L1_error) + + /* "talib/_stream.pxi":5027 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5029 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5030 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5030, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5029 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":5031 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":5032 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5033 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2012, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5033, __pyx_L1_error) + + /* "talib/_stream.pxi":5032 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5034 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5035 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2013, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5035, __pyx_L1_error) + + /* "talib/_stream.pxi":5034 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5036 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5037 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5037, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5036 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":5038 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":5039 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":5040 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5041 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2014, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5041, __pyx_L1_error) + + /* "talib/_stream.pxi":5040 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":5042 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DIV", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5043 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DIV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DIV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5044 + * outreal = NaN + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DIV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DIV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5045 + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DIV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5004 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_521stream_DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_520stream_DX[] = " DX(high, low, close[, timeperiod=?])\n\n Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_521stream_DX = {"stream_DX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_521stream_DX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_520stream_DX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_521stream_DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_DX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_DX", 0, 3, 4, 1); __PYX_ERR(3, 5049, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_DX", 0, 3, 4, 2); __PYX_ERR(3, 5049, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_DX") < 0)) __PYX_ERR(3, 5049, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5049, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_DX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5049, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_DX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 5049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 5049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 5049, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_520stream_DX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_520stream_DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_DX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":5072 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5073 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2015, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5073, __pyx_L1_error) + + /* "talib/_stream.pxi":5072 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5074 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5075 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2016, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5075, __pyx_L1_error) + + /* "talib/_stream.pxi":5074 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5076 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5077 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5077, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5076 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":5078 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":5079 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5080 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2017, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5080, __pyx_L1_error) + + /* "talib/_stream.pxi":5079 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5081 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5082 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2018, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5082, __pyx_L1_error) + + /* "talib/_stream.pxi":5081 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5083 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5084 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5084, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5083 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":5085 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":5086 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5087 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2019, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5087, __pyx_L1_error) + + /* "talib/_stream.pxi":5086 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5088 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5089 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2020, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5089, __pyx_L1_error) + + /* "talib/_stream.pxi":5088 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5090 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5091 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5091, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5090 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":5092 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":5093 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":5094 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5095 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2021, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5095, __pyx_L1_error) + + /* "talib/_stream.pxi":5094 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":5096 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5097 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2022, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5097, __pyx_L1_error) + + /* "talib/_stream.pxi":5096 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":5098 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DX", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5099 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_DX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_DX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5100 + * outreal = NaN + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_DX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5101 + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_DX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_DX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_523stream_EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_522stream_EMA[] = " EMA(real[, timeperiod=?])\n\n Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_523stream_EMA = {"stream_EMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_523stream_EMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_522stream_EMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_523stream_EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_EMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_EMA") < 0)) __PYX_ERR(3, 5105, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5105, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_EMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5105, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5105, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_522stream_EMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_522stream_EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_EMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5126 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5127 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2023, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5127, __pyx_L1_error) + + /* "talib/_stream.pxi":5126 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5128 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5129 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2024, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5129, __pyx_L1_error) + + /* "talib/_stream.pxi":5128 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5130 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5131 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5131, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5130 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5132 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5133 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5134 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5135 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_EMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_EMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5136 + * outreal = NaN + * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_EMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5137 + * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_525stream_EXP(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_524stream_EXP[] = " EXP(real)\n\n Vector Arithmetic Exp (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_525stream_EXP = {"stream_EXP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_525stream_EXP, METH_O, __pyx_doc_5talib_7_ta_lib_524stream_EXP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_525stream_EXP(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_EXP (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5141, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_524stream_EXP(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_524stream_EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_EXP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5160 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5161 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2025, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5161, __pyx_L1_error) + + /* "talib/_stream.pxi":5160 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5162 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5163 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2026, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5163, __pyx_L1_error) + + /* "talib/_stream.pxi":5162 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5164 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5165 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5165, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5164 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5166 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5167 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5168 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EXP", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5169 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_EXP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_EXP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5170 + * outreal = NaN + * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EXP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_EXP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5171 + * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_EXP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_EXP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5175 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_527stream_FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_526stream_FLOOR[] = " FLOOR(real)\n\n Vector Floor (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_527stream_FLOOR = {"stream_FLOOR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_527stream_FLOOR, METH_O, __pyx_doc_5talib_7_ta_lib_526stream_FLOOR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_527stream_FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_FLOOR (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5175, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_526stream_FLOOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_526stream_FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_FLOOR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5194 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5195 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2027, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5195, __pyx_L1_error) + + /* "talib/_stream.pxi":5194 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5196 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5197 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2028, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5197, __pyx_L1_error) + + /* "talib/_stream.pxi":5196 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5198 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5199 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5199, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5198 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5200 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5201 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5202 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_FLOOR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5203 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_FLOOR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_FLOOR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5204 + * outreal = NaN + * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_FLOOR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_FLOOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5205 + * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_FLOOR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5175 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_FLOOR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5209 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_529stream_HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_528stream_HT_DCPERIOD[] = " HT_DCPERIOD(real)\n\n Hilbert Transform - Dominant Cycle Period (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_529stream_HT_DCPERIOD = {"stream_HT_DCPERIOD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_529stream_HT_DCPERIOD, METH_O, __pyx_doc_5talib_7_ta_lib_528stream_HT_DCPERIOD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_529stream_HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_DCPERIOD (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5209, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_528stream_HT_DCPERIOD(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_528stream_HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_HT_DCPERIOD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5228 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5229 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2029, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5229, __pyx_L1_error) + + /* "talib/_stream.pxi":5228 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5230 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5231 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2030, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5231, __pyx_L1_error) + + /* "talib/_stream.pxi":5230 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5232 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5233 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5233, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5232 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5234 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5235 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5236 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5237 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_DCPERIOD", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_DCPERIOD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5238 + * outreal = NaN + * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_DCPERIOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5239 + * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPERIOD", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5209 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_DCPERIOD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5243 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_531stream_HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_530stream_HT_DCPHASE[] = " HT_DCPHASE(real)\n\n Hilbert Transform - Dominant Cycle Phase (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_531stream_HT_DCPHASE = {"stream_HT_DCPHASE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_531stream_HT_DCPHASE, METH_O, __pyx_doc_5talib_7_ta_lib_530stream_HT_DCPHASE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_531stream_HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_DCPHASE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5243, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_530stream_HT_DCPHASE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_530stream_HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_HT_DCPHASE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5262 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5263 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2031, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5263, __pyx_L1_error) + + /* "talib/_stream.pxi":5262 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5264 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5265 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2032, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5265, __pyx_L1_error) + + /* "talib/_stream.pxi":5264 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5266 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5267 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5267, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5266 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5268 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5269 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5270 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPHASE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5271 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_DCPHASE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_DCPHASE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5272 + * outreal = NaN + * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPHASE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_DCPHASE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5273 + * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_DCPHASE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5243 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_DCPHASE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5277 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_533stream_HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_532stream_HT_PHASOR[] = " HT_PHASOR(real)\n\n Hilbert Transform - Phasor Components (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n inphase\n quadrature\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_533stream_HT_PHASOR = {"stream_HT_PHASOR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_533stream_HT_PHASOR, METH_O, __pyx_doc_5talib_7_ta_lib_532stream_HT_PHASOR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_533stream_HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_PHASOR (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5277, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_532stream_HT_PHASOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_532stream_HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outinphase; + double __pyx_v_outquadrature; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_HT_PHASOR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5298 + * double outinphase + * double outquadrature + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5299 + * double outquadrature + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2033, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5299, __pyx_L1_error) + + /* "talib/_stream.pxi":5298 + * double outinphase + * double outquadrature + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5300 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5301 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2034, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5301, __pyx_L1_error) + + /* "talib/_stream.pxi":5300 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5302 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5303 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5303, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5302 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5304 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outinphase = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5305 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outinphase = NaN + * outquadrature = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5306 + * real_data = real.data + * length = real.shape[0] + * outinphase = NaN # <<<<<<<<<<<<<< + * outquadrature = NaN + * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) + */ + __pyx_v_outinphase = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5307 + * length = real.shape[0] + * outinphase = NaN + * outquadrature = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) + * _ta_check_success("TA_HT_PHASOR", retCode) + */ + __pyx_v_outquadrature = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5308 + * outinphase = NaN + * outquadrature = NaN + * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_PHASOR", retCode) + * return outinphase , outquadrature + */ + __pyx_v_retCode = TA_HT_PHASOR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinphase), (&__pyx_v_outquadrature)); + + /* "talib/_stream.pxi":5309 + * outquadrature = NaN + * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) + * _ta_check_success("TA_HT_PHASOR", retCode) # <<<<<<<<<<<<<< + * return outinphase , outquadrature + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_PHASOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5310 + * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) + * _ta_check_success("TA_HT_PHASOR", retCode) + * return outinphase , outquadrature # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outinphase); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outquadrature); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5277 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_PHASOR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5314 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_535stream_HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_534stream_HT_SINE[] = " HT_SINE(real)\n\n Hilbert Transform - SineWave (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n sine\n leadsine\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_535stream_HT_SINE = {"stream_HT_SINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_535stream_HT_SINE, METH_O, __pyx_doc_5talib_7_ta_lib_534stream_HT_SINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_535stream_HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_SINE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5314, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_534stream_HT_SINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_534stream_HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outsine; + double __pyx_v_outleadsine; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_HT_SINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5335 + * double outsine + * double outleadsine + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5336 + * double outleadsine + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2035, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5336, __pyx_L1_error) + + /* "talib/_stream.pxi":5335 + * double outsine + * double outleadsine + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5337 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5338 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2036, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5338, __pyx_L1_error) + + /* "talib/_stream.pxi":5337 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5339 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5340 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5340, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5339 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5341 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outsine = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5342 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outsine = NaN + * outleadsine = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5343 + * real_data = real.data + * length = real.shape[0] + * outsine = NaN # <<<<<<<<<<<<<< + * outleadsine = NaN + * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) + */ + __pyx_v_outsine = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5344 + * length = real.shape[0] + * outsine = NaN + * outleadsine = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) + * _ta_check_success("TA_HT_SINE", retCode) + */ + __pyx_v_outleadsine = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5345 + * outsine = NaN + * outleadsine = NaN + * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_SINE", retCode) + * return outsine , outleadsine + */ + __pyx_v_retCode = TA_HT_SINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outsine), (&__pyx_v_outleadsine)); + + /* "talib/_stream.pxi":5346 + * outleadsine = NaN + * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) + * _ta_check_success("TA_HT_SINE", retCode) # <<<<<<<<<<<<<< + * return outsine , outleadsine + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_SINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5347 + * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) + * _ta_check_success("TA_HT_SINE", retCode) + * return outsine , outleadsine # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outsine); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outleadsine); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5314 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_SINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5351 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_537stream_HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_536stream_HT_TRENDLINE[] = " HT_TRENDLINE(real)\n\n Hilbert Transform - Instantaneous Trendline (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_537stream_HT_TRENDLINE = {"stream_HT_TRENDLINE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_537stream_HT_TRENDLINE, METH_O, __pyx_doc_5talib_7_ta_lib_536stream_HT_TRENDLINE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_537stream_HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_TRENDLINE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5351, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_536stream_HT_TRENDLINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_536stream_HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_HT_TRENDLINE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5370 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5371 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2037, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5371, __pyx_L1_error) + + /* "talib/_stream.pxi":5370 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5372 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5373 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2038, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5373, __pyx_L1_error) + + /* "talib/_stream.pxi":5372 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5374 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5375 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5375, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5374 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5376 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5377 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5378 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5379 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_TRENDLINE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_HT_TRENDLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5380 + * outreal = NaN + * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_TRENDLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5381 + * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_HT_TRENDLINE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5351 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_TRENDLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_539stream_HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_538stream_HT_TRENDMODE[] = " HT_TRENDMODE(real)\n\n Hilbert Transform - Trend vs Cycle Mode (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_539stream_HT_TRENDMODE = {"stream_HT_TRENDMODE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_539stream_HT_TRENDMODE, METH_O, __pyx_doc_5talib_7_ta_lib_538stream_HT_TRENDMODE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_539stream_HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_HT_TRENDMODE (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5385, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_538stream_HT_TRENDMODE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_538stream_HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_HT_TRENDMODE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5404 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5405 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2039, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5405, __pyx_L1_error) + + /* "talib/_stream.pxi":5404 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5406 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5407 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2040, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5407, __pyx_L1_error) + + /* "talib/_stream.pxi":5406 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5408 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5409 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5409, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5408 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5410 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outinteger = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5411 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5412 + * real_data = real.data + * length = real.shape[0] + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":5413 + * length = real.shape[0] + * outinteger = 0 + * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_HT_TRENDMODE", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_HT_TRENDMODE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":5414 + * outinteger = 0 + * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_HT_TRENDMODE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5415 + * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_HT_TRENDMODE", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_HT_TRENDMODE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_541stream_KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_540stream_KAMA[] = " KAMA(real[, timeperiod=?])\n\n Kaufman Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_541stream_KAMA = {"stream_KAMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_541stream_KAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_540stream_KAMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_541stream_KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_KAMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_KAMA") < 0)) __PYX_ERR(3, 5419, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5419, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_KAMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5419, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5419, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_540stream_KAMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_540stream_KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_KAMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5440 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5441 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2041, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5441, __pyx_L1_error) + + /* "talib/_stream.pxi":5440 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5442 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5443 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2042, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5443, __pyx_L1_error) + + /* "talib/_stream.pxi":5442 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5444 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5445 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5445, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5444 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5446 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5447 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5448 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_KAMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5449 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_KAMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_KAMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5450 + * outreal = NaN + * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_KAMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_KAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5451 + * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_KAMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5455 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_543stream_LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_542stream_LINEARREG[] = " LINEARREG(real[, timeperiod=?])\n\n Linear Regression (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_543stream_LINEARREG = {"stream_LINEARREG", (PyCFunction)__pyx_pw_5talib_7_ta_lib_543stream_LINEARREG, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_542stream_LINEARREG}; +static PyObject *__pyx_pw_5talib_7_ta_lib_543stream_LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LINEARREG (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_LINEARREG") < 0)) __PYX_ERR(3, 5455, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5455, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_LINEARREG", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5455, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5455, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_542stream_LINEARREG(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_542stream_LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LINEARREG", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5476 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5477 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2043, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5477, __pyx_L1_error) + + /* "talib/_stream.pxi":5476 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5478 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5479 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2044, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5479, __pyx_L1_error) + + /* "talib/_stream.pxi":5478 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5480 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5481 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5481, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5480 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5482 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5483 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5484 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5485 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5486 + * outreal = NaN + * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5487 + * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5455 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5491 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_545stream_LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_544stream_LINEARREG_ANGLE[] = " LINEARREG_ANGLE(real[, timeperiod=?])\n\n Linear Regression Angle (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_545stream_LINEARREG_ANGLE = {"stream_LINEARREG_ANGLE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_545stream_LINEARREG_ANGLE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_544stream_LINEARREG_ANGLE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_545stream_LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LINEARREG_ANGLE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_LINEARREG_ANGLE") < 0)) __PYX_ERR(3, 5491, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5491, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_LINEARREG_ANGLE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5491, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5491, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_544stream_LINEARREG_ANGLE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_544stream_LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LINEARREG_ANGLE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5512 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5513 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2045, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5513, __pyx_L1_error) + + /* "talib/_stream.pxi":5512 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5514 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5515 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2046, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5515, __pyx_L1_error) + + /* "talib/_stream.pxi":5514 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5516 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5517 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5517, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5516 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5518 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5519 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5520 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5521 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_ANGLE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5522 + * outreal = NaN + * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5523 + * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_ANGLE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5491 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_547stream_LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_546stream_LINEARREG_INTERCEPT[] = " LINEARREG_INTERCEPT(real[, timeperiod=?])\n\n Linear Regression Intercept (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_547stream_LINEARREG_INTERCEPT = {"stream_LINEARREG_INTERCEPT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_547stream_LINEARREG_INTERCEPT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_546stream_LINEARREG_INTERCEPT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_547stream_LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LINEARREG_INTERCEPT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_LINEARREG_INTERCEPT") < 0)) __PYX_ERR(3, 5527, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5527, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_LINEARREG_INTERCEPT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5527, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5527, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_546stream_LINEARREG_INTERCEPT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_546stream_LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LINEARREG_INTERCEPT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5548 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5549 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2047, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5549, __pyx_L1_error) + + /* "talib/_stream.pxi":5548 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5550 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5551 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2048, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5551, __pyx_L1_error) + + /* "talib/_stream.pxi":5550 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5552 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5553 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5553, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5552 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5554 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5555 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5556 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5557 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_INTERCEPT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5558 + * outreal = NaN + * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5559 + * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_549stream_LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_548stream_LINEARREG_SLOPE[] = " LINEARREG_SLOPE(real[, timeperiod=?])\n\n Linear Regression Slope (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_549stream_LINEARREG_SLOPE = {"stream_LINEARREG_SLOPE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_549stream_LINEARREG_SLOPE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_548stream_LINEARREG_SLOPE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_549stream_LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LINEARREG_SLOPE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_LINEARREG_SLOPE") < 0)) __PYX_ERR(3, 5563, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5563, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_LINEARREG_SLOPE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5563, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5563, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_548stream_LINEARREG_SLOPE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_548stream_LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LINEARREG_SLOPE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5584 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5585 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2049, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5585, __pyx_L1_error) + + /* "talib/_stream.pxi":5584 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5586 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5587 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2050, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5587, __pyx_L1_error) + + /* "talib/_stream.pxi":5586 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5588 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5589 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5589, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5588 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5590 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5591 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5592 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5593 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LINEARREG_SLOPE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5594 + * outreal = NaN + * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5595 + * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LINEARREG_SLOPE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5599 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_551stream_LN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_550stream_LN[] = " LN(real)\n\n Vector Log Natural (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_551stream_LN = {"stream_LN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_551stream_LN, METH_O, __pyx_doc_5talib_7_ta_lib_550stream_LN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_551stream_LN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5599, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_550stream_LN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_550stream_LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5618 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5619 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2051, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5619, __pyx_L1_error) + + /* "talib/_stream.pxi":5618 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5620 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5621 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2052, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5621, __pyx_L1_error) + + /* "talib/_stream.pxi":5620 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5622 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5623 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5623, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5622 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5624 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5625 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5626 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5627 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5628 + * outreal = NaN + * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5629 + * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5599 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5633 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_553stream_LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_552stream_LOG10[] = " LOG10(real)\n\n Vector Log10 (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_553stream_LOG10 = {"stream_LOG10", (PyCFunction)__pyx_pw_5talib_7_ta_lib_553stream_LOG10, METH_O, __pyx_doc_5talib_7_ta_lib_552stream_LOG10}; +static PyObject *__pyx_pw_5talib_7_ta_lib_553stream_LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_LOG10 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5633, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_552stream_LOG10(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_552stream_LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_LOG10", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5652 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5653 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2053, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5653, __pyx_L1_error) + + /* "talib/_stream.pxi":5652 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5654 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5655 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2054, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5655, __pyx_L1_error) + + /* "talib/_stream.pxi":5654 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5656 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5657 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5657, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5656 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5658 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5659 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5660 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LOG10", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5661 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_LOG10", retCode) + * return outreal + */ + __pyx_v_retCode = TA_LOG10((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5662 + * outreal = NaN + * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LOG10", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_LOG10, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5663 + * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_LOG10", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5633 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_LOG10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5667 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_555stream_MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_554stream_MA[] = " MA(real[, timeperiod=?, matype=?])\n\n Moving average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_555stream_MA = {"stream_MA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_555stream_MA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_554stream_MA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_555stream_MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_matype,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MA") < 0)) __PYX_ERR(3, 5667, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5667, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5667, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5667, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5667, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_554stream_MA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_554stream_MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5689 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5690 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2055, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5690, __pyx_L1_error) + + /* "talib/_stream.pxi":5689 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5691 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5692 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2056, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5692, __pyx_L1_error) + + /* "talib/_stream.pxi":5691 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5693 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5694 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5694, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5693 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5695 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5696 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5697 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5698 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5699 + * outreal = NaN + * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5700 + * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5667 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5704 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_557stream_MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_556stream_MACD[] = " MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?])\n\n Moving Average Convergence/Divergence (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_557stream_MACD = {"stream_MACD", (PyCFunction)__pyx_pw_5talib_7_ta_lib_557stream_MACD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_556stream_MACD}; +static PyObject *__pyx_pw_5talib_7_ta_lib_557stream_MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_signalperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MACD (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_signalperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MACD") < 0)) __PYX_ERR(3, 5704, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5704, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5704, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5704, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MACD", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5704, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5704, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_556stream_MACD(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_556stream_MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outmacd; + double __pyx_v_outmacdsignal; + double __pyx_v_outmacdhist; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("stream_MACD", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5731 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5732 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2057, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5732, __pyx_L1_error) + + /* "talib/_stream.pxi":5731 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5733 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5734 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2058, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5734, __pyx_L1_error) + + /* "talib/_stream.pxi":5733 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5735 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5736 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5736, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5735 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5737 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outmacd = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5738 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outmacd = NaN + * outmacdsignal = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5739 + * real_data = real.data + * length = real.shape[0] + * outmacd = NaN # <<<<<<<<<<<<<< + * outmacdsignal = NaN + * outmacdhist = NaN + */ + __pyx_v_outmacd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5740 + * length = real.shape[0] + * outmacd = NaN + * outmacdsignal = NaN # <<<<<<<<<<<<<< + * outmacdhist = NaN + * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + */ + __pyx_v_outmacdsignal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5741 + * outmacd = NaN + * outmacdsignal = NaN + * outmacdhist = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACD", retCode) + */ + __pyx_v_outmacdhist = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5742 + * outmacdsignal = NaN + * outmacdhist = NaN + * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACD", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); + + /* "talib/_stream.pxi":5743 + * outmacdhist = NaN + * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACD", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5744 + * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACD", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5704 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.stream_MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5748 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_559stream_MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_558stream_MACDEXT[] = " MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?])\n\n MACD with controllable MA type (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n fastmatype: 0\n slowperiod: 26\n slowmatype: 0\n signalperiod: 9\n signalmatype: 0\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_559stream_MACDEXT = {"stream_MACDEXT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_559stream_MACDEXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_558stream_MACDEXT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_559stream_MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_fastmatype; + int __pyx_v_slowperiod; + int __pyx_v_slowmatype; + int __pyx_v_signalperiod; + int __pyx_v_signalmatype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MACDEXT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_fastmatype,&__pyx_n_s_slowperiod,&__pyx_n_s_slowmatype,&__pyx_n_s_signalperiod,&__pyx_n_s_signalmatype,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastmatype); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowmatype); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalmatype); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MACDEXT") < 0)) __PYX_ERR(3, 5748, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_fastmatype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_fastmatype = ((int)0); + } + if (values[3]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_slowmatype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_slowmatype = ((int)0); + } + if (values[5]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + if (values[6]) { + __pyx_v_signalmatype = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_signalmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5748, __pyx_L3_error) + } else { + __pyx_v_signalmatype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MACDEXT", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5748, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5748, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_558stream_MACDEXT(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_558stream_MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outmacd; + double __pyx_v_outmacdsignal; + double __pyx_v_outmacdhist; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("stream_MACDEXT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5778 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5779 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2059, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5779, __pyx_L1_error) + + /* "talib/_stream.pxi":5778 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5780 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5781 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2060, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5781, __pyx_L1_error) + + /* "talib/_stream.pxi":5780 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5782 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5783 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5783, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5782 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5784 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outmacd = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5785 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outmacd = NaN + * outmacdsignal = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5786 + * real_data = real.data + * length = real.shape[0] + * outmacd = NaN # <<<<<<<<<<<<<< + * outmacdsignal = NaN + * outmacdhist = NaN + */ + __pyx_v_outmacd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5787 + * length = real.shape[0] + * outmacd = NaN + * outmacdsignal = NaN # <<<<<<<<<<<<<< + * outmacdhist = NaN + * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + */ + __pyx_v_outmacdsignal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5788 + * outmacd = NaN + * outmacdsignal = NaN + * outmacdhist = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDEXT", retCode) + */ + __pyx_v_outmacdhist = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5789 + * outmacdsignal = NaN + * outmacdhist = NaN + * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACDEXT", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACDEXT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); + + /* "talib/_stream.pxi":5790 + * outmacdhist = NaN + * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDEXT", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACDEXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5791 + * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDEXT", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5748 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.stream_MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5795 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_561stream_MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_560stream_MACDFIX[] = " MACDFIX(real[, signalperiod=?])\n\n Moving Average Convergence/Divergence Fix 12/26 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_561stream_MACDFIX = {"stream_MACDFIX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_561stream_MACDFIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_560stream_MACDFIX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_561stream_MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_signalperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MACDFIX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_signalperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MACDFIX") < 0)) __PYX_ERR(3, 5795, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5795, __pyx_L3_error) + } else { + __pyx_v_signalperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MACDFIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5795, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5795, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_560stream_MACDFIX(__pyx_self, __pyx_v_real, __pyx_v_signalperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_560stream_MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outmacd; + double __pyx_v_outmacdsignal; + double __pyx_v_outmacdhist; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("stream_MACDFIX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5820 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5821 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2061, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5821, __pyx_L1_error) + + /* "talib/_stream.pxi":5820 + * double outmacdsignal + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5822 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5823 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2062, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5823, __pyx_L1_error) + + /* "talib/_stream.pxi":5822 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5824 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5825 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5825, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5824 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5826 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outmacd = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5827 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outmacd = NaN + * outmacdsignal = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5828 + * real_data = real.data + * length = real.shape[0] + * outmacd = NaN # <<<<<<<<<<<<<< + * outmacdsignal = NaN + * outmacdhist = NaN + */ + __pyx_v_outmacd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5829 + * length = real.shape[0] + * outmacd = NaN + * outmacdsignal = NaN # <<<<<<<<<<<<<< + * outmacdhist = NaN + * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + */ + __pyx_v_outmacdsignal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5830 + * outmacd = NaN + * outmacdsignal = NaN + * outmacdhist = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDFIX", retCode) + */ + __pyx_v_outmacdhist = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5831 + * outmacdsignal = NaN + * outmacdhist = NaN + * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MACDFIX", retCode) + * return outmacd , outmacdsignal , outmacdhist + */ + __pyx_v_retCode = TA_MACDFIX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); + + /* "talib/_stream.pxi":5832 + * outmacdhist = NaN + * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDFIX", retCode) # <<<<<<<<<<<<<< + * return outmacd , outmacdsignal , outmacdhist + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MACDFIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5833 + * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) + * _ta_check_success("TA_MACDFIX", retCode) + * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5795 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("talib._ta_lib.stream_MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5837 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_563stream_MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_562stream_MAMA[] = " MAMA(real[, fastlimit=?, slowlimit=?])\n\n MESA Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastlimit: 0.5\n slowlimit: 0.05\n Outputs:\n mama\n fama\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_563stream_MAMA = {"stream_MAMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_563stream_MAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_562stream_MAMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_563stream_MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + double __pyx_v_fastlimit; + double __pyx_v_slowlimit; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MAMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastlimit,&__pyx_n_s_slowlimit,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastlimit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowlimit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MAMA") < 0)) __PYX_ERR(3, 5837, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastlimit = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fastlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 5837, __pyx_L3_error) + } else { + __pyx_v_fastlimit = ((double)-4e37); + } + if (values[2]) { + __pyx_v_slowlimit = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_slowlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 5837, __pyx_L3_error) + } else { + __pyx_v_slowlimit = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MAMA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5837, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5837, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_562stream_MAMA(__pyx_self, __pyx_v_real, __pyx_v_fastlimit, __pyx_v_slowlimit); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_562stream_MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outmama; + double __pyx_v_outfama; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_MAMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5861 + * double outmama + * double outfama + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5862 + * double outfama + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2063, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5862, __pyx_L1_error) + + /* "talib/_stream.pxi":5861 + * double outmama + * double outfama + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5863 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5864 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2064, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5864, __pyx_L1_error) + + /* "talib/_stream.pxi":5863 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5865 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5866 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5866, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5865 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5867 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outmama = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5868 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outmama = NaN + * outfama = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5869 + * real_data = real.data + * length = real.shape[0] + * outmama = NaN # <<<<<<<<<<<<<< + * outfama = NaN + * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) + */ + __pyx_v_outmama = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5870 + * length = real.shape[0] + * outmama = NaN + * outfama = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) + * _ta_check_success("TA_MAMA", retCode) + */ + __pyx_v_outfama = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5871 + * outmama = NaN + * outfama = NaN + * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAMA", retCode) + * return outmama , outfama + */ + __pyx_v_retCode = TA_MAMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastlimit, __pyx_v_slowlimit, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmama), (&__pyx_v_outfama)); + + /* "talib/_stream.pxi":5872 + * outfama = NaN + * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) + * _ta_check_success("TA_MAMA", retCode) # <<<<<<<<<<<<<< + * return outmama , outfama + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5873 + * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) + * _ta_check_success("TA_MAMA", retCode) + * return outmama , outfama # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmama); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfama); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5837 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5877 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_565stream_MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_564stream_MAVP[] = " MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?])\n\n Moving average with variable period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n periods: (any ndarray)\n Parameters:\n minperiod: 2\n maxperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_565stream_MAVP = {"stream_MAVP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_565stream_MAVP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_564stream_MAVP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_565stream_MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + PyArrayObject *__pyx_v_periods = 0; + int __pyx_v_minperiod; + int __pyx_v_maxperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MAVP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_periods,&__pyx_n_s_minperiod,&__pyx_n_s_maxperiod,&__pyx_n_s_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MAVP", 0, 2, 5, 1); __PYX_ERR(3, 5877, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxperiod); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MAVP") < 0)) __PYX_ERR(3, 5877, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + __pyx_v_periods = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_minperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5877, __pyx_L3_error) + } else { + __pyx_v_minperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_maxperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5877, __pyx_L3_error) + } else { + __pyx_v_maxperiod = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5877, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MAVP", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5877, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5877, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periods), __pyx_ptype_5numpy_ndarray, 0, "periods", 0))) __PYX_ERR(3, 5877, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_564stream_MAVP(__pyx_self, __pyx_v_real, __pyx_v_periods, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_564stream_MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + double *__pyx_v_periods_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MAVP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + __Pyx_INCREF((PyObject *)__pyx_v_periods); + + /* "talib/_stream.pxi":5902 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5903 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2065, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5903, __pyx_L1_error) + + /* "talib/_stream.pxi":5902 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5904 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5905 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2066, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5905, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5905, __pyx_L1_error) + + /* "talib/_stream.pxi":5904 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5906 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5907 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5907, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5906 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5908 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5909 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("periods is not double") + * if periods.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_periods) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5910 + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") # <<<<<<<<<<<<<< + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2067, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5910, __pyx_L1_error) + + /* "talib/_stream.pxi":5909 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("periods is not double") + * if periods.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5911 + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + * if periods.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_periods->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5912 + * raise Exception("periods is not double") + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2068, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5912, __pyx_L1_error) + + /* "talib/_stream.pxi":5911 + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") + * if periods.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5913 + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_periods) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5914 + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) # <<<<<<<<<<<<<< + * periods_data = periods.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_periods); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5914, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_periods, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5913 + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + */ + } + + /* "talib/_stream.pxi":5915 + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * if length != periods.shape[0]: + */ + __pyx_v_periods_data = ((double *)__pyx_v_periods->data); + + /* "talib/_stream.pxi":5916 + * periods = PyArray_GETCONTIGUOUS(periods) + * periods_data = periods.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * if length != periods.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5917 + * periods_data = periods.data + * length = real.shape[0] + * if length != periods.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_periods->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5918 + * length = real.shape[0] + * if length != periods.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2069, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5918, __pyx_L1_error) + + /* "talib/_stream.pxi":5917 + * periods_data = periods.data + * length = real.shape[0] + * if length != periods.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":5919 + * if length != periods.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAVP", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5920 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAVP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MAVP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_periods_data, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5921 + * outreal = NaN + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAVP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAVP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5922 + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAVP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5877 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XDECREF((PyObject *)__pyx_v_periods); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5926 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_567stream_MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_566stream_MAX[] = " MAX(real[, timeperiod=?])\n\n Highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_567stream_MAX = {"stream_MAX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_567stream_MAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_566stream_MAX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_567stream_MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MAX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MAX") < 0)) __PYX_ERR(3, 5926, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5926, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5926, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5926, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_566stream_MAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_566stream_MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MAX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5947 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5948 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2070, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5948, __pyx_L1_error) + + /* "talib/_stream.pxi":5947 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5949 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5950 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2071, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5950, __pyx_L1_error) + + /* "talib/_stream.pxi":5949 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5951 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5952 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5952, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5951 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5953 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5954 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5955 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAX", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":5956 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MAX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":5957 + * outreal = NaN + * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5958 + * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MAX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5926 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5962 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_569stream_MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_568stream_MAXINDEX[] = " MAXINDEX(real[, timeperiod=?])\n\n Index of highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_569stream_MAXINDEX = {"stream_MAXINDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_569stream_MAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_568stream_MAXINDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_569stream_MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MAXINDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MAXINDEX") < 0)) __PYX_ERR(3, 5962, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5962, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5962, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 5962, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_568stream_MAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_568stream_MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MAXINDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":5983 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5984 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2072, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5984, __pyx_L1_error) + + /* "talib/_stream.pxi":5983 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":5985 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5986 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2073, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 5986, __pyx_L1_error) + + /* "talib/_stream.pxi":5985 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":5987 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":5988 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 5988, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5987 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":5989 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outinteger = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":5990 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":5991 + * real_data = real.data + * length = real.shape[0] + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MAXINDEX", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":5992 + * length = real.shape[0] + * outinteger = 0 + * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MAXINDEX", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_MAXINDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":5993 + * outinteger = 0 + * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MAXINDEX", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":5994 + * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MAXINDEX", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5962 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":5998 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_571stream_MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_570stream_MEDPRICE[] = " MEDPRICE(high, low)\n\n Median Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_571stream_MEDPRICE = {"stream_MEDPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_571stream_MEDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_570stream_MEDPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_571stream_MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MEDPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MEDPRICE", 1, 2, 2, 1); __PYX_ERR(3, 5998, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MEDPRICE") < 0)) __PYX_ERR(3, 5998, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MEDPRICE", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5998, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 5998, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 5998, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_570stream_MEDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_570stream_MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MEDPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":6018 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6019 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2074, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6019, __pyx_L1_error) + + /* "talib/_stream.pxi":6018 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6020 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6021 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2075, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6021, __pyx_L1_error) + + /* "talib/_stream.pxi":6020 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6022 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6023 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6023, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6022 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6024 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6025 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6026 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2076, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6026, __pyx_L1_error) + + /* "talib/_stream.pxi":6025 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6027 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6028 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2077, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6028, __pyx_L1_error) + + /* "talib/_stream.pxi":6027 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6029 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6030 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6030, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6029 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6031 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6032 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6033 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6034 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2078, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6034, __pyx_L1_error) + + /* "talib/_stream.pxi":6033 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6035 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MEDPRICE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6036 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MEDPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MEDPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6037 + * outreal = NaN + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MEDPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MEDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6038 + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MEDPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":5998 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_573stream_MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_572stream_MFI[] = " MFI(high, low, close, volume[, timeperiod=?])\n\n Money Flow Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_573stream_MFI = {"stream_MFI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_573stream_MFI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_572stream_MFI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_573stream_MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyArrayObject *__pyx_v_volume = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MFI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_timeperiod,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MFI", 0, 4, 5, 1); __PYX_ERR(3, 6042, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MFI", 0, 4, 5, 2); __PYX_ERR(3, 6042, __pyx_L3_error) + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MFI", 0, 4, 5, 3); __PYX_ERR(3, 6042, __pyx_L3_error) + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MFI") < 0)) __PYX_ERR(3, 6042, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + __pyx_v_volume = ((PyArrayObject *)values[3]); + if (values[4]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6042, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MFI", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6042, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 6042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(3, 6042, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_572stream_MFI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_572stream_MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MFI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_stream.pxi":6066 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6067 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2079, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6067, __pyx_L1_error) + + /* "talib/_stream.pxi":6066 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6068 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6069 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2080, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6069, __pyx_L1_error) + + /* "talib/_stream.pxi":6068 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6070 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6071 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6071, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6070 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6072 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6073 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6074 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2081, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6074, __pyx_L1_error) + + /* "talib/_stream.pxi":6073 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6075 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6076 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2082, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6076, __pyx_L1_error) + + /* "talib/_stream.pxi":6075 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6077 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6078 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6078, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6077 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6079 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6080 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6081 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2083, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6081, __pyx_L1_error) + + /* "talib/_stream.pxi":6080 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6082 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6083 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2084, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6083, __pyx_L1_error) + + /* "talib/_stream.pxi":6082 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6084 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6085 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6085, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6084 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":6086 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":6087 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6088 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2085, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6088, __pyx_L1_error) + + /* "talib/_stream.pxi":6087 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6089 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6090 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2086, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6090, __pyx_L1_error) + + /* "talib/_stream.pxi":6089 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6091 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6092 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6092, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6091 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_stream.pxi":6093 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_stream.pxi":6094 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6095 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6096 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2087, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6096, __pyx_L1_error) + + /* "talib/_stream.pxi":6095 + * volume_data = volume.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":6097 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6098 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2088, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6098, __pyx_L1_error) + + /* "talib/_stream.pxi":6097 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + */ + } + + /* "talib/_stream.pxi":6099 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6100 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2089, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6100, __pyx_L1_error) + + /* "talib/_stream.pxi":6099 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6101 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MFI", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6102 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MFI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MFI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6103 + * outreal = NaN + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MFI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MFI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6104 + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MFI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_575stream_MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_574stream_MIDPOINT[] = " MIDPOINT(real[, timeperiod=?])\n\n MidPoint over period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_575stream_MIDPOINT = {"stream_MIDPOINT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_575stream_MIDPOINT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_574stream_MIDPOINT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_575stream_MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MIDPOINT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MIDPOINT") < 0)) __PYX_ERR(3, 6108, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6108, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MIDPOINT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6108, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_574stream_MIDPOINT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_574stream_MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MIDPOINT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6129 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6130 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2090, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6130, __pyx_L1_error) + + /* "talib/_stream.pxi":6129 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6131 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6132 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2091, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6132, __pyx_L1_error) + + /* "talib/_stream.pxi":6131 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6133 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6134 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6134, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6133 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6135 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6136 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6137 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPOINT", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6138 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIDPOINT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIDPOINT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6139 + * outreal = NaN + * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPOINT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIDPOINT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6140 + * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPOINT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6144 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_577stream_MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_576stream_MIDPRICE[] = " MIDPRICE(high, low[, timeperiod=?])\n\n Midpoint Price over period (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_577stream_MIDPRICE = {"stream_MIDPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_577stream_MIDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_576stream_MIDPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_577stream_MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MIDPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MIDPRICE", 0, 2, 3, 1); __PYX_ERR(3, 6144, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MIDPRICE") < 0)) __PYX_ERR(3, 6144, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6144, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MIDPRICE", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6144, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6144, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6144, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_576stream_MIDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_576stream_MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MIDPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":6166 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6167 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2092, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6167, __pyx_L1_error) + + /* "talib/_stream.pxi":6166 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6168 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6169 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2093, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6169, __pyx_L1_error) + + /* "talib/_stream.pxi":6168 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6170 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6171 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6171, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6170 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6172 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6173 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6174 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2094, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6174, __pyx_L1_error) + + /* "talib/_stream.pxi":6173 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6175 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6176 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2095, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6176, __pyx_L1_error) + + /* "talib/_stream.pxi":6175 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6177 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6178 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6178, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6177 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6179 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6180 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6181 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6182 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2096, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6182, __pyx_L1_error) + + /* "talib/_stream.pxi":6181 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6183 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPRICE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6184 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIDPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIDPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6185 + * outreal = NaN + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6186 + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIDPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6144 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6190 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_579stream_MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_578stream_MIN[] = " MIN(real[, timeperiod=?])\n\n Lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_579stream_MIN = {"stream_MIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_579stream_MIN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_578stream_MIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_579stream_MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MIN (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MIN") < 0)) __PYX_ERR(3, 6190, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6190, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MIN", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6190, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6190, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_578stream_MIN(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_578stream_MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6211 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6212 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2097, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6212, __pyx_L1_error) + + /* "talib/_stream.pxi":6211 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6213 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6214 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2098, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6214, __pyx_L1_error) + + /* "talib/_stream.pxi":6213 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6215 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6216 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6216, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6215 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6217 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6218 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6219 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6220 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6221 + * outreal = NaN + * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6222 + * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6190 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_581stream_MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_580stream_MININDEX[] = " MININDEX(real[, timeperiod=?])\n\n Index of lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_581stream_MININDEX = {"stream_MININDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_581stream_MININDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_580stream_MININDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_581stream_MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MININDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MININDEX") < 0)) __PYX_ERR(3, 6226, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6226, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MININDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6226, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6226, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_580stream_MININDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_580stream_MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outinteger; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MININDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6247 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6248 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2099, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6248, __pyx_L1_error) + + /* "talib/_stream.pxi":6247 + * int outnbelement + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6249 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6250 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6250, __pyx_L1_error) + + /* "talib/_stream.pxi":6249 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6251 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6252 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6252, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6251 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6253 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outinteger = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6254 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6255 + * real_data = real.data + * length = real.shape[0] + * outinteger = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MININDEX", retCode) + */ + __pyx_v_outinteger = 0; + + /* "talib/_stream.pxi":6256 + * length = real.shape[0] + * outinteger = 0 + * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MININDEX", retCode) + * return outinteger + */ + __pyx_v_retCode = TA_MININDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); + + /* "talib/_stream.pxi":6257 + * outinteger = 0 + * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MININDEX", retCode) # <<<<<<<<<<<<<< + * return outinteger + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MININDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6258 + * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) + * _ta_check_success("TA_MININDEX", retCode) + * return outinteger # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6262 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_583stream_MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_582stream_MINMAX[] = " MINMAX(real[, timeperiod=?])\n\n Lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n min\n max\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_583stream_MINMAX = {"stream_MINMAX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_583stream_MINMAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_582stream_MINMAX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_583stream_MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MINMAX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MINMAX") < 0)) __PYX_ERR(3, 6262, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6262, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MINMAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6262, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6262, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_582stream_MINMAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_582stream_MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outmin; + double __pyx_v_outmax; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_MINMAX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6285 + * double outmin + * double outmax + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6286 + * double outmax + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6286, __pyx_L1_error) + + /* "talib/_stream.pxi":6285 + * double outmin + * double outmax + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6287 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6288 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6288, __pyx_L1_error) + + /* "talib/_stream.pxi":6287 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6289 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6290 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6290, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6289 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6291 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outmin = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6292 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outmin = NaN + * outmax = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6293 + * real_data = real.data + * length = real.shape[0] + * outmin = NaN # <<<<<<<<<<<<<< + * outmax = NaN + * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) + */ + __pyx_v_outmin = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6294 + * length = real.shape[0] + * outmin = NaN + * outmax = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) + * _ta_check_success("TA_MINMAX", retCode) + */ + __pyx_v_outmax = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6295 + * outmin = NaN + * outmax = NaN + * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINMAX", retCode) + * return outmin , outmax + */ + __pyx_v_retCode = TA_MINMAX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmin), (&__pyx_v_outmax)); + + /* "talib/_stream.pxi":6296 + * outmax = NaN + * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) + * _ta_check_success("TA_MINMAX", retCode) # <<<<<<<<<<<<<< + * return outmin , outmax + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINMAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6297 + * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) + * _ta_check_success("TA_MINMAX", retCode) + * return outmin , outmax # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6262 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_585stream_MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_584stream_MINMAXINDEX[] = " MINMAXINDEX(real[, timeperiod=?])\n\n Indexes of lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n minidx\n maxidx\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_585stream_MINMAXINDEX = {"stream_MINMAXINDEX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_585stream_MINMAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_584stream_MINMAXINDEX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_585stream_MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MINMAXINDEX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MINMAXINDEX") < 0)) __PYX_ERR(3, 6301, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6301, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MINMAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6301, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6301, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_584stream_MINMAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_584stream_MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + int __pyx_v_outminidx; + int __pyx_v_outmaxidx; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_MINMAXINDEX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6324 + * int outminidx + * int outmaxidx + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6325 + * int outmaxidx + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6325, __pyx_L1_error) + + /* "talib/_stream.pxi":6324 + * int outminidx + * int outmaxidx + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6326 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6327 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6327, __pyx_L1_error) + + /* "talib/_stream.pxi":6326 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6328 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6329 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6329, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6328 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6330 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outminidx = 0 + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6331 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outminidx = 0 + * outmaxidx = 0 + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6332 + * real_data = real.data + * length = real.shape[0] + * outminidx = 0 # <<<<<<<<<<<<<< + * outmaxidx = 0 + * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) + */ + __pyx_v_outminidx = 0; + + /* "talib/_stream.pxi":6333 + * length = real.shape[0] + * outminidx = 0 + * outmaxidx = 0 # <<<<<<<<<<<<<< + * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) + * _ta_check_success("TA_MINMAXINDEX", retCode) + */ + __pyx_v_outmaxidx = 0; + + /* "talib/_stream.pxi":6334 + * outminidx = 0 + * outmaxidx = 0 + * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINMAXINDEX", retCode) + * return outminidx , outmaxidx + */ + __pyx_v_retCode = TA_MINMAXINDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outminidx), (&__pyx_v_outmaxidx)); + + /* "talib/_stream.pxi":6335 + * outmaxidx = 0 + * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) + * _ta_check_success("TA_MINMAXINDEX", retCode) # <<<<<<<<<<<<<< + * return outminidx , outmaxidx + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINMAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6336 + * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) + * _ta_check_success("TA_MINMAXINDEX", retCode) + * return outminidx , outmaxidx # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outminidx); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_outmaxidx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6340 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_587stream_MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_586stream_MINUS_DI[] = " MINUS_DI(high, low, close[, timeperiod=?])\n\n Minus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_587stream_MINUS_DI = {"stream_MINUS_DI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_587stream_MINUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_586stream_MINUS_DI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_587stream_MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MINUS_DI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MINUS_DI", 0, 3, 4, 1); __PYX_ERR(3, 6340, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MINUS_DI", 0, 3, 4, 2); __PYX_ERR(3, 6340, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MINUS_DI") < 0)) __PYX_ERR(3, 6340, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6340, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MINUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6340, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6340, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6340, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 6340, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_586stream_MINUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_586stream_MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MINUS_DI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":6363 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6364 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6364, __pyx_L1_error) + + /* "talib/_stream.pxi":6363 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6365 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6366 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6366, __pyx_L1_error) + + /* "talib/_stream.pxi":6365 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6367 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6368 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6368, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6367 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6369 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6370 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6371 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6371, __pyx_L1_error) + + /* "talib/_stream.pxi":6370 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6372 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6373 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6373, __pyx_L1_error) + + /* "talib/_stream.pxi":6372 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6374 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6375 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6375, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6374 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6376 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6377 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6378 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6378, __pyx_L1_error) + + /* "talib/_stream.pxi":6377 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6379 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6380 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6380, __pyx_L1_error) + + /* "talib/_stream.pxi":6379 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6381 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6382 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6382, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6381 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":6383 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":6384 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6385 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6386 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6386, __pyx_L1_error) + + /* "talib/_stream.pxi":6385 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":6387 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6388 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6388, __pyx_L1_error) + + /* "talib/_stream.pxi":6387 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6389 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DI", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6390 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINUS_DI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MINUS_DI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6391 + * outreal = NaN + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6392 + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6340 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6396 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_589stream_MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_588stream_MINUS_DM[] = " MINUS_DM(high, low[, timeperiod=?])\n\n Minus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_589stream_MINUS_DM = {"stream_MINUS_DM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_589stream_MINUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_588stream_MINUS_DM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_589stream_MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MINUS_DM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MINUS_DM", 0, 2, 3, 1); __PYX_ERR(3, 6396, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MINUS_DM") < 0)) __PYX_ERR(3, 6396, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6396, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MINUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6396, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6396, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_588stream_MINUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_588stream_MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MINUS_DM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":6418 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6419 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6419, __pyx_L1_error) + + /* "talib/_stream.pxi":6418 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6420 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6421 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6421, __pyx_L1_error) + + /* "talib/_stream.pxi":6420 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6422 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6423 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6423, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6422 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6424 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6425 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6426 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6426, __pyx_L1_error) + + /* "talib/_stream.pxi":6425 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6427 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6428 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6428, __pyx_L1_error) + + /* "talib/_stream.pxi":6427 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6429 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6430 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6430, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6429 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6431 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6432 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6433 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6434 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6434, __pyx_L1_error) + + /* "talib/_stream.pxi":6433 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6435 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DM", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6436 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MINUS_DM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MINUS_DM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6437 + * outreal = NaN + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MINUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6438 + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MINUS_DM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6396 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6442 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_591stream_MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_590stream_MOM[] = " MOM(real[, timeperiod=?])\n\n Momentum (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_591stream_MOM = {"stream_MOM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_591stream_MOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_590stream_MOM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_591stream_MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MOM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MOM") < 0)) __PYX_ERR(3, 6442, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6442, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MOM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6442, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6442, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_590stream_MOM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_590stream_MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MOM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6463 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6464 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6464, __pyx_L1_error) + + /* "talib/_stream.pxi":6463 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6465 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6466 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6466, __pyx_L1_error) + + /* "talib/_stream.pxi":6465 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6467 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6468 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6468, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6467 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6469 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6470 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6471 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MOM", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6472 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MOM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MOM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6473 + * outreal = NaN + * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MOM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6474 + * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MOM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6474, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6442 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6478 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_593stream_MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_592stream_MULT[] = " MULT(real0, real1)\n\n Vector Arithmetic Mult (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_593stream_MULT = {"stream_MULT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_593stream_MULT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_592stream_MULT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_593stream_MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_MULT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_MULT", 1, 2, 2, 1); __PYX_ERR(3, 6478, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_MULT") < 0)) __PYX_ERR(3, 6478, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_MULT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6478, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 6478, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 6478, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_592stream_MULT(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_592stream_MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_MULT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":6499 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6500 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6500, __pyx_L1_error) + + /* "talib/_stream.pxi":6499 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6501 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6502 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6502, __pyx_L1_error) + + /* "talib/_stream.pxi":6501 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6503 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6504 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6504, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6503 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":6505 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":6506 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6507 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6507, __pyx_L1_error) + + /* "talib/_stream.pxi":6506 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6508 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6509 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6509, __pyx_L1_error) + + /* "talib/_stream.pxi":6508 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6510 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6511 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6511, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6510 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":6512 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":6513 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":6514 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6515 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6515, __pyx_L1_error) + + /* "talib/_stream.pxi":6514 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6516 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MULT", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6517 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_MULT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_MULT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6518 + * outreal = NaN + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MULT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_MULT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6519 + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_MULT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6478 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6523 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_595stream_NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_594stream_NATR[] = " NATR(high, low, close[, timeperiod=?])\n\n Normalized Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_595stream_NATR = {"stream_NATR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_595stream_NATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_594stream_NATR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_595stream_NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_NATR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_NATR", 0, 3, 4, 1); __PYX_ERR(3, 6523, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_NATR", 0, 3, 4, 2); __PYX_ERR(3, 6523, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_NATR") < 0)) __PYX_ERR(3, 6523, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6523, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_NATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6523, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 6523, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_594stream_NATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_594stream_NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_NATR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":6546 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6547 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6547, __pyx_L1_error) + + /* "talib/_stream.pxi":6546 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6548 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6549 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6549, __pyx_L1_error) + + /* "talib/_stream.pxi":6548 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6550 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6551 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6551, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6550 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6552 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6553 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6554 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6554, __pyx_L1_error) + + /* "talib/_stream.pxi":6553 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6555 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6556 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6556, __pyx_L1_error) + + /* "talib/_stream.pxi":6555 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6557 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6558 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6558, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6557 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6559 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6560 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6561 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6561, __pyx_L1_error) + + /* "talib/_stream.pxi":6560 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6562 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6563 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6563, __pyx_L1_error) + + /* "talib/_stream.pxi":6562 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6564 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6565 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6565, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6564 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":6566 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":6567 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6568 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6569 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6569, __pyx_L1_error) + + /* "talib/_stream.pxi":6568 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":6570 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6571 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6571, __pyx_L1_error) + + /* "talib/_stream.pxi":6570 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6572 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_NATR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6573 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_NATR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_NATR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6574 + * outreal = NaN + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_NATR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_NATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6575 + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_NATR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6523 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6579 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_597stream_OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_596stream_OBV[] = " OBV(real, volume)\n\n On Balance Volume (Volume Indicators)\n\n Inputs:\n real: (any ndarray)\n prices: ['volume']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_597stream_OBV = {"stream_OBV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_597stream_OBV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_596stream_OBV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_597stream_OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + PyArrayObject *__pyx_v_volume = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_OBV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_volume,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_OBV", 1, 2, 2, 1); __PYX_ERR(3, 6579, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_OBV") < 0)) __PYX_ERR(3, 6579, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real = ((PyArrayObject *)values[0]); + __pyx_v_volume = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_OBV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6579, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6579, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(3, 6579, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_596stream_OBV(__pyx_self, __pyx_v_real, __pyx_v_volume); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_596stream_OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + double *__pyx_v_volume_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_OBV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + __Pyx_INCREF((PyObject *)__pyx_v_volume); + + /* "talib/_stream.pxi":6600 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6601 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6601, __pyx_L1_error) + + /* "talib/_stream.pxi":6600 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6602 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6603 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6603, __pyx_L1_error) + + /* "talib/_stream.pxi":6602 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6604 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6605 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6605, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6604 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6606 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6607 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6608 + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6608, __pyx_L1_error) + + /* "talib/_stream.pxi":6607 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("volume is not double") + * if volume.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6609 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6610 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6610, __pyx_L1_error) + + /* "talib/_stream.pxi":6609 + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") + * if volume.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6611 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6612 + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< + * volume_data = volume.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6612, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6611 + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + */ + } + + /* "talib/_stream.pxi":6613 + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * if length != volume.shape[0]: + */ + __pyx_v_volume_data = ((double *)__pyx_v_volume->data); + + /* "talib/_stream.pxi":6614 + * volume = PyArray_GETCONTIGUOUS(volume) + * volume_data = volume.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6615 + * volume_data = volume.data + * length = real.shape[0] + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6616 + * length = real.shape[0] + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6616, __pyx_L1_error) + + /* "talib/_stream.pxi":6615 + * volume_data = volume.data + * length = real.shape[0] + * if length != volume.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6617 + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_OBV", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6618 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_OBV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_OBV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_volume_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6619 + * outreal = NaN + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_OBV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_OBV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6620 + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_OBV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6579 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XDECREF((PyObject *)__pyx_v_volume); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_599stream_PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_598stream_PLUS_DI[] = " PLUS_DI(high, low, close[, timeperiod=?])\n\n Plus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_599stream_PLUS_DI = {"stream_PLUS_DI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_599stream_PLUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_598stream_PLUS_DI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_599stream_PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_PLUS_DI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_PLUS_DI", 0, 3, 4, 1); __PYX_ERR(3, 6624, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_PLUS_DI", 0, 3, 4, 2); __PYX_ERR(3, 6624, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_PLUS_DI") < 0)) __PYX_ERR(3, 6624, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6624, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_PLUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6624, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6624, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6624, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 6624, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_598stream_PLUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_598stream_PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_PLUS_DI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":6647 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6648 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6648, __pyx_L1_error) + + /* "talib/_stream.pxi":6647 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6649 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6650 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6650, __pyx_L1_error) + + /* "talib/_stream.pxi":6649 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6651 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6652 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6652, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6651 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6653 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6654 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6655 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6655, __pyx_L1_error) + + /* "talib/_stream.pxi":6654 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6656 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6657 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6657, __pyx_L1_error) + + /* "talib/_stream.pxi":6656 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6658 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6659 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6659, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6658 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6660 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6661 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6662 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6662, __pyx_L1_error) + + /* "talib/_stream.pxi":6661 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6663 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6664 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6664, __pyx_L1_error) + + /* "talib/_stream.pxi":6663 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6665 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6666 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6666, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6665 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":6667 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":6668 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6669 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6670 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6670, __pyx_L1_error) + + /* "talib/_stream.pxi":6669 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":6671 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6672 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6672, __pyx_L1_error) + + /* "talib/_stream.pxi":6671 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6673 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DI", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6674 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PLUS_DI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PLUS_DI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6675 + * outreal = NaN + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PLUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6676 + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6680 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_601stream_PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_600stream_PLUS_DM[] = " PLUS_DM(high, low[, timeperiod=?])\n\n Plus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_601stream_PLUS_DM = {"stream_PLUS_DM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_601stream_PLUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_600stream_PLUS_DM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_601stream_PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_PLUS_DM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_PLUS_DM", 0, 2, 3, 1); __PYX_ERR(3, 6680, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_PLUS_DM") < 0)) __PYX_ERR(3, 6680, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6680, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_PLUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6680, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6680, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6680, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_600stream_PLUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_600stream_PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_PLUS_DM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":6702 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6703 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6703, __pyx_L1_error) + + /* "talib/_stream.pxi":6702 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6704 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6705 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6705, __pyx_L1_error) + + /* "talib/_stream.pxi":6704 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6706 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6707 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6707, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6706 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6708 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6709 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6710 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6710, __pyx_L1_error) + + /* "talib/_stream.pxi":6709 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6711 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6712 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6712, __pyx_L1_error) + + /* "talib/_stream.pxi":6711 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6713 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6714 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6714, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6713 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6715 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6716 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6717 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6718 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6718, __pyx_L1_error) + + /* "talib/_stream.pxi":6717 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6719 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DM", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6720 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PLUS_DM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PLUS_DM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6721 + * outreal = NaN + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PLUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6722 + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PLUS_DM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6680 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6726 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_603stream_PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_602stream_PPO[] = " PPO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Percentage Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_603stream_PPO = {"stream_PPO", (PyCFunction)__pyx_pw_5talib_7_ta_lib_603stream_PPO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_602stream_PPO}; +static PyObject *__pyx_pw_5talib_7_ta_lib_603stream_PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_fastperiod; + int __pyx_v_slowperiod; + int __pyx_v_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_PPO (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_PPO") < 0)) __PYX_ERR(3, 6726, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6726, __pyx_L3_error) + } else { + __pyx_v_fastperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6726, __pyx_L3_error) + } else { + __pyx_v_slowperiod = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6726, __pyx_L3_error) + } else { + __pyx_v_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_PPO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6726, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6726, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_602stream_PPO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_602stream_PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_PPO", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6749 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6750 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6750, __pyx_L1_error) + + /* "talib/_stream.pxi":6749 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6751 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6752 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6752, __pyx_L1_error) + + /* "talib/_stream.pxi":6751 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6753 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6754 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6754, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6753 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6755 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6756 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6757 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PPO", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6758 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_PPO", retCode) + * return outreal + */ + __pyx_v_retCode = TA_PPO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6759 + * outreal = NaN + * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PPO", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_PPO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6760 + * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_PPO", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6726 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6764 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_605stream_ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_604stream_ROC[] = " ROC(real[, timeperiod=?])\n\n Rate of change : ((real/prevPrice)-1)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_605stream_ROC = {"stream_ROC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_605stream_ROC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_604stream_ROC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_605stream_ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ROC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ROC") < 0)) __PYX_ERR(3, 6764, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6764, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ROC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6764, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6764, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_604stream_ROC(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_604stream_ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ROC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6785 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6786 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6786, __pyx_L1_error) + + /* "talib/_stream.pxi":6785 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6787 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6788 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6788, __pyx_L1_error) + + /* "talib/_stream.pxi":6787 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6789 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6790 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6790, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6789 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6791 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6792 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6793 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROC", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6794 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6795 + * outreal = NaN + * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6796 + * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6764 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6800 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_607stream_ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_606stream_ROCP[] = " ROCP(real[, timeperiod=?])\n\n Rate of change Percentage: (real-prevPrice)/prevPrice (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_607stream_ROCP = {"stream_ROCP", (PyCFunction)__pyx_pw_5talib_7_ta_lib_607stream_ROCP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_606stream_ROCP}; +static PyObject *__pyx_pw_5talib_7_ta_lib_607stream_ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ROCP (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ROCP") < 0)) __PYX_ERR(3, 6800, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6800, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ROCP", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6800, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6800, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_606stream_ROCP(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_606stream_ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ROCP", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6821 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6822 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6822, __pyx_L1_error) + + /* "talib/_stream.pxi":6821 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6823 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6824 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6824, __pyx_L1_error) + + /* "talib/_stream.pxi":6823 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6825 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6826 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6826, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6825 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6827 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6828 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6829 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCP", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6830 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCP", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6831 + * outreal = NaN + * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCP", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6832 + * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCP", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6800 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6836 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_609stream_ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_608stream_ROCR[] = " ROCR(real[, timeperiod=?])\n\n Rate of change ratio: (real/prevPrice) (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_609stream_ROCR = {"stream_ROCR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_609stream_ROCR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_608stream_ROCR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_609stream_ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ROCR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ROCR") < 0)) __PYX_ERR(3, 6836, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6836, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ROCR", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6836, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6836, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_608stream_ROCR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_608stream_ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ROCR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6857 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6858 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6858, __pyx_L1_error) + + /* "talib/_stream.pxi":6857 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6859 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6860 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6860, __pyx_L1_error) + + /* "talib/_stream.pxi":6859 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6861 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6862 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6862, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6861 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6863 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6864 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6865 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6866 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6867 + * outreal = NaN + * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6868 + * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6836 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6872 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_611stream_ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_610stream_ROCR100[] = " ROCR100(real[, timeperiod=?])\n\n Rate of change ratio 100 scale: (real/prevPrice)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_611stream_ROCR100 = {"stream_ROCR100", (PyCFunction)__pyx_pw_5talib_7_ta_lib_611stream_ROCR100, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_610stream_ROCR100}; +static PyObject *__pyx_pw_5talib_7_ta_lib_611stream_ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ROCR100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ROCR100") < 0)) __PYX_ERR(3, 6872, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6872, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ROCR100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6872, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6872, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_610stream_ROCR100(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_610stream_ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ROCR100", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6893 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6894 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6894, __pyx_L1_error) + + /* "talib/_stream.pxi":6893 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6895 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6896 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6896, __pyx_L1_error) + + /* "talib/_stream.pxi":6895 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6897 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6898 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6898, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6897 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6899 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6900 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6901 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR100", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6902 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ROCR100", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ROCR100((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6903 + * outreal = NaN + * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR100", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ROCR100, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6904 + * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ROCR100", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6872 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_613stream_RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_612stream_RSI[] = " RSI(real[, timeperiod=?])\n\n Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_613stream_RSI = {"stream_RSI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_613stream_RSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_612stream_RSI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_613stream_RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_RSI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_RSI") < 0)) __PYX_ERR(3, 6908, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 6908, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_RSI", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6908, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 6908, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_612stream_RSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_612stream_RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_RSI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":6929 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6930 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6930, __pyx_L1_error) + + /* "talib/_stream.pxi":6929 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6931 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6932 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6932, __pyx_L1_error) + + /* "talib/_stream.pxi":6931 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6933 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6934 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6934, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6933 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":6935 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":6936 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":6937 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_RSI", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6938 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_RSI", retCode) + * return outreal + */ + __pyx_v_retCode = TA_RSI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6939 + * outreal = NaN + * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_RSI", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_RSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6940 + * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_RSI", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6940, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6944 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_615stream_SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_614stream_SAR[] = " SAR(high, low[, acceleration=?, maximum=?])\n\n Parabolic SAR (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n acceleration: 0.02\n maximum: 0.2\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_615stream_SAR = {"stream_SAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_615stream_SAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_614stream_SAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_615stream_SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + double __pyx_v_acceleration; + double __pyx_v_maximum; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_acceleration,&__pyx_n_s_maximum,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_SAR", 0, 2, 4, 1); __PYX_ERR(3, 6944, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceleration); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maximum); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_SAR") < 0)) __PYX_ERR(3, 6944, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_acceleration = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_acceleration == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6944, __pyx_L3_error) + } else { + __pyx_v_acceleration = ((double)0.02); + } + if (values[3]) { + __pyx_v_maximum = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_maximum == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6944, __pyx_L3_error) + } else { + __pyx_v_maximum = ((double)0.2); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_SAR", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6944, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6944, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6944, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_614stream_SAR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_acceleration, __pyx_v_maximum); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_614stream_SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":6967 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6968 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6968, __pyx_L1_error) + + /* "talib/_stream.pxi":6967 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6969 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6970 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6970, __pyx_L1_error) + + /* "talib/_stream.pxi":6969 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6971 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6972 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6972, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6971 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":6973 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":6974 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6975 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6975, __pyx_L1_error) + + /* "talib/_stream.pxi":6974 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":6976 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6977 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6977, __pyx_L1_error) + + /* "talib/_stream.pxi":6976 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":6978 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6979 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 6979, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6978 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":6980 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":6981 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":6982 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":6983 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 6983, __pyx_L1_error) + + /* "talib/_stream.pxi":6982 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":6984 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":6985 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SAR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_acceleration, __pyx_v_maximum, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":6986 + * outreal = NaN + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":6987 + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6944 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":6991 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_617stream_SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_616stream_SAREXT[] = " SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?])\n\n Parabolic SAR - Extended (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n startvalue: 0\n offsetonreverse: 0\n accelerationinitlong: 0.02\n accelerationlong: 0.02\n accelerationmaxlong: 0.2\n accelerationinitshort: 0.02\n accelerationshort: 0.02\n accelerationmaxshort: 0.2\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_617stream_SAREXT = {"stream_SAREXT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_617stream_SAREXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_616stream_SAREXT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_617stream_SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + double __pyx_v_startvalue; + double __pyx_v_offsetonreverse; + double __pyx_v_accelerationinitlong; + double __pyx_v_accelerationlong; + double __pyx_v_accelerationmaxlong; + double __pyx_v_accelerationinitshort; + double __pyx_v_accelerationshort; + double __pyx_v_accelerationmaxshort; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SAREXT (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_startvalue,&__pyx_n_s_offsetonreverse,&__pyx_n_s_accelerationinitlong,&__pyx_n_s_accelerationlong,&__pyx_n_s_accelerationmaxlong,&__pyx_n_s_accelerationinitshort,&__pyx_n_s_accelerationshort,&__pyx_n_s_accelerationmaxshort,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_SAREXT", 0, 2, 10, 1); __PYX_ERR(3, 6991, __pyx_L3_error) + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startvalue); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offsetonreverse); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitlong); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationlong); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxlong); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitshort); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationshort); + if (value) { values[8] = value; kw_args--; } + } + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxshort); + if (value) { values[9] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_SAREXT") < 0)) __PYX_ERR(3, 6991, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + if (values[2]) { + __pyx_v_startvalue = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_startvalue == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_startvalue = ((double)-4e37); + } + if (values[3]) { + __pyx_v_offsetonreverse = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_offsetonreverse == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_offsetonreverse = ((double)-4e37); + } + if (values[4]) { + __pyx_v_accelerationinitlong = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_accelerationinitlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationinitlong = ((double)-4e37); + } + if (values[5]) { + __pyx_v_accelerationlong = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_accelerationlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationlong = ((double)-4e37); + } + if (values[6]) { + __pyx_v_accelerationmaxlong = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_accelerationmaxlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationmaxlong = ((double)-4e37); + } + if (values[7]) { + __pyx_v_accelerationinitshort = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_accelerationinitshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationinitshort = ((double)-4e37); + } + if (values[8]) { + __pyx_v_accelerationshort = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_accelerationshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationshort = ((double)-4e37); + } + if (values[9]) { + __pyx_v_accelerationmaxshort = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_accelerationmaxshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 6991, __pyx_L3_error) + } else { + __pyx_v_accelerationmaxshort = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_SAREXT", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6991, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 6991, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 6991, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_616stream_SAREXT(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_616stream_SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SAREXT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + + /* "talib/_stream.pxi":7020 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7021 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7021, __pyx_L1_error) + + /* "talib/_stream.pxi":7020 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7022 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7023 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7023, __pyx_L1_error) + + /* "talib/_stream.pxi":7022 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7024 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7025 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7025, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7024 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7026 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7027 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7028 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7028, __pyx_L1_error) + + /* "talib/_stream.pxi":7027 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7029 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7030 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7030, __pyx_L1_error) + + /* "talib/_stream.pxi":7029 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7031 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7032 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7032, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7031 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7033 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7034 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7035 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7036 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7036, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7036, __pyx_L1_error) + + /* "talib/_stream.pxi":7035 + * low_data = low.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7037 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAREXT", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7038 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SAREXT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SAREXT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7039 + * outreal = NaN + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAREXT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SAREXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7040 + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SAREXT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":6991 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7044 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_619stream_SIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_618stream_SIN[] = " SIN(real)\n\n Vector Trigonometric Sin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_619stream_SIN = {"stream_SIN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_619stream_SIN, METH_O, __pyx_doc_5talib_7_ta_lib_618stream_SIN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_619stream_SIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SIN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7044, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_618stream_SIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_618stream_SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SIN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7063 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7064 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7064, __pyx_L1_error) + + /* "talib/_stream.pxi":7063 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7065 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7066 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7066, __pyx_L1_error) + + /* "talib/_stream.pxi":7065 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7067 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7068 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7068, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7067 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7069 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7070 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7071 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SIN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7072 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SIN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7073 + * outreal = NaN + * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SIN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7074 + * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SIN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7044 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SIN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7078 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_621stream_SINH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_620stream_SINH[] = " SINH(real)\n\n Vector Trigonometric Sinh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_621stream_SINH = {"stream_SINH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_621stream_SINH, METH_O, __pyx_doc_5talib_7_ta_lib_620stream_SINH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_621stream_SINH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SINH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7078, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_620stream_SINH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_620stream_SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SINH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7097 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7098 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7098, __pyx_L1_error) + + /* "talib/_stream.pxi":7097 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7099 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7100 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7100, __pyx_L1_error) + + /* "talib/_stream.pxi":7099 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7101 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7102 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7102, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7101 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7103 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7104 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7105 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SINH", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7106 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SINH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SINH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7107 + * outreal = NaN + * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SINH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SINH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7108 + * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SINH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7078 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SINH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7112 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_623stream_SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_622stream_SMA[] = " SMA(real[, timeperiod=?])\n\n Simple Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_623stream_SMA = {"stream_SMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_623stream_SMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_622stream_SMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_623stream_SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_SMA") < 0)) __PYX_ERR(3, 7112, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7112, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_SMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7112, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7112, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_622stream_SMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_622stream_SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7133 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7134 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7134, __pyx_L1_error) + + /* "talib/_stream.pxi":7133 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7135 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7136 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7136, __pyx_L1_error) + + /* "talib/_stream.pxi":7135 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7137 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7138 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7138, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7137 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7139 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7140 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7141 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7142 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7143 + * outreal = NaN + * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7144 + * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7112 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7148 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_625stream_SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_624stream_SQRT[] = " SQRT(real)\n\n Vector Square Root (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_625stream_SQRT = {"stream_SQRT", (PyCFunction)__pyx_pw_5talib_7_ta_lib_625stream_SQRT, METH_O, __pyx_doc_5talib_7_ta_lib_624stream_SQRT}; +static PyObject *__pyx_pw_5talib_7_ta_lib_625stream_SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SQRT (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7148, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_624stream_SQRT(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_624stream_SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SQRT", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7167 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7168 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7168, __pyx_L1_error) + + /* "talib/_stream.pxi":7167 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7169 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7170 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7170, __pyx_L1_error) + + /* "talib/_stream.pxi":7169 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7171 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7172 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7172, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7171 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7173 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7174 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7175 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SQRT", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7176 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SQRT", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SQRT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7177 + * outreal = NaN + * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SQRT", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SQRT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7178 + * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SQRT", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7148 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SQRT", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7182 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_627stream_STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_626stream_STDDEV[] = " STDDEV(real[, timeperiod=?, nbdev=?])\n\n Standard Deviation (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_627stream_STDDEV = {"stream_STDDEV", (PyCFunction)__pyx_pw_5talib_7_ta_lib_627stream_STDDEV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_626stream_STDDEV}; +static PyObject *__pyx_pw_5talib_7_ta_lib_627stream_STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdev; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_STDDEV (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_STDDEV") < 0)) __PYX_ERR(3, 7182, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7182, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7182, __pyx_L3_error) + } else { + __pyx_v_nbdev = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_STDDEV", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7182, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7182, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_626stream_STDDEV(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_626stream_STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_STDDEV", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7204 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7205 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7205, __pyx_L1_error) + + /* "talib/_stream.pxi":7204 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7206 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7207 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7207, __pyx_L1_error) + + /* "talib/_stream.pxi":7206 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7208 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7209 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7209, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7208 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7210 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7211 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7212 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_STDDEV", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7213 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STDDEV", retCode) + * return outreal + */ + __pyx_v_retCode = TA_STDDEV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7214 + * outreal = NaN + * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_STDDEV", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STDDEV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7215 + * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_STDDEV", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7182 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7219 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_629stream_STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_628stream_STOCH[] = " STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?])\n\n Stochastic (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n slowk_period: 3\n slowk_matype: 0\n slowd_period: 3\n slowd_matype: 0\n Outputs:\n slowk\n slowd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_629stream_STOCH = {"stream_STOCH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_629stream_STOCH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_628stream_STOCH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_629stream_STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_fastk_period; + int __pyx_v_slowk_period; + int __pyx_v_slowk_matype; + int __pyx_v_slowd_period; + int __pyx_v_slowd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_STOCH (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_slowk_period,&__pyx_n_s_slowk_matype,&__pyx_n_s_slowd_period,&__pyx_n_s_slowd_matype,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_STOCH", 0, 3, 8, 1); __PYX_ERR(3, 7219, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_STOCH", 0, 3, 8, 2); __PYX_ERR(3, 7219, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_period); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_matype); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_period); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_matype); + if (value) { values[7] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_STOCH") < 0)) __PYX_ERR(3, 7219, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7219, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_slowk_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7219, __pyx_L3_error) + } else { + __pyx_v_slowk_period = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_slowk_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowk_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7219, __pyx_L3_error) + } else { + __pyx_v_slowk_matype = ((int)0); + } + if (values[6]) { + __pyx_v_slowd_period = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_slowd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7219, __pyx_L3_error) + } else { + __pyx_v_slowd_period = ((int)-2147483648); + } + if (values[7]) { + __pyx_v_slowd_matype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_slowd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7219, __pyx_L3_error) + } else { + __pyx_v_slowd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_STOCH", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7219, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7219, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7219, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7219, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_628stream_STOCH(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_628stream_STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outslowk; + double __pyx_v_outslowd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_STOCH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7248 + * double outslowk + * double outslowd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7249 + * double outslowd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7249, __pyx_L1_error) + + /* "talib/_stream.pxi":7248 + * double outslowk + * double outslowd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7251, __pyx_L1_error) + + /* "talib/_stream.pxi":7250 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7253 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7253, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7252 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7254 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7256, __pyx_L1_error) + + /* "talib/_stream.pxi":7255 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7258, __pyx_L1_error) + + /* "talib/_stream.pxi":7257 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7260 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7260, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7259 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7261 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7263, __pyx_L1_error) + + /* "talib/_stream.pxi":7262 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7265, __pyx_L1_error) + + /* "talib/_stream.pxi":7264 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7267 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7267, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7266 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7268 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7269 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7270 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7271 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7271, __pyx_L1_error) + + /* "talib/_stream.pxi":7270 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7272 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outslowk = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7273 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outslowk = NaN + * outslowd = NaN + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7273, __pyx_L1_error) + + /* "talib/_stream.pxi":7272 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outslowk = NaN + */ + } + + /* "talib/_stream.pxi":7274 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outslowk = NaN # <<<<<<<<<<<<<< + * outslowd = NaN + * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) + */ + __pyx_v_outslowk = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7275 + * raise Exception("input lengths are different") + * outslowk = NaN + * outslowd = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) + * _ta_check_success("TA_STOCH", retCode) + */ + __pyx_v_outslowd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7276 + * outslowk = NaN + * outslowd = NaN + * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCH", retCode) + * return outslowk , outslowd + */ + __pyx_v_retCode = TA_STOCH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outslowk), (&__pyx_v_outslowd)); + + /* "talib/_stream.pxi":7277 + * outslowd = NaN + * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) + * _ta_check_success("TA_STOCH", retCode) # <<<<<<<<<<<<<< + * return outslowk , outslowd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7278 + * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) + * _ta_check_success("TA_STOCH", retCode) + * return outslowk , outslowd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outslowk); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outslowd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7219 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7282 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_631stream_STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_630stream_STOCHF[] = " STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Fast (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_631stream_STOCHF = {"stream_STOCHF", (PyCFunction)__pyx_pw_5talib_7_ta_lib_631stream_STOCHF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_630stream_STOCHF}; +static PyObject *__pyx_pw_5talib_7_ta_lib_631stream_STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_fastk_period; + int __pyx_v_fastd_period; + int __pyx_v_fastd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_STOCHF (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_STOCHF", 0, 3, 6, 1); __PYX_ERR(3, 7282, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_STOCHF", 0, 3, 6, 2); __PYX_ERR(3, 7282, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_STOCHF") < 0)) __PYX_ERR(3, 7282, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7282, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7282, __pyx_L3_error) + } else { + __pyx_v_fastd_period = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7282, __pyx_L3_error) + } else { + __pyx_v_fastd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_STOCHF", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7282, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7282, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_630stream_STOCHF(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_630stream_STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outfastk; + double __pyx_v_outfastd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_STOCHF", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7309 + * double outfastk + * double outfastd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7310 + * double outfastd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7310, __pyx_L1_error) + + /* "talib/_stream.pxi":7309 + * double outfastk + * double outfastd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7311 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7312 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7312, __pyx_L1_error) + + /* "talib/_stream.pxi":7311 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7313 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7314 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7314, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7313 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7315 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7316 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7317 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7317, __pyx_L1_error) + + /* "talib/_stream.pxi":7316 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7318 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7319 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7319, __pyx_L1_error) + + /* "talib/_stream.pxi":7318 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7320 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7321 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7321, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7320 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7322 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7323 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7324 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7324, __pyx_L1_error) + + /* "talib/_stream.pxi":7323 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7325 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7326 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7326, __pyx_L1_error) + + /* "talib/_stream.pxi":7325 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7327 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7328 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7328, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7327 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7329 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7330 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7331 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7332 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7332, __pyx_L1_error) + + /* "talib/_stream.pxi":7331 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7333 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outfastk = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7334 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outfastk = NaN + * outfastd = NaN + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7334, __pyx_L1_error) + + /* "talib/_stream.pxi":7333 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outfastk = NaN + */ + } + + /* "talib/_stream.pxi":7335 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outfastk = NaN # <<<<<<<<<<<<<< + * outfastd = NaN + * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + */ + __pyx_v_outfastk = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7336 + * raise Exception("input lengths are different") + * outfastk = NaN + * outfastd = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHF", retCode) + */ + __pyx_v_outfastd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7337 + * outfastk = NaN + * outfastd = NaN + * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCHF", retCode) + * return outfastk , outfastd + */ + __pyx_v_retCode = TA_STOCHF((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outfastk), (&__pyx_v_outfastd)); + + /* "talib/_stream.pxi":7338 + * outfastd = NaN + * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHF", retCode) # <<<<<<<<<<<<<< + * return outfastk , outfastd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCHF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7339 + * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHF", retCode) + * return outfastk , outfastd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outfastk); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfastd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7282 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7343 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_633stream_STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_632stream_STOCHRSI[] = " STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_633stream_STOCHRSI = {"stream_STOCHRSI", (PyCFunction)__pyx_pw_5talib_7_ta_lib_633stream_STOCHRSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_632stream_STOCHRSI}; +static PyObject *__pyx_pw_5talib_7_ta_lib_633stream_STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + int __pyx_v_fastk_period; + int __pyx_v_fastd_period; + int __pyx_v_fastd_matype; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_STOCHRSI (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_STOCHRSI") < 0)) __PYX_ERR(3, 7343, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7343, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7343, __pyx_L3_error) + } else { + __pyx_v_fastk_period = ((int)-2147483648); + } + if (values[3]) { + __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7343, __pyx_L3_error) + } else { + __pyx_v_fastd_period = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7343, __pyx_L3_error) + } else { + __pyx_v_fastd_matype = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_STOCHRSI", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7343, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7343, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_632stream_STOCHRSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_632stream_STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outfastk; + double __pyx_v_outfastd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("stream_STOCHRSI", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7369 + * double outfastk + * double outfastd + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7370 + * double outfastd + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7370, __pyx_L1_error) + + /* "talib/_stream.pxi":7369 + * double outfastk + * double outfastd + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7371 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7372 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7372, __pyx_L1_error) + + /* "talib/_stream.pxi":7371 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7373 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7374 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7374, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7373 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7375 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outfastk = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7376 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outfastk = NaN + * outfastd = NaN + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7377 + * real_data = real.data + * length = real.shape[0] + * outfastk = NaN # <<<<<<<<<<<<<< + * outfastd = NaN + * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + */ + __pyx_v_outfastk = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7378 + * length = real.shape[0] + * outfastk = NaN + * outfastd = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHRSI", retCode) + */ + __pyx_v_outfastd = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7379 + * outfastk = NaN + * outfastd = NaN + * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_STOCHRSI", retCode) + * return outfastk , outfastd + */ + __pyx_v_retCode = TA_STOCHRSI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outfastk), (&__pyx_v_outfastd)); + + /* "talib/_stream.pxi":7380 + * outfastd = NaN + * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHRSI", retCode) # <<<<<<<<<<<<<< + * return outfastk , outfastd + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_STOCHRSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7381 + * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) + * _ta_check_success("TA_STOCHRSI", retCode) + * return outfastk , outfastd # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outfastk); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfastd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7343 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("talib._ta_lib.stream_STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_635stream_SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_634stream_SUB[] = " SUB(real0, real1)\n\n Vector Arithmetic Substraction (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_635stream_SUB = {"stream_SUB", (PyCFunction)__pyx_pw_5talib_7_ta_lib_635stream_SUB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_634stream_SUB}; +static PyObject *__pyx_pw_5talib_7_ta_lib_635stream_SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real0 = 0; + PyArrayObject *__pyx_v_real1 = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SUB (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_SUB", 1, 2, 2, 1); __PYX_ERR(3, 7385, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_SUB") < 0)) __PYX_ERR(3, 7385, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_real0 = ((PyArrayObject *)values[0]); + __pyx_v_real1 = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_SUB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7385, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(3, 7385, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(3, 7385, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_634stream_SUB(__pyx_self, __pyx_v_real0, __pyx_v_real1); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_634stream_SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real0_data; + double *__pyx_v_real1_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SUB", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real0); + __Pyx_INCREF((PyObject *)__pyx_v_real1); + + /* "talib/_stream.pxi":7406 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7407 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7407, __pyx_L1_error) + + /* "talib/_stream.pxi":7406 + * int outnbelement + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real0 is not double") + * if real0.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7408 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7409 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7409, __pyx_L1_error) + + /* "talib/_stream.pxi":7408 + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") + * if real0.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7410 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7411 + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7411, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7410 + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + */ + } + + /* "talib/_stream.pxi":7412 + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + */ + __pyx_v_real0_data = ((double *)__pyx_v_real0->data); + + /* "talib/_stream.pxi":7413 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7414 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7414, __pyx_L1_error) + + /* "talib/_stream.pxi":7413 + * real0 = PyArray_GETCONTIGUOUS(real0) + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real1 is not double") + * if real1.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7415 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7416 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7416, __pyx_L1_error) + + /* "talib/_stream.pxi":7415 + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") + * if real1.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7417 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7418 + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< + * real1_data = real1.data + * length = real0.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7418, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7417 + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + */ + } + + /* "talib/_stream.pxi":7419 + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data # <<<<<<<<<<<<<< + * length = real0.shape[0] + * if length != real1.shape[0]: + */ + __pyx_v_real1_data = ((double *)__pyx_v_real1->data); + + /* "talib/_stream.pxi":7420 + * real1 = PyArray_GETCONTIGUOUS(real1) + * real1_data = real1.data + * length = real0.shape[0] # <<<<<<<<<<<<<< + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_real0->dimensions[0]); + + /* "talib/_stream.pxi":7421 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7422 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7422, __pyx_L1_error) + + /* "talib/_stream.pxi":7421 + * real1_data = real1.data + * length = real0.shape[0] + * if length != real1.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7423 + * if length != real1.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUB", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7424 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SUB", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SUB((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7425 + * outreal = NaN + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUB", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SUB, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7426 + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUB", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real0); + __Pyx_XDECREF((PyObject *)__pyx_v_real1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7430 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_637stream_SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_636stream_SUM[] = " SUM(real[, timeperiod=?])\n\n Summation (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_637stream_SUM = {"stream_SUM", (PyCFunction)__pyx_pw_5talib_7_ta_lib_637stream_SUM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_636stream_SUM}; +static PyObject *__pyx_pw_5talib_7_ta_lib_637stream_SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_SUM (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_SUM") < 0)) __PYX_ERR(3, 7430, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7430, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_SUM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7430, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7430, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_636stream_SUM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_636stream_SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_SUM", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7451 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7452 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7452, __pyx_L1_error) + + /* "talib/_stream.pxi":7451 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7453 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7454 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2207, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7454, __pyx_L1_error) + + /* "talib/_stream.pxi":7453 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7455 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7456 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7456, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7455 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7457 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7458 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7459 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUM", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7460 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_SUM", retCode) + * return outreal + */ + __pyx_v_retCode = TA_SUM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7461 + * outreal = NaN + * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUM", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_SUM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7462 + * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_SUM", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7430 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7466 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_639stream_T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_638stream_T3[] = " T3(real[, timeperiod=?, vfactor=?])\n\n Triple Exponential Moving Average (T3) (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n vfactor: 0.7\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_639stream_T3 = {"stream_T3", (PyCFunction)__pyx_pw_5talib_7_ta_lib_639stream_T3, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_638stream_T3}; +static PyObject *__pyx_pw_5talib_7_ta_lib_639stream_T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_vfactor; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_T3 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_vfactor,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vfactor); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_T3") < 0)) __PYX_ERR(3, 7466, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7466, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_vfactor = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_vfactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7466, __pyx_L3_error) + } else { + __pyx_v_vfactor = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_T3", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7466, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_T3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7466, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_638stream_T3(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_vfactor); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_638stream_T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_T3", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7488 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7489 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2208, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7489, __pyx_L1_error) + + /* "talib/_stream.pxi":7488 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7490 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7491 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2209, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7491, __pyx_L1_error) + + /* "talib/_stream.pxi":7490 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7492 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7493 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7493, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7492 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7494 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7495 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7496 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_T3", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7497 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_T3", retCode) + * return outreal + */ + __pyx_v_retCode = TA_T3((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_vfactor, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7498 + * outreal = NaN + * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_T3", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_T3, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7499 + * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_T3", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7466 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_T3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7503 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_641stream_TAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_640stream_TAN[] = " TAN(real)\n\n Vector Trigonometric Tan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_641stream_TAN = {"stream_TAN", (PyCFunction)__pyx_pw_5talib_7_ta_lib_641stream_TAN, METH_O, __pyx_doc_5talib_7_ta_lib_640stream_TAN}; +static PyObject *__pyx_pw_5talib_7_ta_lib_641stream_TAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TAN (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7503, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_640stream_TAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_640stream_TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TAN", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7522 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7523 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2210, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7523, __pyx_L1_error) + + /* "talib/_stream.pxi":7522 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7524 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7525 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2211, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7525, __pyx_L1_error) + + /* "talib/_stream.pxi":7524 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7526 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7527 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7527, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7526 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7528 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7529 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7530 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TAN", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7531 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TAN", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7532 + * outreal = NaN + * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TAN", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7533 + * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TAN", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7503 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TAN", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_643stream_TANH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_642stream_TANH[] = " TANH(real)\n\n Vector Trigonometric Tanh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_643stream_TANH = {"stream_TANH", (PyCFunction)__pyx_pw_5talib_7_ta_lib_643stream_TANH, METH_O, __pyx_doc_5talib_7_ta_lib_642stream_TANH}; +static PyObject *__pyx_pw_5talib_7_ta_lib_643stream_TANH(PyObject *__pyx_self, PyObject *__pyx_v_real) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TANH (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7537, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_642stream_TANH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_642stream_TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TANH", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7556 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7557 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2212, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7557, __pyx_L1_error) + + /* "talib/_stream.pxi":7556 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7558 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7559 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2213, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7559, __pyx_L1_error) + + /* "talib/_stream.pxi":7558 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7560 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7561 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7561, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7560 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7562 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7563 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7564 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TANH", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7565 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TANH", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TANH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7566 + * outreal = NaN + * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TANH", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TANH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7567 + * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TANH", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TANH", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_645stream_TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_644stream_TEMA[] = " TEMA(real[, timeperiod=?])\n\n Triple Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_645stream_TEMA = {"stream_TEMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_645stream_TEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_644stream_TEMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_645stream_TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TEMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TEMA") < 0)) __PYX_ERR(3, 7571, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7571, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7571, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7571, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_644stream_TEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_644stream_TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TEMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7592 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7593 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2214, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7593, __pyx_L1_error) + + /* "talib/_stream.pxi":7592 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7594 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7595 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7595, __pyx_L1_error) + + /* "talib/_stream.pxi":7594 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7596 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7597 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7597, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7596 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7598 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7599 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7600 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TEMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7601 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TEMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TEMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7602 + * outreal = NaN + * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TEMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7603 + * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TEMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7607 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_647stream_TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_646stream_TRANGE[] = " TRANGE(high, low, close)\n\n True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_647stream_TRANGE = {"stream_TRANGE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_647stream_TRANGE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_646stream_TRANGE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_647stream_TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TRANGE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_TRANGE", 1, 3, 3, 1); __PYX_ERR(3, 7607, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_TRANGE", 1, 3, 3, 2); __PYX_ERR(3, 7607, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TRANGE") < 0)) __PYX_ERR(3, 7607, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TRANGE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7607, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7607, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7607, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7607, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_646stream_TRANGE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_646stream_TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TRANGE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7628 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7629 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2216, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7629, __pyx_L1_error) + + /* "talib/_stream.pxi":7628 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7630 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7631 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2217, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7631, __pyx_L1_error) + + /* "talib/_stream.pxi":7630 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7632 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7633 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7633, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7632 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7634 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7635 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7636 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2218, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7636, __pyx_L1_error) + + /* "talib/_stream.pxi":7635 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7637 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7638 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7638, __pyx_L1_error) + + /* "talib/_stream.pxi":7637 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7639 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7640 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7640, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7639 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7641 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7642 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7643 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7643, __pyx_L1_error) + + /* "talib/_stream.pxi":7642 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7644 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7645 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7645, __pyx_L1_error) + + /* "talib/_stream.pxi":7644 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7646 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7647 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7647, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7646 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7648 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7649 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7650 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7651 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7651, __pyx_L1_error) + + /* "talib/_stream.pxi":7650 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7652 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7653 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7653, __pyx_L1_error) + + /* "talib/_stream.pxi":7652 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7654 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRANGE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7655 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRANGE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRANGE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7656 + * outreal = NaN + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRANGE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRANGE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7657 + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRANGE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7607 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7661 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_649stream_TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_648stream_TRIMA[] = " TRIMA(real[, timeperiod=?])\n\n Triangular Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_649stream_TRIMA = {"stream_TRIMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_649stream_TRIMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_648stream_TRIMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_649stream_TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TRIMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TRIMA") < 0)) __PYX_ERR(3, 7661, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7661, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TRIMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7661, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7661, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_648stream_TRIMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_648stream_TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TRIMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7682 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7683 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7683, __pyx_L1_error) + + /* "talib/_stream.pxi":7682 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7684 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7685 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7685, __pyx_L1_error) + + /* "talib/_stream.pxi":7684 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7686 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7687 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7687, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7686 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7688 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7689 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7690 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7691 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRIMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRIMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7692 + * outreal = NaN + * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIMA", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRIMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7693 + * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIMA", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7661 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7697 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_651stream_TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_650stream_TRIX[] = " TRIX(real[, timeperiod=?])\n\n 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_651stream_TRIX = {"stream_TRIX", (PyCFunction)__pyx_pw_5talib_7_ta_lib_651stream_TRIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_650stream_TRIX}; +static PyObject *__pyx_pw_5talib_7_ta_lib_651stream_TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TRIX (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TRIX") < 0)) __PYX_ERR(3, 7697, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7697, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TRIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7697, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7697, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_650stream_TRIX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_650stream_TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TRIX", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7718 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7719 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7719, __pyx_L1_error) + + /* "talib/_stream.pxi":7718 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7720 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7721 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7721, __pyx_L1_error) + + /* "talib/_stream.pxi":7720 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7722 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7723 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7723, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7722 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7724 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7725 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7726 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIX", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7727 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TRIX", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TRIX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7728 + * outreal = NaN + * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIX", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TRIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7729 + * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TRIX", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7697 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7733 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_653stream_TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_652stream_TSF[] = " TSF(real[, timeperiod=?])\n\n Time Series Forecast (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_653stream_TSF = {"stream_TSF", (PyCFunction)__pyx_pw_5talib_7_ta_lib_653stream_TSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_652stream_TSF}; +static PyObject *__pyx_pw_5talib_7_ta_lib_653stream_TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TSF (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TSF") < 0)) __PYX_ERR(3, 7733, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7733, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TSF", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7733, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7733, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_652stream_TSF(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_652stream_TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TSF", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7754 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7755 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2228, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7755, __pyx_L1_error) + + /* "talib/_stream.pxi":7754 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7756 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7757 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2229, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7757, __pyx_L1_error) + + /* "talib/_stream.pxi":7756 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7758 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7759 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7759, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7758 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7760 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7761 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7762 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TSF", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7763 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TSF", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TSF((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7764 + * outreal = NaN + * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TSF", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TSF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7765 + * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TSF", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7733 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7769 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_655stream_TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_654stream_TYPPRICE[] = " TYPPRICE(high, low, close)\n\n Typical Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_655stream_TYPPRICE = {"stream_TYPPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_655stream_TYPPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_654stream_TYPPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_655stream_TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_TYPPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_TYPPRICE", 1, 3, 3, 1); __PYX_ERR(3, 7769, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_TYPPRICE", 1, 3, 3, 2); __PYX_ERR(3, 7769, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_TYPPRICE") < 0)) __PYX_ERR(3, 7769, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_TYPPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7769, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7769, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7769, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7769, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_654stream_TYPPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_654stream_TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_TYPPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7790 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7791 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2230, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7791, __pyx_L1_error) + + /* "talib/_stream.pxi":7790 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7792 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7793 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2231, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7793, __pyx_L1_error) + + /* "talib/_stream.pxi":7792 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7794 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7795 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7795, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7794 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7796 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7797 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7798 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7798, __pyx_L1_error) + + /* "talib/_stream.pxi":7797 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7799 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7800 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2233, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7800, __pyx_L1_error) + + /* "talib/_stream.pxi":7799 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7801 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7802 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7802, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7801 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7803 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7804 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7805 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2234, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7805, __pyx_L1_error) + + /* "talib/_stream.pxi":7804 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7806 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7807 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2235, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7807, __pyx_L1_error) + + /* "talib/_stream.pxi":7806 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7808 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7809 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7809, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7808 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7810 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7811 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7812 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7813 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2236, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7813, __pyx_L1_error) + + /* "talib/_stream.pxi":7812 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7814 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7815 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2237, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7815, __pyx_L1_error) + + /* "talib/_stream.pxi":7814 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7816 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TYPPRICE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7817 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_TYPPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_TYPPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7818 + * outreal = NaN + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TYPPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_TYPPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7819 + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_TYPPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7769 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_657stream_ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_656stream_ULTOSC[] = " ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?])\n\n Ultimate Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod1: 7\n timeperiod2: 14\n timeperiod3: 28\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_657stream_ULTOSC = {"stream_ULTOSC", (PyCFunction)__pyx_pw_5talib_7_ta_lib_657stream_ULTOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_656stream_ULTOSC}; +static PyObject *__pyx_pw_5talib_7_ta_lib_657stream_ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod1; + int __pyx_v_timeperiod2; + int __pyx_v_timeperiod3; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_ULTOSC (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod1,&__pyx_n_s_timeperiod2,&__pyx_n_s_timeperiod3,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ULTOSC", 0, 3, 6, 1); __PYX_ERR(3, 7823, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_ULTOSC", 0, 3, 6, 2); __PYX_ERR(3, 7823, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod1); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod2); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod3); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_ULTOSC") < 0)) __PYX_ERR(3, 7823, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7823, __pyx_L3_error) + } else { + __pyx_v_timeperiod1 = ((int)-2147483648); + } + if (values[4]) { + __pyx_v_timeperiod2 = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7823, __pyx_L3_error) + } else { + __pyx_v_timeperiod2 = ((int)-2147483648); + } + if (values[5]) { + __pyx_v_timeperiod3 = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_timeperiod3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7823, __pyx_L3_error) + } else { + __pyx_v_timeperiod3 = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_ULTOSC", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7823, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7823, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7823, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7823, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_656stream_ULTOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_656stream_ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_ULTOSC", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7848 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7849 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7849, __pyx_L1_error) + + /* "talib/_stream.pxi":7848 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7850 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7851 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7851, __pyx_L1_error) + + /* "talib/_stream.pxi":7850 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7852 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7853 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7853, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7852 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7854 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7855 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7856 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2240, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7856, __pyx_L1_error) + + /* "talib/_stream.pxi":7855 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7857 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7858 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2241, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7858, __pyx_L1_error) + + /* "talib/_stream.pxi":7857 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7859 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7860 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7860, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7859 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7861 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7862 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7863 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2242, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7863, __pyx_L1_error) + + /* "talib/_stream.pxi":7862 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7864 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7865 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2243, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7865, __pyx_L1_error) + + /* "talib/_stream.pxi":7864 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7866 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7867 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7867, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7866 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7868 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7869 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7870 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7871 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2244, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7871, __pyx_L1_error) + + /* "talib/_stream.pxi":7870 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7872 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7873 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2245, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7873, __pyx_L1_error) + + /* "talib/_stream.pxi":7872 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7874 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ULTOSC", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7875 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_ULTOSC", retCode) + * return outreal + */ + __pyx_v_retCode = TA_ULTOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7876 + * outreal = NaN + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ULTOSC", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_ULTOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7877 + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_ULTOSC", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7881 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_659stream_VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_658stream_VAR[] = " VAR(real[, timeperiod=?, nbdev=?])\n\n Variance (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_659stream_VAR = {"stream_VAR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_659stream_VAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_658stream_VAR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_659stream_VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + double __pyx_v_nbdev; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_VAR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_VAR") < 0)) __PYX_ERR(3, 7881, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7881, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + if (values[2]) { + __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7881, __pyx_L3_error) + } else { + __pyx_v_nbdev = ((double)-4e37); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_VAR", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7881, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 7881, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_658stream_VAR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_658stream_VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_VAR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":7903 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7904 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2246, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7904, __pyx_L1_error) + + /* "talib/_stream.pxi":7903 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7905 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7906 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2247, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7906, __pyx_L1_error) + + /* "talib/_stream.pxi":7905 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7907 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7908 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7908, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7907 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":7909 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":7910 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":7911 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_VAR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7912 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_VAR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_VAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7913 + * outreal = NaN + * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_VAR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_VAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7914 + * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_VAR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7881 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7918 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_661stream_WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_660stream_WCLPRICE[] = " WCLPRICE(high, low, close)\n\n Weighted Close Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_661stream_WCLPRICE = {"stream_WCLPRICE", (PyCFunction)__pyx_pw_5talib_7_ta_lib_661stream_WCLPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_660stream_WCLPRICE}; +static PyObject *__pyx_pw_5talib_7_ta_lib_661stream_WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_WCLPRICE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_WCLPRICE", 1, 3, 3, 1); __PYX_ERR(3, 7918, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_WCLPRICE", 1, 3, 3, 2); __PYX_ERR(3, 7918, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_WCLPRICE") < 0)) __PYX_ERR(3, 7918, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_WCLPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7918, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7918, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7918, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7918, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_660stream_WCLPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_660stream_WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_WCLPRICE", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7939 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7940 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2248, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7940, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7940, __pyx_L1_error) + + /* "talib/_stream.pxi":7939 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7941 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7942 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2249, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7942, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7942, __pyx_L1_error) + + /* "talib/_stream.pxi":7941 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7943 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7944 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7944, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7943 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":7945 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":7946 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7947 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2250, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7947, __pyx_L1_error) + + /* "talib/_stream.pxi":7946 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7948 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7949 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2251, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7949, __pyx_L1_error) + + /* "talib/_stream.pxi":7948 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7950 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7951 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7951, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7950 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":7952 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":7953 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7954 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2252, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7954, __pyx_L1_error) + + /* "talib/_stream.pxi":7953 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7955 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7956 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2253, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7956, __pyx_L1_error) + + /* "talib/_stream.pxi":7955 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7957 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7958 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 7958, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7957 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":7959 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":7960 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":7961 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7962 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2254, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7962, __pyx_L1_error) + + /* "talib/_stream.pxi":7961 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":7963 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7964 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2255, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7964, __pyx_L1_error) + + /* "talib/_stream.pxi":7963 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":7965 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WCLPRICE", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":7966 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WCLPRICE", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WCLPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":7967 + * outreal = NaN + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WCLPRICE", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WCLPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7968 + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WCLPRICE", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7918 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":7972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_663stream_WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_662stream_WILLR[] = " WILLR(high, low, close[, timeperiod=?])\n\n Williams' %R (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_663stream_WILLR = {"stream_WILLR", (PyCFunction)__pyx_pw_5talib_7_ta_lib_663stream_WILLR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_662stream_WILLR}; +static PyObject *__pyx_pw_5talib_7_ta_lib_663stream_WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_high = 0; + PyArrayObject *__pyx_v_low = 0; + PyArrayObject *__pyx_v_close = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_WILLR (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_WILLR", 0, 3, 4, 1); __PYX_ERR(3, 7972, __pyx_L3_error) + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("stream_WILLR", 0, 3, 4, 2); __PYX_ERR(3, 7972, __pyx_L3_error) + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_WILLR") < 0)) __PYX_ERR(3, 7972, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_high = ((PyArrayObject *)values[0]); + __pyx_v_low = ((PyArrayObject *)values[1]); + __pyx_v_close = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 7972, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_WILLR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7972, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(3, 7972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(3, 7972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(3, 7972, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_662stream_WILLR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_662stream_WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_high_data; + double *__pyx_v_low_data; + double *__pyx_v_close_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_WILLR", 0); + __Pyx_INCREF((PyObject *)__pyx_v_high); + __Pyx_INCREF((PyObject *)__pyx_v_low); + __Pyx_INCREF((PyObject *)__pyx_v_close); + + /* "talib/_stream.pxi":7995 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7996 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7996, __pyx_L1_error) + + /* "talib/_stream.pxi":7995 + * int outnbelement + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("high is not double") + * if high.ndim != 1: + */ + } + + /* "talib/_stream.pxi":7997 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":7998 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 7998, __pyx_L1_error) + + /* "talib/_stream.pxi":7997 + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") + * if high.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":7999 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8000 + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 8000, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":7999 + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + */ + } + + /* "talib/_stream.pxi":8001 + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + */ + __pyx_v_high_data = ((double *)__pyx_v_high->data); + + /* "talib/_stream.pxi":8002 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8003 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8003, __pyx_L1_error) + + /* "talib/_stream.pxi":8002 + * high = PyArray_GETCONTIGUOUS(high) + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("low is not double") + * if low.ndim != 1: + */ + } + + /* "talib/_stream.pxi":8004 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8005 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8005, __pyx_L1_error) + + /* "talib/_stream.pxi":8004 + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") + * if low.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":8006 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8007 + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 8007, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":8006 + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + */ + } + + /* "talib/_stream.pxi":8008 + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data # <<<<<<<<<<<<<< + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + */ + __pyx_v_low_data = ((double *)__pyx_v_low->data); + + /* "talib/_stream.pxi":8009 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8010 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8010, __pyx_L1_error) + + /* "talib/_stream.pxi":8009 + * low = PyArray_GETCONTIGUOUS(low) + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("close is not double") + * if close.ndim != 1: + */ + } + + /* "talib/_stream.pxi":8011 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8012 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8012, __pyx_L1_error) + + /* "talib/_stream.pxi":8011 + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") + * if close.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":8013 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8014 + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< + * close_data = close.data + * length = high.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 8014, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":8013 + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + */ + } + + /* "talib/_stream.pxi":8015 + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data # <<<<<<<<<<<<<< + * length = high.shape[0] + * if length != low.shape[0]: + */ + __pyx_v_close_data = ((double *)__pyx_v_close->data); + + /* "talib/_stream.pxi":8016 + * close = PyArray_GETCONTIGUOUS(close) + * close_data = close.data + * length = high.shape[0] # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_v_length = (__pyx_v_high->dimensions[0]); + + /* "talib/_stream.pxi":8017 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8018 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8018, __pyx_L1_error) + + /* "talib/_stream.pxi":8017 + * close_data = close.data + * length = high.shape[0] + * if length != low.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * if length != close.shape[0]: + */ + } + + /* "talib/_stream.pxi":8019 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8020 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8020, __pyx_L1_error) + + /* "talib/_stream.pxi":8019 + * if length != low.shape[0]: + * raise Exception("input lengths are different") + * if length != close.shape[0]: # <<<<<<<<<<<<<< + * raise Exception("input lengths are different") + * outreal = NaN + */ + } + + /* "talib/_stream.pxi":8021 + * if length != close.shape[0]: + * raise Exception("input lengths are different") + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WILLR", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":8022 + * raise Exception("input lengths are different") + * outreal = NaN + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WILLR", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WILLR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":8023 + * outreal = NaN + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WILLR", retCode) # <<<<<<<<<<<<<< + * return outreal + * + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WILLR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":8024 + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WILLR", retCode) + * return outreal # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":7972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_high); + __Pyx_XDECREF((PyObject *)__pyx_v_low); + __Pyx_XDECREF((PyObject *)__pyx_v_close); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "talib/_stream.pxi":8028 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5talib_7_ta_lib_665stream_WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5talib_7_ta_lib_664stream_WMA[] = " WMA(real[, timeperiod=?])\n\n Weighted Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; +static PyMethodDef __pyx_mdef_5talib_7_ta_lib_665stream_WMA = {"stream_WMA", (PyCFunction)__pyx_pw_5talib_7_ta_lib_665stream_WMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_7_ta_lib_664stream_WMA}; +static PyObject *__pyx_pw_5talib_7_ta_lib_665stream_WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_real = 0; + int __pyx_v_timeperiod; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stream_WMA (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stream_WMA") < 0)) __PYX_ERR(3, 8028, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_real = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 8028, __pyx_L3_error) + } else { + __pyx_v_timeperiod = ((int)-2147483648); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stream_WMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8028, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("talib._ta_lib.stream_WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(3, 8028, __pyx_L1_error) + __pyx_r = __pyx_pf_5talib_7_ta_lib_664stream_WMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5talib_7_ta_lib_664stream_WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { + npy_intp __pyx_v_length; + TA_RetCode __pyx_v_retCode; + double *__pyx_v_real_data; + int __pyx_v_outbegidx; + int __pyx_v_outnbelement; + double __pyx_v_outreal; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stream_WMA", 0); + __Pyx_INCREF((PyObject *)__pyx_v_real); + + /* "talib/_stream.pxi":8049 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8050 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8050, __pyx_L1_error) + + /* "talib/_stream.pxi":8049 + * int outnbelement + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< + * raise Exception("real is not double") + * if real.ndim != 1: + */ + } + + /* "talib/_stream.pxi":8051 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8052 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2265, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(3, 8052, __pyx_L1_error) + + /* "talib/_stream.pxi":8051 + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") + * if real.ndim != 1: # <<<<<<<<<<<<<< + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + */ + } + + /* "talib/_stream.pxi":8053 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); + if (__pyx_t_1) { + + /* "talib/_stream.pxi":8054 + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< + * real_data = real.data + * length = real.shape[0] + */ + __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(3, 8054, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "talib/_stream.pxi":8053 + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + */ + } + + /* "talib/_stream.pxi":8055 + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data # <<<<<<<<<<<<<< + * length = real.shape[0] + * outreal = NaN + */ + __pyx_v_real_data = ((double *)__pyx_v_real->data); + + /* "talib/_stream.pxi":8056 + * real = PyArray_GETCONTIGUOUS(real) + * real_data = real.data + * length = real.shape[0] # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_v_length = (__pyx_v_real->dimensions[0]); + + /* "talib/_stream.pxi":8057 + * real_data = real.data + * length = real.shape[0] + * outreal = NaN # <<<<<<<<<<<<<< + * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WMA", retCode) + */ + __pyx_v_outreal = __pyx_v_5talib_7_ta_lib_NaN; + + /* "talib/_stream.pxi":8058 + * length = real.shape[0] + * outreal = NaN + * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< + * _ta_check_success("TA_WMA", retCode) + * return outreal + */ + __pyx_v_retCode = TA_WMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); + + /* "talib/_stream.pxi":8059 + * outreal = NaN + * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WMA", retCode) # <<<<<<<<<<<<<< + * return outreal + */ + __pyx_t_2 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_WMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_stream.pxi":8060 + * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + * _ta_check_success("TA_WMA", retCode) + * return outreal # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "talib/_stream.pxi":8028 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("talib._ta_lib.stream_WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_real); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2266, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 218, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2267, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 222, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L11:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + goto __pyx_L14; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2268, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 259, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(4, 278, __pyx_L1_error) + break; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(4, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(4, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(4, 796, __pyx_L1_error) + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(4, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2269, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 799, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L7_bool_binop_done:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_6) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2270, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 803, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2271, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(4, 823, __pyx_L1_error) + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(4, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + /*else*/ { + Py_INCREF(__pyx_v_base); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {"_ta_check_success", (PyCFunction)__pyx_pw_5talib_7_ta_lib_1_ta_check_success, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "_ta_lib", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_n_s_ACOS, __pyx_k_ACOS, sizeof(__pyx_k_ACOS), 0, 0, 1, 1}, + {&__pyx_n_s_AD, __pyx_k_AD, sizeof(__pyx_k_AD), 0, 0, 1, 1}, + {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1}, + {&__pyx_n_s_ADOSC, __pyx_k_ADOSC, sizeof(__pyx_k_ADOSC), 0, 0, 1, 1}, + {&__pyx_n_s_ADX, __pyx_k_ADX, sizeof(__pyx_k_ADX), 0, 0, 1, 1}, + {&__pyx_n_s_ADXR, __pyx_k_ADXR, sizeof(__pyx_k_ADXR), 0, 0, 1, 1}, + {&__pyx_n_s_ALL, __pyx_k_ALL, sizeof(__pyx_k_ALL), 0, 0, 1, 1}, + {&__pyx_n_s_APO, __pyx_k_APO, sizeof(__pyx_k_APO), 0, 0, 1, 1}, + {&__pyx_n_s_AROON, __pyx_k_AROON, sizeof(__pyx_k_AROON), 0, 0, 1, 1}, + {&__pyx_n_s_AROONOSC, __pyx_k_AROONOSC, sizeof(__pyx_k_AROONOSC), 0, 0, 1, 1}, + {&__pyx_n_s_ASIN, __pyx_k_ASIN, sizeof(__pyx_k_ASIN), 0, 0, 1, 1}, + {&__pyx_n_s_ATAN, __pyx_k_ATAN, sizeof(__pyx_k_ATAN), 0, 0, 1, 1}, + {&__pyx_n_s_ATR, __pyx_k_ATR, sizeof(__pyx_k_ATR), 0, 0, 1, 1}, + {&__pyx_n_s_AVGPRICE, __pyx_k_AVGPRICE, sizeof(__pyx_k_AVGPRICE), 0, 0, 1, 1}, + {&__pyx_kp_s_Allocation_Error_TA_ALLOC_ERR, __pyx_k_Allocation_Error_TA_ALLOC_ERR, sizeof(__pyx_k_Allocation_Error_TA_ALLOC_ERR), 0, 0, 1, 0}, + {&__pyx_n_s_BBANDS, __pyx_k_BBANDS, sizeof(__pyx_k_BBANDS), 0, 0, 1, 1}, + {&__pyx_n_s_BETA, __pyx_k_BETA, sizeof(__pyx_k_BETA), 0, 0, 1, 1}, + {&__pyx_n_s_BOP, __pyx_k_BOP, sizeof(__pyx_k_BOP), 0, 0, 1, 1}, + {&__pyx_kp_s_Bad_Object_TA_BAD_OBJECT, __pyx_k_Bad_Object_TA_BAD_OBJECT, sizeof(__pyx_k_Bad_Object_TA_BAD_OBJECT), 0, 0, 1, 0}, + {&__pyx_kp_s_Bad_Parameter_TA_BAD_PARAM, __pyx_k_Bad_Parameter_TA_BAD_PARAM, sizeof(__pyx_k_Bad_Parameter_TA_BAD_PARAM), 0, 0, 1, 0}, + {&__pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut, __pyx_k_Bull_Bear_Pattern_Bearish_0_Neut, sizeof(__pyx_k_Bull_Bear_Pattern_Bearish_0_Neut), 0, 0, 1, 0}, + {&__pyx_n_s_CCI, __pyx_k_CCI, sizeof(__pyx_k_CCI), 0, 0, 1, 1}, + {&__pyx_n_s_CDL2CROWS, __pyx_k_CDL2CROWS, sizeof(__pyx_k_CDL2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3BLACKCROWS, __pyx_k_CDL3BLACKCROWS, sizeof(__pyx_k_CDL3BLACKCROWS), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3INSIDE, __pyx_k_CDL3INSIDE, sizeof(__pyx_k_CDL3INSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3LINESTRIKE, __pyx_k_CDL3LINESTRIKE, sizeof(__pyx_k_CDL3LINESTRIKE), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3OUTSIDE, __pyx_k_CDL3OUTSIDE, sizeof(__pyx_k_CDL3OUTSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3STARSINSOUTH, __pyx_k_CDL3STARSINSOUTH, sizeof(__pyx_k_CDL3STARSINSOUTH), 0, 0, 1, 1}, + {&__pyx_n_s_CDL3WHITESOLDIERS, __pyx_k_CDL3WHITESOLDIERS, sizeof(__pyx_k_CDL3WHITESOLDIERS), 0, 0, 1, 1}, + {&__pyx_n_s_CDLABANDONEDBABY, __pyx_k_CDLABANDONEDBABY, sizeof(__pyx_k_CDLABANDONEDBABY), 0, 0, 1, 1}, + {&__pyx_n_s_CDLADVANCEBLOCK, __pyx_k_CDLADVANCEBLOCK, sizeof(__pyx_k_CDLADVANCEBLOCK), 0, 0, 1, 1}, + {&__pyx_n_s_CDLBELTHOLD, __pyx_k_CDLBELTHOLD, sizeof(__pyx_k_CDLBELTHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_CDLBREAKAWAY, __pyx_k_CDLBREAKAWAY, sizeof(__pyx_k_CDLBREAKAWAY), 0, 0, 1, 1}, + {&__pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_k_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_CDLCONCEALBABYSWALL, __pyx_k_CDLCONCEALBABYSWALL, sizeof(__pyx_k_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, + {&__pyx_n_s_CDLCOUNTERATTACK, __pyx_k_CDLCOUNTERATTACK, sizeof(__pyx_k_CDLCOUNTERATTACK), 0, 0, 1, 1}, + {&__pyx_n_s_CDLDARKCLOUDCOVER, __pyx_k_CDLDARKCLOUDCOVER, sizeof(__pyx_k_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, + {&__pyx_n_s_CDLDOJI, __pyx_k_CDLDOJI, sizeof(__pyx_k_CDLDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLDOJISTAR, __pyx_k_CDLDOJISTAR, sizeof(__pyx_k_CDLDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLDRAGONFLYDOJI, __pyx_k_CDLDRAGONFLYDOJI, sizeof(__pyx_k_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLENGULFING, __pyx_k_CDLENGULFING, sizeof(__pyx_k_CDLENGULFING), 0, 0, 1, 1}, + {&__pyx_n_s_CDLEVENINGDOJISTAR, __pyx_k_CDLEVENINGDOJISTAR, sizeof(__pyx_k_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLEVENINGSTAR, __pyx_k_CDLEVENINGSTAR, sizeof(__pyx_k_CDLEVENINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_k_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, + {&__pyx_n_s_CDLGRAVESTONEDOJI, __pyx_k_CDLGRAVESTONEDOJI, sizeof(__pyx_k_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHAMMER, __pyx_k_CDLHAMMER, sizeof(__pyx_k_CDLHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHANGINGMAN, __pyx_k_CDLHANGINGMAN, sizeof(__pyx_k_CDLHANGINGMAN), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHARAMI, __pyx_k_CDLHARAMI, sizeof(__pyx_k_CDLHARAMI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHARAMICROSS, __pyx_k_CDLHARAMICROSS, sizeof(__pyx_k_CDLHARAMICROSS), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHIGHWAVE, __pyx_k_CDLHIGHWAVE, sizeof(__pyx_k_CDLHIGHWAVE), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHIKKAKE, __pyx_k_CDLHIKKAKE, sizeof(__pyx_k_CDLHIKKAKE), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHIKKAKEMOD, __pyx_k_CDLHIKKAKEMOD, sizeof(__pyx_k_CDLHIKKAKEMOD), 0, 0, 1, 1}, + {&__pyx_n_s_CDLHOMINGPIGEON, __pyx_k_CDLHOMINGPIGEON, sizeof(__pyx_k_CDLHOMINGPIGEON), 0, 0, 1, 1}, + {&__pyx_n_s_CDLIDENTICAL3CROWS, __pyx_k_CDLIDENTICAL3CROWS, sizeof(__pyx_k_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_CDLINNECK, __pyx_k_CDLINNECK, sizeof(__pyx_k_CDLINNECK), 0, 0, 1, 1}, + {&__pyx_n_s_CDLINVERTEDHAMMER, __pyx_k_CDLINVERTEDHAMMER, sizeof(__pyx_k_CDLINVERTEDHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_CDLKICKING, __pyx_k_CDLKICKING, sizeof(__pyx_k_CDLKICKING), 0, 0, 1, 1}, + {&__pyx_n_s_CDLKICKINGBYLENGTH, __pyx_k_CDLKICKINGBYLENGTH, sizeof(__pyx_k_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, + {&__pyx_n_s_CDLLADDERBOTTOM, __pyx_k_CDLLADDERBOTTOM, sizeof(__pyx_k_CDLLADDERBOTTOM), 0, 0, 1, 1}, + {&__pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_k_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLLONGLINE, __pyx_k_CDLLONGLINE, sizeof(__pyx_k_CDLLONGLINE), 0, 0, 1, 1}, + {&__pyx_n_s_CDLMARUBOZU, __pyx_k_CDLMARUBOZU, sizeof(__pyx_k_CDLMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_CDLMATCHINGLOW, __pyx_k_CDLMATCHINGLOW, sizeof(__pyx_k_CDLMATCHINGLOW), 0, 0, 1, 1}, + {&__pyx_n_s_CDLMATHOLD, __pyx_k_CDLMATHOLD, sizeof(__pyx_k_CDLMATHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_CDLMORNINGDOJISTAR, __pyx_k_CDLMORNINGDOJISTAR, sizeof(__pyx_k_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLMORNINGSTAR, __pyx_k_CDLMORNINGSTAR, sizeof(__pyx_k_CDLMORNINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLONNECK, __pyx_k_CDLONNECK, sizeof(__pyx_k_CDLONNECK), 0, 0, 1, 1}, + {&__pyx_n_s_CDLPIERCING, __pyx_k_CDLPIERCING, sizeof(__pyx_k_CDLPIERCING), 0, 0, 1, 1}, + {&__pyx_n_s_CDLRICKSHAWMAN, __pyx_k_CDLRICKSHAWMAN, sizeof(__pyx_k_CDLRICKSHAWMAN), 0, 0, 1, 1}, + {&__pyx_n_s_CDLRISEFALL3METHODS, __pyx_k_CDLRISEFALL3METHODS, sizeof(__pyx_k_CDLRISEFALL3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSEPARATINGLINES, __pyx_k_CDLSEPARATINGLINES, sizeof(__pyx_k_CDLSEPARATINGLINES), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSHOOTINGSTAR, __pyx_k_CDLSHOOTINGSTAR, sizeof(__pyx_k_CDLSHOOTINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSHORTLINE, __pyx_k_CDLSHORTLINE, sizeof(__pyx_k_CDLSHORTLINE), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSPINNINGTOP, __pyx_k_CDLSPINNINGTOP, sizeof(__pyx_k_CDLSPINNINGTOP), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSTALLEDPATTERN, __pyx_k_CDLSTALLEDPATTERN, sizeof(__pyx_k_CDLSTALLEDPATTERN), 0, 0, 1, 1}, + {&__pyx_n_s_CDLSTICKSANDWICH, __pyx_k_CDLSTICKSANDWICH, sizeof(__pyx_k_CDLSTICKSANDWICH), 0, 0, 1, 1}, + {&__pyx_n_s_CDLTAKURI, __pyx_k_CDLTAKURI, sizeof(__pyx_k_CDLTAKURI), 0, 0, 1, 1}, + {&__pyx_n_s_CDLTASUKIGAP, __pyx_k_CDLTASUKIGAP, sizeof(__pyx_k_CDLTASUKIGAP), 0, 0, 1, 1}, + {&__pyx_n_s_CDLTHRUSTING, __pyx_k_CDLTHRUSTING, sizeof(__pyx_k_CDLTHRUSTING), 0, 0, 1, 1}, + {&__pyx_n_s_CDLTRISTAR, __pyx_k_CDLTRISTAR, sizeof(__pyx_k_CDLTRISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_CDLUNIQUE3RIVER, __pyx_k_CDLUNIQUE3RIVER, sizeof(__pyx_k_CDLUNIQUE3RIVER), 0, 0, 1, 1}, + {&__pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_k_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_k_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_CEIL, __pyx_k_CEIL, sizeof(__pyx_k_CEIL), 0, 0, 1, 1}, + {&__pyx_n_s_CMO, __pyx_k_CMO, sizeof(__pyx_k_CMO), 0, 0, 1, 1}, + {&__pyx_n_s_CORREL, __pyx_k_CORREL, sizeof(__pyx_k_CORREL), 0, 0, 1, 1}, + {&__pyx_n_s_COS, __pyx_k_COS, sizeof(__pyx_k_COS), 0, 0, 1, 1}, + {&__pyx_n_s_COSH, __pyx_k_COSH, sizeof(__pyx_k_COSH), 0, 0, 1, 1}, + {&__pyx_n_s_DEMA, __pyx_k_DEMA, sizeof(__pyx_k_DEMA), 0, 0, 1, 1}, + {&__pyx_n_s_DIV, __pyx_k_DIV, sizeof(__pyx_k_DIV), 0, 0, 1, 1}, + {&__pyx_n_s_DX, __pyx_k_DX, sizeof(__pyx_k_DX), 0, 0, 1, 1}, + {&__pyx_kp_s_Dashed_Line, __pyx_k_Dashed_Line, sizeof(__pyx_k_Dashed_Line), 0, 0, 1, 0}, + {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1}, + {&__pyx_n_s_Dot, __pyx_k_Dot, sizeof(__pyx_k_Dot), 0, 0, 1, 1}, + {&__pyx_kp_s_Dotted_Line, __pyx_k_Dotted_Line, sizeof(__pyx_k_Dotted_Line), 0, 0, 1, 0}, + {&__pyx_kp_s_Double_Exponential_Moving_Averag, __pyx_k_Double_Exponential_Moving_Averag, sizeof(__pyx_k_Double_Exponential_Moving_Averag), 0, 0, 1, 0}, + {&__pyx_n_s_EMA, __pyx_k_EMA, sizeof(__pyx_k_EMA), 0, 0, 1, 1}, + {&__pyx_n_s_EXP, __pyx_k_EXP, sizeof(__pyx_k_EXP), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Exponential_Moving_Average, __pyx_k_Exponential_Moving_Average, sizeof(__pyx_k_Exponential_Moving_Average), 0, 0, 1, 0}, + {&__pyx_n_s_FLOOR, __pyx_k_FLOOR, sizeof(__pyx_k_FLOOR), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_Function, __pyx_k_Function, sizeof(__pyx_k_Function), 0, 0, 1, 1}, + {&__pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F, __pyx_k_Function_Not_Found_TA_FUNC_NOT_F, sizeof(__pyx_k_Function_Not_Found_TA_FUNC_NOT_F), 0, 0, 1, 0}, + {&__pyx_n_s_Function___call, __pyx_k_Function___call, sizeof(__pyx_k_Function___call), 0, 0, 1, 1}, + {&__pyx_n_s_Function___call_function, __pyx_k_Function___call_function, sizeof(__pyx_k_Function___call_function), 0, 0, 1, 1}, + {&__pyx_n_s_Function___get_opt_input_value, __pyx_k_Function___get_opt_input_value, sizeof(__pyx_k_Function___get_opt_input_value), 0, 0, 1, 1}, + {&__pyx_n_s_Function___init, __pyx_k_Function___init, sizeof(__pyx_k_Function___init), 0, 0, 1, 1}, + {&__pyx_n_s_Function___initialize_function_i, __pyx_k_Function___initialize_function_i, sizeof(__pyx_k_Function___initialize_function_i), 0, 0, 1, 1}, + {&__pyx_n_s_Function___input_price_series_na, __pyx_k_Function___input_price_series_na, sizeof(__pyx_k_Function___input_price_series_na), 0, 0, 1, 1}, + {&__pyx_n_s_Function___repr, __pyx_k_Function___repr, sizeof(__pyx_k_Function___repr), 0, 0, 1, 1}, + {&__pyx_n_s_Function___str, __pyx_k_Function___str, sizeof(__pyx_k_Function___str), 0, 0, 1, 1}, + {&__pyx_n_s_Function___unicode, __pyx_k_Function___unicode, sizeof(__pyx_k_Function___unicode), 0, 0, 1, 1}, + {&__pyx_n_s_Function__call_function, __pyx_k_Function__call_function, sizeof(__pyx_k_Function__call_function), 0, 0, 1, 1}, + {&__pyx_n_s_Function__get_opt_input_value, __pyx_k_Function__get_opt_input_value, sizeof(__pyx_k_Function__get_opt_input_value), 0, 0, 1, 1}, + {&__pyx_n_s_Function__info, __pyx_k_Function__info, sizeof(__pyx_k_Function__info), 0, 0, 1, 1}, + {&__pyx_n_s_Function__initialize_function_i, __pyx_k_Function__initialize_function_i, sizeof(__pyx_k_Function__initialize_function_i), 0, 0, 1, 1}, + {&__pyx_n_s_Function__input_arrays, __pyx_k_Function__input_arrays, sizeof(__pyx_k_Function__input_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_Function__input_names, __pyx_k_Function__input_names, sizeof(__pyx_k_Function__input_names), 0, 0, 1, 1}, + {&__pyx_n_s_Function__input_price_series_na, __pyx_k_Function__input_price_series_na, sizeof(__pyx_k_Function__input_price_series_na), 0, 0, 1, 1}, + {&__pyx_n_s_Function__name, __pyx_k_Function__name, sizeof(__pyx_k_Function__name), 0, 0, 1, 1}, + {&__pyx_n_s_Function__namestr, __pyx_k_Function__namestr, sizeof(__pyx_k_Function__namestr), 0, 0, 1, 1}, + {&__pyx_n_s_Function__opt_inputs, __pyx_k_Function__opt_inputs, sizeof(__pyx_k_Function__opt_inputs), 0, 0, 1, 1}, + {&__pyx_n_s_Function__outputs, __pyx_k_Function__outputs, sizeof(__pyx_k_Function__outputs), 0, 0, 1, 1}, + {&__pyx_n_s_Function__outputs_valid, __pyx_k_Function__outputs_valid, sizeof(__pyx_k_Function__outputs_valid), 0, 0, 1, 1}, + {&__pyx_n_s_Function_function_flags, __pyx_k_Function_function_flags, sizeof(__pyx_k_Function_function_flags), 0, 0, 1, 1}, + {&__pyx_n_s_Function_get_input_arrays, __pyx_k_Function_get_input_arrays, sizeof(__pyx_k_Function_get_input_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_Function_get_input_names, __pyx_k_Function_get_input_names, sizeof(__pyx_k_Function_get_input_names), 0, 0, 1, 1}, + {&__pyx_n_s_Function_get_parameters, __pyx_k_Function_get_parameters, sizeof(__pyx_k_Function_get_parameters), 0, 0, 1, 1}, + {&__pyx_kp_s_Function_has_an_unstable_period, __pyx_k_Function_has_an_unstable_period, sizeof(__pyx_k_Function_has_an_unstable_period), 0, 0, 1, 0}, + {&__pyx_n_s_Function_info, __pyx_k_Function_info, sizeof(__pyx_k_Function_info), 0, 0, 1, 1}, + {&__pyx_n_s_Function_lookback, __pyx_k_Function_lookback, sizeof(__pyx_k_Function_lookback), 0, 0, 1, 1}, + {&__pyx_n_s_Function_output_flags, __pyx_k_Function_output_flags, sizeof(__pyx_k_Function_output_flags), 0, 0, 1, 1}, + {&__pyx_n_s_Function_output_names, __pyx_k_Function_output_names, sizeof(__pyx_k_Function_output_names), 0, 0, 1, 1}, + {&__pyx_n_s_Function_outputs, __pyx_k_Function_outputs, sizeof(__pyx_k_Function_outputs), 0, 0, 1, 1}, + {&__pyx_n_s_Function_run, __pyx_k_Function_run, sizeof(__pyx_k_Function_run), 0, 0, 1, 1}, + {&__pyx_n_s_Function_set_function_args, __pyx_k_Function_set_function_args, sizeof(__pyx_k_Function_set_function_args), 0, 0, 1, 1}, + {&__pyx_n_s_Function_set_input_arrays, __pyx_k_Function_set_input_arrays, sizeof(__pyx_k_Function_set_input_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_Function_set_input_names, __pyx_k_Function_set_input_names, sizeof(__pyx_k_Function_set_input_names), 0, 0, 1, 1}, + {&__pyx_n_s_Function_set_parameters, __pyx_k_Function_set_parameters, sizeof(__pyx_k_Function_set_parameters), 0, 0, 1, 1}, + {&__pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU, __pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU, sizeof(__pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU), 0, 0, 1, 0}, + {&__pyx_n_s_HT_DCPERIOD, __pyx_k_HT_DCPERIOD, sizeof(__pyx_k_HT_DCPERIOD), 0, 0, 1, 1}, + {&__pyx_n_s_HT_DCPHASE, __pyx_k_HT_DCPHASE, sizeof(__pyx_k_HT_DCPHASE), 0, 0, 1, 1}, + {&__pyx_n_s_HT_PHASOR, __pyx_k_HT_PHASOR, sizeof(__pyx_k_HT_PHASOR), 0, 0, 1, 1}, + {&__pyx_n_s_HT_SINE, __pyx_k_HT_SINE, sizeof(__pyx_k_HT_SINE), 0, 0, 1, 1}, + {&__pyx_n_s_HT_TRENDLINE, __pyx_k_HT_TRENDLINE, sizeof(__pyx_k_HT_TRENDLINE), 0, 0, 1, 1}, + {&__pyx_n_s_HT_TRENDMODE, __pyx_k_HT_TRENDMODE, sizeof(__pyx_k_HT_TRENDMODE), 0, 0, 1, 1}, + {&__pyx_n_s_Histogram, __pyx_k_Histogram, sizeof(__pyx_k_Histogram), 0, 0, 1, 1}, + {&__pyx_n_s_INPUT_ARRAYS_DEFAULTS, __pyx_k_INPUT_ARRAYS_DEFAULTS, sizeof(__pyx_k_INPUT_ARRAYS_DEFAULTS), 0, 0, 1, 1}, + {&__pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_k_INPUT_ARRAYS_TYPES, sizeof(__pyx_k_INPUT_ARRAYS_TYPES), 0, 0, 1, 1}, + {&__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS, __pyx_k_INPUT_PRICE_SERIES_DEFAULTS, sizeof(__pyx_k_INPUT_PRICE_SERIES_DEFAULTS), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Input_Not_All_Initialized_TA_INP, __pyx_k_Input_Not_All_Initialized_TA_INP, sizeof(__pyx_k_Input_Not_All_Initialized_TA_INP), 0, 0, 1, 0}, + {&__pyx_kp_s_Inputs, __pyx_k_Inputs, sizeof(__pyx_k_Inputs), 0, 0, 1, 0}, + {&__pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR, __pyx_k_Internal_Error_TA_INTERNAL_ERROR, sizeof(__pyx_k_Internal_Error_TA_INTERNAL_ERROR), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE, __pyx_k_Invalid_Handle_TA_INVALID_HANDLE, sizeof(__pyx_k_Invalid_Handle_TA_INVALID_HANDLE), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS, __pyx_k_Invalid_List_Type_TA_INVALID_LIS, sizeof(__pyx_k_Invalid_List_Type_TA_INVALID_LIS), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_Parameter_Function_TA_IN, __pyx_k_Invalid_Parameter_Function_TA_IN, sizeof(__pyx_k_Invalid_Parameter_Function_TA_IN), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_Parameter_Holder_TA_INVA, __pyx_k_Invalid_Parameter_Holder_TA_INVA, sizeof(__pyx_k_Invalid_Parameter_Holder_TA_INVA), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_Parameter_Holder_Type_TA, __pyx_k_Invalid_Parameter_Holder_Type_TA, sizeof(__pyx_k_Invalid_Parameter_Holder_Type_TA), 0, 0, 1, 0}, + {&__pyx_n_s_KAMA, __pyx_k_KAMA, sizeof(__pyx_k_KAMA), 0, 0, 1, 1}, + {&__pyx_kp_s_Kaufman_Adaptive_Moving_Average, __pyx_k_Kaufman_Adaptive_Moving_Average, sizeof(__pyx_k_Kaufman_Adaptive_Moving_Average), 0, 0, 1, 0}, + {&__pyx_n_s_LINEARREG, __pyx_k_LINEARREG, sizeof(__pyx_k_LINEARREG), 0, 0, 1, 1}, + {&__pyx_n_s_LINEARREG_ANGLE, __pyx_k_LINEARREG_ANGLE, sizeof(__pyx_k_LINEARREG_ANGLE), 0, 0, 1, 1}, + {&__pyx_n_s_LINEARREG_INTERCEPT, __pyx_k_LINEARREG_INTERCEPT, sizeof(__pyx_k_LINEARREG_INTERCEPT), 0, 0, 1, 1}, + {&__pyx_n_s_LINEARREG_SLOPE, __pyx_k_LINEARREG_SLOPE, sizeof(__pyx_k_LINEARREG_SLOPE), 0, 0, 1, 1}, + {&__pyx_n_s_LN, __pyx_k_LN, sizeof(__pyx_k_LN), 0, 0, 1, 1}, + {&__pyx_n_s_LOG10, __pyx_k_LOG10, sizeof(__pyx_k_LOG10), 0, 0, 1, 1}, + {&__pyx_kp_s_Library_Not_Initialized_TA_LIB_N, __pyx_k_Library_Not_Initialized_TA_LIB_N, sizeof(__pyx_k_Library_Not_Initialized_TA_LIB_N), 0, 0, 1, 0}, + {&__pyx_n_s_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1}, + {&__pyx_n_s_MA, __pyx_k_MA, sizeof(__pyx_k_MA), 0, 0, 1, 1}, + {&__pyx_n_s_MACD, __pyx_k_MACD, sizeof(__pyx_k_MACD), 0, 0, 1, 1}, + {&__pyx_n_s_MACDEXT, __pyx_k_MACDEXT, sizeof(__pyx_k_MACDEXT), 0, 0, 1, 1}, + {&__pyx_n_s_MACDFIX, __pyx_k_MACDFIX, sizeof(__pyx_k_MACDFIX), 0, 0, 1, 1}, + {&__pyx_n_s_MAMA, __pyx_k_MAMA, sizeof(__pyx_k_MAMA), 0, 0, 1, 1}, + {&__pyx_n_s_MAVP, __pyx_k_MAVP, sizeof(__pyx_k_MAVP), 0, 0, 1, 1}, + {&__pyx_n_s_MAX, __pyx_k_MAX, sizeof(__pyx_k_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_MAXINDEX, __pyx_k_MAXINDEX, sizeof(__pyx_k_MAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_MA_Type, __pyx_k_MA_Type, sizeof(__pyx_k_MA_Type), 0, 0, 1, 1}, + {&__pyx_n_s_MA_Type___getitem, __pyx_k_MA_Type___getitem, sizeof(__pyx_k_MA_Type___getitem), 0, 0, 1, 1}, + {&__pyx_n_s_MA_Type___init, __pyx_k_MA_Type___init, sizeof(__pyx_k_MA_Type___init), 0, 0, 1, 1}, + {&__pyx_n_s_MEDPRICE, __pyx_k_MEDPRICE, sizeof(__pyx_k_MEDPRICE), 0, 0, 1, 1}, + {&__pyx_kp_s_MESA_Adaptive_Moving_Average, __pyx_k_MESA_Adaptive_Moving_Average, sizeof(__pyx_k_MESA_Adaptive_Moving_Average), 0, 0, 1, 0}, + {&__pyx_n_s_MFI, __pyx_k_MFI, sizeof(__pyx_k_MFI), 0, 0, 1, 1}, + {&__pyx_n_s_MIDPOINT, __pyx_k_MIDPOINT, sizeof(__pyx_k_MIDPOINT), 0, 0, 1, 1}, + {&__pyx_n_s_MIDPRICE, __pyx_k_MIDPRICE, sizeof(__pyx_k_MIDPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_MIN, __pyx_k_MIN, sizeof(__pyx_k_MIN), 0, 0, 1, 1}, + {&__pyx_n_s_MININDEX, __pyx_k_MININDEX, sizeof(__pyx_k_MININDEX), 0, 0, 1, 1}, + {&__pyx_n_s_MINMAX, __pyx_k_MINMAX, sizeof(__pyx_k_MINMAX), 0, 0, 1, 1}, + {&__pyx_n_s_MINMAXINDEX, __pyx_k_MINMAXINDEX, sizeof(__pyx_k_MINMAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_MINUS_DI, __pyx_k_MINUS_DI, sizeof(__pyx_k_MINUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_MINUS_DM, __pyx_k_MINUS_DM, sizeof(__pyx_k_MINUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_MOM, __pyx_k_MOM, sizeof(__pyx_k_MOM), 0, 0, 1, 1}, + {&__pyx_n_s_MULT, __pyx_k_MULT, sizeof(__pyx_k_MULT), 0, 0, 1, 1}, + {&__pyx_n_s_NATR, __pyx_k_NATR, sizeof(__pyx_k_NATR), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED, __pyx_k_Not_Supported_TA_NOT_SUPPORTED, sizeof(__pyx_k_Not_Supported_TA_NOT_SUPPORTED), 0, 0, 1, 0}, + {&__pyx_n_s_OBV, __pyx_k_OBV, sizeof(__pyx_k_OBV), 0, 0, 1, 1}, + {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF, __pyx_k_Out_of_Range_End_Index_TA_OUT_OF, sizeof(__pyx_k_Out_of_Range_End_Index_TA_OUT_OF), 0, 0, 1, 0}, + {&__pyx_kp_s_Out_of_Range_Start_Index_TA_OUT, __pyx_k_Out_of_Range_Start_Index_TA_OUT, sizeof(__pyx_k_Out_of_Range_Start_Index_TA_OUT), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_Not_All_Initialized_TA_OU, __pyx_k_Output_Not_All_Initialized_TA_OU, sizeof(__pyx_k_Output_Not_All_Initialized_TA_OU), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_can_be_negative, __pyx_k_Output_can_be_negative, sizeof(__pyx_k_Output_can_be_negative), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_can_be_positive, __pyx_k_Output_can_be_positive, sizeof(__pyx_k_Output_can_be_positive), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_can_be_zero, __pyx_k_Output_can_be_zero, sizeof(__pyx_k_Output_can_be_zero), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_is_a_candlestick, __pyx_k_Output_is_a_candlestick, sizeof(__pyx_k_Output_is_a_candlestick), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_is_over_volume, __pyx_k_Output_is_over_volume, sizeof(__pyx_k_Output_is_over_volume), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_scale_same_as_input, __pyx_k_Output_scale_same_as_input, sizeof(__pyx_k_Output_scale_same_as_input), 0, 0, 1, 0}, + {&__pyx_kp_s_Outputs, __pyx_k_Outputs, sizeof(__pyx_k_Outputs), 0, 0, 1, 0}, + {&__pyx_n_s_PANDAS_DATAFRAME, __pyx_k_PANDAS_DATAFRAME, sizeof(__pyx_k_PANDAS_DATAFRAME), 0, 0, 1, 1}, + {&__pyx_n_s_PANDAS_SERIES, __pyx_k_PANDAS_SERIES, sizeof(__pyx_k_PANDAS_SERIES), 0, 0, 1, 1}, + {&__pyx_n_s_PLUS_DI, __pyx_k_PLUS_DI, sizeof(__pyx_k_PLUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_PLUS_DM, __pyx_k_PLUS_DM, sizeof(__pyx_k_PLUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_PPO, __pyx_k_PPO, sizeof(__pyx_k_PPO), 0, 0, 1, 1}, + {&__pyx_kp_s_Parameters, __pyx_k_Parameters, sizeof(__pyx_k_Parameters), 0, 0, 1, 0}, + {&__pyx_kp_s_Pattern_Bool, __pyx_k_Pattern_Bool, sizeof(__pyx_k_Pattern_Bool), 0, 0, 1, 0}, + {&__pyx_n_s_ROC, __pyx_k_ROC, sizeof(__pyx_k_ROC), 0, 0, 1, 1}, + {&__pyx_n_s_ROCP, __pyx_k_ROCP, sizeof(__pyx_k_ROCP), 0, 0, 1, 1}, + {&__pyx_n_s_ROCR, __pyx_k_ROCR, sizeof(__pyx_k_ROCR), 0, 0, 1, 1}, + {&__pyx_n_s_ROCR100, __pyx_k_ROCR100, sizeof(__pyx_k_ROCR100), 0, 0, 1, 1}, + {&__pyx_n_s_RSI, __pyx_k_RSI, sizeof(__pyx_k_RSI), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_SAR, __pyx_k_SAR, sizeof(__pyx_k_SAR), 0, 0, 1, 1}, + {&__pyx_n_s_SAREXT, __pyx_k_SAREXT, sizeof(__pyx_k_SAREXT), 0, 0, 1, 1}, + {&__pyx_n_s_SIN, __pyx_k_SIN, sizeof(__pyx_k_SIN), 0, 0, 1, 1}, + {&__pyx_n_s_SINH, __pyx_k_SINH, sizeof(__pyx_k_SINH), 0, 0, 1, 1}, + {&__pyx_n_s_SMA, __pyx_k_SMA, sizeof(__pyx_k_SMA), 0, 0, 1, 1}, + {&__pyx_n_s_SQRT, __pyx_k_SQRT, sizeof(__pyx_k_SQRT), 0, 0, 1, 1}, + {&__pyx_n_s_STDDEV, __pyx_k_STDDEV, sizeof(__pyx_k_STDDEV), 0, 0, 1, 1}, + {&__pyx_n_s_STOCH, __pyx_k_STOCH, sizeof(__pyx_k_STOCH), 0, 0, 1, 1}, + {&__pyx_n_s_STOCHF, __pyx_k_STOCHF, sizeof(__pyx_k_STOCHF), 0, 0, 1, 1}, + {&__pyx_n_s_STOCHRSI, __pyx_k_STOCHRSI, sizeof(__pyx_k_STOCHRSI), 0, 0, 1, 1}, + {&__pyx_n_s_SUB, __pyx_k_SUB, sizeof(__pyx_k_SUB), 0, 0, 1, 1}, + {&__pyx_n_s_SUM, __pyx_k_SUM, sizeof(__pyx_k_SUM), 0, 0, 1, 1}, + {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1}, + {&__pyx_kp_s_Simple_Moving_Average, __pyx_k_Simple_Moving_Average, sizeof(__pyx_k_Simple_Moving_Average), 0, 0, 1, 0}, + {&__pyx_kp_s_Strength_Pattern_200_100_Bearish, __pyx_k_Strength_Pattern_200_100_Bearish, sizeof(__pyx_k_Strength_Pattern_200_100_Bearish), 0, 0, 1, 0}, + {&__pyx_n_s_Success, __pyx_k_Success, sizeof(__pyx_k_Success), 0, 0, 1, 1}, + {&__pyx_n_s_T3, __pyx_k_T3, sizeof(__pyx_k_T3), 0, 0, 1, 1}, + {&__pyx_n_s_TAN, __pyx_k_TAN, sizeof(__pyx_k_TAN), 0, 0, 1, 1}, + {&__pyx_n_s_TANH, __pyx_k_TANH, sizeof(__pyx_k_TANH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ACOS, __pyx_k_TA_ACOS, sizeof(__pyx_k_TA_ACOS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_AD, __pyx_k_TA_AD, sizeof(__pyx_k_TA_AD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ADD, __pyx_k_TA_ADD, sizeof(__pyx_k_TA_ADD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ADOSC, __pyx_k_TA_ADOSC, sizeof(__pyx_k_TA_ADOSC), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ADX, __pyx_k_TA_ADX, sizeof(__pyx_k_TA_ADX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ADXR, __pyx_k_TA_ADXR, sizeof(__pyx_k_TA_ADXR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_APO, __pyx_k_TA_APO, sizeof(__pyx_k_TA_APO), 0, 0, 1, 1}, + {&__pyx_n_s_TA_AROON, __pyx_k_TA_AROON, sizeof(__pyx_k_TA_AROON), 0, 0, 1, 1}, + {&__pyx_n_s_TA_AROONOSC, __pyx_k_TA_AROONOSC, sizeof(__pyx_k_TA_AROONOSC), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ASIN, __pyx_k_TA_ASIN, sizeof(__pyx_k_TA_ASIN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ATAN, __pyx_k_TA_ATAN, sizeof(__pyx_k_TA_ATAN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ATR, __pyx_k_TA_ATR, sizeof(__pyx_k_TA_ATR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_AVGPRICE, __pyx_k_TA_AVGPRICE, sizeof(__pyx_k_TA_AVGPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_BBANDS, __pyx_k_TA_BBANDS, sizeof(__pyx_k_TA_BBANDS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_BETA, __pyx_k_TA_BETA, sizeof(__pyx_k_TA_BETA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_BOP, __pyx_k_TA_BOP, sizeof(__pyx_k_TA_BOP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CCI, __pyx_k_TA_CCI, sizeof(__pyx_k_TA_CCI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL2CROWS, __pyx_k_TA_CDL2CROWS, sizeof(__pyx_k_TA_CDL2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_k_TA_CDL3BLACKCROWS, sizeof(__pyx_k_TA_CDL3BLACKCROWS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3INSIDE, __pyx_k_TA_CDL3INSIDE, sizeof(__pyx_k_TA_CDL3INSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_k_TA_CDL3LINESTRIKE, sizeof(__pyx_k_TA_CDL3LINESTRIKE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3OUTSIDE, __pyx_k_TA_CDL3OUTSIDE, sizeof(__pyx_k_TA_CDL3OUTSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_k_TA_CDL3STARSINSOUTH, sizeof(__pyx_k_TA_CDL3STARSINSOUTH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_k_TA_CDL3WHITESOLDIERS, sizeof(__pyx_k_TA_CDL3WHITESOLDIERS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_k_TA_CDLABANDONEDBABY, sizeof(__pyx_k_TA_CDLABANDONEDBABY), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_k_TA_CDLADVANCEBLOCK, sizeof(__pyx_k_TA_CDLADVANCEBLOCK), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLBELTHOLD, __pyx_k_TA_CDLBELTHOLD, sizeof(__pyx_k_TA_CDLBELTHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLBREAKAWAY, __pyx_k_TA_CDLBREAKAWAY, sizeof(__pyx_k_TA_CDLBREAKAWAY), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_k_TA_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_TA_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_k_TA_CDLCONCEALBABYSWALL, sizeof(__pyx_k_TA_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_k_TA_CDLCOUNTERATTACK, sizeof(__pyx_k_TA_CDLCOUNTERATTACK), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_k_TA_CDLDARKCLOUDCOVER, sizeof(__pyx_k_TA_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLDOJI, __pyx_k_TA_CDLDOJI, sizeof(__pyx_k_TA_CDLDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLDOJISTAR, __pyx_k_TA_CDLDOJISTAR, sizeof(__pyx_k_TA_CDLDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_k_TA_CDLDRAGONFLYDOJI, sizeof(__pyx_k_TA_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLENGULFING, __pyx_k_TA_CDLENGULFING, sizeof(__pyx_k_TA_CDLENGULFING), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_k_TA_CDLEVENINGDOJISTAR, sizeof(__pyx_k_TA_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_k_TA_CDLEVENINGSTAR, sizeof(__pyx_k_TA_CDLEVENINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_k_TA_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_TA_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_k_TA_CDLGRAVESTONEDOJI, sizeof(__pyx_k_TA_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHAMMER, __pyx_k_TA_CDLHAMMER, sizeof(__pyx_k_TA_CDLHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHANGINGMAN, __pyx_k_TA_CDLHANGINGMAN, sizeof(__pyx_k_TA_CDLHANGINGMAN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHARAMI, __pyx_k_TA_CDLHARAMI, sizeof(__pyx_k_TA_CDLHARAMI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHARAMICROSS, __pyx_k_TA_CDLHARAMICROSS, sizeof(__pyx_k_TA_CDLHARAMICROSS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHIGHWAVE, __pyx_k_TA_CDLHIGHWAVE, sizeof(__pyx_k_TA_CDLHIGHWAVE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHIKKAKE, __pyx_k_TA_CDLHIKKAKE, sizeof(__pyx_k_TA_CDLHIKKAKE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_k_TA_CDLHIKKAKEMOD, sizeof(__pyx_k_TA_CDLHIKKAKEMOD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_k_TA_CDLHOMINGPIGEON, sizeof(__pyx_k_TA_CDLHOMINGPIGEON), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_k_TA_CDLIDENTICAL3CROWS, sizeof(__pyx_k_TA_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLINNECK, __pyx_k_TA_CDLINNECK, sizeof(__pyx_k_TA_CDLINNECK), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_k_TA_CDLINVERTEDHAMMER, sizeof(__pyx_k_TA_CDLINVERTEDHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLKICKING, __pyx_k_TA_CDLKICKING, sizeof(__pyx_k_TA_CDLKICKING), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_k_TA_CDLKICKINGBYLENGTH, sizeof(__pyx_k_TA_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_k_TA_CDLLADDERBOTTOM, sizeof(__pyx_k_TA_CDLLADDERBOTTOM), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_k_TA_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_TA_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLLONGLINE, __pyx_k_TA_CDLLONGLINE, sizeof(__pyx_k_TA_CDLLONGLINE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLMARUBOZU, __pyx_k_TA_CDLMARUBOZU, sizeof(__pyx_k_TA_CDLMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_k_TA_CDLMATCHINGLOW, sizeof(__pyx_k_TA_CDLMATCHINGLOW), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLMATHOLD, __pyx_k_TA_CDLMATHOLD, sizeof(__pyx_k_TA_CDLMATHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_k_TA_CDLMORNINGDOJISTAR, sizeof(__pyx_k_TA_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_k_TA_CDLMORNINGSTAR, sizeof(__pyx_k_TA_CDLMORNINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLONNECK, __pyx_k_TA_CDLONNECK, sizeof(__pyx_k_TA_CDLONNECK), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLPIERCING, __pyx_k_TA_CDLPIERCING, sizeof(__pyx_k_TA_CDLPIERCING), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_k_TA_CDLRICKSHAWMAN, sizeof(__pyx_k_TA_CDLRICKSHAWMAN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_k_TA_CDLRISEFALL3METHODS, sizeof(__pyx_k_TA_CDLRISEFALL3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_k_TA_CDLSEPARATINGLINES, sizeof(__pyx_k_TA_CDLSEPARATINGLINES), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_k_TA_CDLSHOOTINGSTAR, sizeof(__pyx_k_TA_CDLSHOOTINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSHORTLINE, __pyx_k_TA_CDLSHORTLINE, sizeof(__pyx_k_TA_CDLSHORTLINE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_k_TA_CDLSPINNINGTOP, sizeof(__pyx_k_TA_CDLSPINNINGTOP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_k_TA_CDLSTALLEDPATTERN, sizeof(__pyx_k_TA_CDLSTALLEDPATTERN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_k_TA_CDLSTICKSANDWICH, sizeof(__pyx_k_TA_CDLSTICKSANDWICH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLTAKURI, __pyx_k_TA_CDLTAKURI, sizeof(__pyx_k_TA_CDLTAKURI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLTASUKIGAP, __pyx_k_TA_CDLTASUKIGAP, sizeof(__pyx_k_TA_CDLTASUKIGAP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLTHRUSTING, __pyx_k_TA_CDLTHRUSTING, sizeof(__pyx_k_TA_CDLTHRUSTING), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLTRISTAR, __pyx_k_TA_CDLTRISTAR, sizeof(__pyx_k_TA_CDLTRISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_k_TA_CDLUNIQUE3RIVER, sizeof(__pyx_k_TA_CDLUNIQUE3RIVER), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_k_TA_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_TA_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_k_TA_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_TA_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CEIL, __pyx_k_TA_CEIL, sizeof(__pyx_k_TA_CEIL), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CMO, __pyx_k_TA_CMO, sizeof(__pyx_k_TA_CMO), 0, 0, 1, 1}, + {&__pyx_n_s_TA_CORREL, __pyx_k_TA_CORREL, sizeof(__pyx_k_TA_CORREL), 0, 0, 1, 1}, + {&__pyx_n_s_TA_COS, __pyx_k_TA_COS, sizeof(__pyx_k_TA_COS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_COSH, __pyx_k_TA_COSH, sizeof(__pyx_k_TA_COSH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_DEMA, __pyx_k_TA_DEMA, sizeof(__pyx_k_TA_DEMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_DIV, __pyx_k_TA_DIV, sizeof(__pyx_k_TA_DIV), 0, 0, 1, 1}, + {&__pyx_n_s_TA_DX, __pyx_k_TA_DX, sizeof(__pyx_k_TA_DX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_EMA, __pyx_k_TA_EMA, sizeof(__pyx_k_TA_EMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_EXP, __pyx_k_TA_EXP, sizeof(__pyx_k_TA_EXP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_FLOOR, __pyx_k_TA_FLOOR, sizeof(__pyx_k_TA_FLOOR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_FUNCTION_NAMES, __pyx_k_TA_FUNCTION_NAMES, sizeof(__pyx_k_TA_FUNCTION_NAMES), 0, 0, 1, 1}, + {&__pyx_n_s_TA_FUNC_FLAGS, __pyx_k_TA_FUNC_FLAGS, sizeof(__pyx_k_TA_FUNC_FLAGS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_FuncTableAlloc, __pyx_k_TA_FuncTableAlloc, sizeof(__pyx_k_TA_FuncTableAlloc), 0, 0, 1, 1}, + {&__pyx_n_s_TA_FuncTableFree, __pyx_k_TA_FuncTableFree, sizeof(__pyx_k_TA_FuncTableFree), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetFuncHandle, __pyx_k_TA_GetFuncHandle, sizeof(__pyx_k_TA_GetFuncHandle), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetFuncInfo, __pyx_k_TA_GetFuncInfo, sizeof(__pyx_k_TA_GetFuncInfo), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetInputParameterInfo, __pyx_k_TA_GetInputParameterInfo, sizeof(__pyx_k_TA_GetInputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetLookback, __pyx_k_TA_GetLookback, sizeof(__pyx_k_TA_GetLookback), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetOptInputParameterInfo, __pyx_k_TA_GetOptInputParameterInfo, sizeof(__pyx_k_TA_GetOptInputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GetOutputParameterInfo, __pyx_k_TA_GetOutputParameterInfo, sizeof(__pyx_k_TA_GetOutputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GroupTableAlloc, __pyx_k_TA_GroupTableAlloc, sizeof(__pyx_k_TA_GroupTableAlloc), 0, 0, 1, 1}, + {&__pyx_n_s_TA_GroupTableFree, __pyx_k_TA_GroupTableFree, sizeof(__pyx_k_TA_GroupTableFree), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_DCPERIOD, __pyx_k_TA_HT_DCPERIOD, sizeof(__pyx_k_TA_HT_DCPERIOD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_DCPHASE, __pyx_k_TA_HT_DCPHASE, sizeof(__pyx_k_TA_HT_DCPHASE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_PHASOR, __pyx_k_TA_HT_PHASOR, sizeof(__pyx_k_TA_HT_PHASOR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_SINE, __pyx_k_TA_HT_SINE, sizeof(__pyx_k_TA_HT_SINE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_TRENDLINE, __pyx_k_TA_HT_TRENDLINE, sizeof(__pyx_k_TA_HT_TRENDLINE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_HT_TRENDMODE, __pyx_k_TA_HT_TRENDMODE, sizeof(__pyx_k_TA_HT_TRENDMODE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_INPUT_FLAGS, __pyx_k_TA_INPUT_FLAGS, sizeof(__pyx_k_TA_INPUT_FLAGS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_Initialize, __pyx_k_TA_Initialize, sizeof(__pyx_k_TA_Initialize), 0, 0, 1, 1}, + {&__pyx_n_s_TA_KAMA, __pyx_k_TA_KAMA, sizeof(__pyx_k_TA_KAMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LINEARREG, __pyx_k_TA_LINEARREG, sizeof(__pyx_k_TA_LINEARREG), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_k_TA_LINEARREG_ANGLE, sizeof(__pyx_k_TA_LINEARREG_ANGLE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_k_TA_LINEARREG_INTERCEPT, sizeof(__pyx_k_TA_LINEARREG_INTERCEPT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_k_TA_LINEARREG_SLOPE, sizeof(__pyx_k_TA_LINEARREG_SLOPE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LN, __pyx_k_TA_LN, sizeof(__pyx_k_TA_LN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_LOG10, __pyx_k_TA_LOG10, sizeof(__pyx_k_TA_LOG10), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MA, __pyx_k_TA_MA, sizeof(__pyx_k_TA_MA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MACD, __pyx_k_TA_MACD, sizeof(__pyx_k_TA_MACD), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MACDEXT, __pyx_k_TA_MACDEXT, sizeof(__pyx_k_TA_MACDEXT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MACDFIX, __pyx_k_TA_MACDFIX, sizeof(__pyx_k_TA_MACDFIX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MAMA, __pyx_k_TA_MAMA, sizeof(__pyx_k_TA_MAMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MAVP, __pyx_k_TA_MAVP, sizeof(__pyx_k_TA_MAVP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MAX, __pyx_k_TA_MAX, sizeof(__pyx_k_TA_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MAXINDEX, __pyx_k_TA_MAXINDEX, sizeof(__pyx_k_TA_MAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MEDPRICE, __pyx_k_TA_MEDPRICE, sizeof(__pyx_k_TA_MEDPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MFI, __pyx_k_TA_MFI, sizeof(__pyx_k_TA_MFI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MIDPOINT, __pyx_k_TA_MIDPOINT, sizeof(__pyx_k_TA_MIDPOINT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MIDPRICE, __pyx_k_TA_MIDPRICE, sizeof(__pyx_k_TA_MIDPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MIN, __pyx_k_TA_MIN, sizeof(__pyx_k_TA_MIN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MININDEX, __pyx_k_TA_MININDEX, sizeof(__pyx_k_TA_MININDEX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MINMAX, __pyx_k_TA_MINMAX, sizeof(__pyx_k_TA_MINMAX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MINMAXINDEX, __pyx_k_TA_MINMAXINDEX, sizeof(__pyx_k_TA_MINMAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MINUS_DI, __pyx_k_TA_MINUS_DI, sizeof(__pyx_k_TA_MINUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MINUS_DM, __pyx_k_TA_MINUS_DM, sizeof(__pyx_k_TA_MINUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MOM, __pyx_k_TA_MOM, sizeof(__pyx_k_TA_MOM), 0, 0, 1, 1}, + {&__pyx_n_s_TA_MULT, __pyx_k_TA_MULT, sizeof(__pyx_k_TA_MULT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_NATR, __pyx_k_TA_NATR, sizeof(__pyx_k_TA_NATR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_OBV, __pyx_k_TA_OBV, sizeof(__pyx_k_TA_OBV), 0, 0, 1, 1}, + {&__pyx_n_s_TA_OUTPUT_FLAGS, __pyx_k_TA_OUTPUT_FLAGS, sizeof(__pyx_k_TA_OUTPUT_FLAGS), 0, 0, 1, 1}, + {&__pyx_n_s_TA_PLUS_DI, __pyx_k_TA_PLUS_DI, sizeof(__pyx_k_TA_PLUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_PLUS_DM, __pyx_k_TA_PLUS_DM, sizeof(__pyx_k_TA_PLUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_TA_PPO, __pyx_k_TA_PPO, sizeof(__pyx_k_TA_PPO), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ParamHolderAlloc, __pyx_k_TA_ParamHolderAlloc, sizeof(__pyx_k_TA_ParamHolderAlloc), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ParamHolderFree, __pyx_k_TA_ParamHolderFree, sizeof(__pyx_k_TA_ParamHolderFree), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ROC, __pyx_k_TA_ROC, sizeof(__pyx_k_TA_ROC), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ROCP, __pyx_k_TA_ROCP, sizeof(__pyx_k_TA_ROCP), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ROCR, __pyx_k_TA_ROCR, sizeof(__pyx_k_TA_ROCR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ROCR100, __pyx_k_TA_ROCR100, sizeof(__pyx_k_TA_ROCR100), 0, 0, 1, 1}, + {&__pyx_n_s_TA_RSI, __pyx_k_TA_RSI, sizeof(__pyx_k_TA_RSI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SAR, __pyx_k_TA_SAR, sizeof(__pyx_k_TA_SAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SAREXT, __pyx_k_TA_SAREXT, sizeof(__pyx_k_TA_SAREXT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SIN, __pyx_k_TA_SIN, sizeof(__pyx_k_TA_SIN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SINH, __pyx_k_TA_SINH, sizeof(__pyx_k_TA_SINH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SMA, __pyx_k_TA_SMA, sizeof(__pyx_k_TA_SMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SQRT, __pyx_k_TA_SQRT, sizeof(__pyx_k_TA_SQRT), 0, 0, 1, 1}, + {&__pyx_n_s_TA_STDDEV, __pyx_k_TA_STDDEV, sizeof(__pyx_k_TA_STDDEV), 0, 0, 1, 1}, + {&__pyx_n_s_TA_STOCH, __pyx_k_TA_STOCH, sizeof(__pyx_k_TA_STOCH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_STOCHF, __pyx_k_TA_STOCHF, sizeof(__pyx_k_TA_STOCHF), 0, 0, 1, 1}, + {&__pyx_n_s_TA_STOCHRSI, __pyx_k_TA_STOCHRSI, sizeof(__pyx_k_TA_STOCHRSI), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SUB, __pyx_k_TA_SUB, sizeof(__pyx_k_TA_SUB), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SUM, __pyx_k_TA_SUM, sizeof(__pyx_k_TA_SUM), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SetOptInputParamInteger, __pyx_k_TA_SetOptInputParamInteger, sizeof(__pyx_k_TA_SetOptInputParamInteger), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SetOptInputParamReal, __pyx_k_TA_SetOptInputParamReal, sizeof(__pyx_k_TA_SetOptInputParamReal), 0, 0, 1, 1}, + {&__pyx_n_s_TA_SetUnstablePeriod, __pyx_k_TA_SetUnstablePeriod, sizeof(__pyx_k_TA_SetUnstablePeriod), 0, 0, 1, 1}, + {&__pyx_n_s_TA_Shutdown, __pyx_k_TA_Shutdown, sizeof(__pyx_k_TA_Shutdown), 0, 0, 1, 1}, + {&__pyx_n_s_TA_T3, __pyx_k_TA_T3, sizeof(__pyx_k_TA_T3), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TAN, __pyx_k_TA_TAN, sizeof(__pyx_k_TA_TAN), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TANH, __pyx_k_TA_TANH, sizeof(__pyx_k_TA_TANH), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TEMA, __pyx_k_TA_TEMA, sizeof(__pyx_k_TA_TEMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TRANGE, __pyx_k_TA_TRANGE, sizeof(__pyx_k_TA_TRANGE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TRIMA, __pyx_k_TA_TRIMA, sizeof(__pyx_k_TA_TRIMA), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TRIX, __pyx_k_TA_TRIX, sizeof(__pyx_k_TA_TRIX), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TSF, __pyx_k_TA_TSF, sizeof(__pyx_k_TA_TSF), 0, 0, 1, 1}, + {&__pyx_n_s_TA_TYPPRICE, __pyx_k_TA_TYPPRICE, sizeof(__pyx_k_TA_TYPPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_ULTOSC, __pyx_k_TA_ULTOSC, sizeof(__pyx_k_TA_ULTOSC), 0, 0, 1, 1}, + {&__pyx_n_s_TA_VAR, __pyx_k_TA_VAR, sizeof(__pyx_k_TA_VAR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_WCLPRICE, __pyx_k_TA_WCLPRICE, sizeof(__pyx_k_TA_WCLPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_TA_WILLR, __pyx_k_TA_WILLR, sizeof(__pyx_k_TA_WILLR), 0, 0, 1, 1}, + {&__pyx_n_s_TA_WMA, __pyx_k_TA_WMA, sizeof(__pyx_k_TA_WMA), 0, 0, 1, 1}, + {&__pyx_n_s_TEMA, __pyx_k_TEMA, sizeof(__pyx_k_TEMA), 0, 0, 1, 1}, + {&__pyx_n_s_TRANGE, __pyx_k_TRANGE, sizeof(__pyx_k_TRANGE), 0, 0, 1, 1}, + {&__pyx_n_s_TRIMA, __pyx_k_TRIMA, sizeof(__pyx_k_TRIMA), 0, 0, 1, 1}, + {&__pyx_n_s_TRIX, __pyx_k_TRIX, sizeof(__pyx_k_TRIX), 0, 0, 1, 1}, + {&__pyx_n_s_TSF, __pyx_k_TSF, sizeof(__pyx_k_TSF), 0, 0, 1, 1}, + {&__pyx_n_s_TYPPRICE, __pyx_k_TYPPRICE, sizeof(__pyx_k_TYPPRICE), 0, 0, 1, 1}, + {&__pyx_kp_s_This_is_a_pythonic_wrapper_arou, __pyx_k_This_is_a_pythonic_wrapper_arou, sizeof(__pyx_k_This_is_a_pythonic_wrapper_arou), 0, 0, 1, 0}, + {&__pyx_kp_s_Triangular_Moving_Average, __pyx_k_Triangular_Moving_Average, sizeof(__pyx_k_Triangular_Moving_Average), 0, 0, 1, 0}, + {&__pyx_kp_s_Triple_Exponential_Moving_Averag, __pyx_k_Triple_Exponential_Moving_Averag, sizeof(__pyx_k_Triple_Exponential_Moving_Averag), 0, 0, 1, 0}, + {&__pyx_kp_s_Triple_Generalized_Double_Expone, __pyx_k_Triple_Generalized_Double_Expone, sizeof(__pyx_k_Triple_Generalized_Double_Expone), 0, 0, 1, 0}, + {&__pyx_n_s_ULTOSC, __pyx_k_ULTOSC, sizeof(__pyx_k_ULTOSC), 0, 0, 1, 1}, + {&__pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR, __pyx_k_Unknown_Error_TA_UNKNOWN_ERR, sizeof(__pyx_k_Unknown_Error_TA_UNKNOWN_ERR), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l, sizeof(__pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_2, sizeof(__pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_3, sizeof(__pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_4, sizeof(__pyx_k_Users_kelvin_GitHub_mrjbq7_ta_l_4), 0, 0, 1, 0}, + {&__pyx_n_s_VAR, __pyx_k_VAR, sizeof(__pyx_k_VAR), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Values_represent_a_lower_limit, __pyx_k_Values_represent_a_lower_limit, sizeof(__pyx_k_Values_represent_a_lower_limit), 0, 0, 1, 0}, + {&__pyx_kp_s_Values_represent_an_upper_limit, __pyx_k_Values_represent_an_upper_limit, sizeof(__pyx_k_Values_represent_an_upper_limit), 0, 0, 1, 0}, + {&__pyx_n_s_WCLPRICE, __pyx_k_WCLPRICE, sizeof(__pyx_k_WCLPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_WILLR, __pyx_k_WILLR, sizeof(__pyx_k_WILLR), 0, 0, 1, 1}, + {&__pyx_n_s_WMA, __pyx_k_WMA, sizeof(__pyx_k_WMA), 0, 0, 1, 1}, + {&__pyx_kp_s_Weighted_Moving_Average, __pyx_k_Weighted_Moving_Average, sizeof(__pyx_k_Weighted_Moving_Average), 0, 0, 1, 0}, + {&__pyx_kp_s__1211, __pyx_k__1211, sizeof(__pyx_k__1211), 0, 0, 1, 0}, + {&__pyx_kp_s__1212, __pyx_k__1212, sizeof(__pyx_k__1212), 0, 0, 1, 0}, + {&__pyx_kp_s__1214, __pyx_k__1214, sizeof(__pyx_k__1214), 0, 0, 1, 0}, + {&__pyx_kp_s__1215, __pyx_k__1215, sizeof(__pyx_k__1215), 0, 0, 1, 0}, + {&__pyx_kp_s__1216, __pyx_k__1216, sizeof(__pyx_k__1216), 0, 0, 1, 0}, + {&__pyx_kp_s__1217, __pyx_k__1217, sizeof(__pyx_k__1217), 0, 0, 1, 0}, + {&__pyx_n_s_acceleration, __pyx_k_acceleration, sizeof(__pyx_k_acceleration), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationinitlong, __pyx_k_accelerationinitlong, sizeof(__pyx_k_accelerationinitlong), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationinitshort, __pyx_k_accelerationinitshort, sizeof(__pyx_k_accelerationinitshort), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationlong, __pyx_k_accelerationlong, sizeof(__pyx_k_accelerationlong), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationmaxlong, __pyx_k_accelerationmaxlong, sizeof(__pyx_k_accelerationmaxlong), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationmaxshort, __pyx_k_accelerationmaxshort, sizeof(__pyx_k_accelerationmaxshort), 0, 0, 1, 1}, + {&__pyx_n_s_accelerationshort, __pyx_k_accelerationshort, sizeof(__pyx_k_accelerationshort), 0, 0, 1, 1}, + {&__pyx_kp_s_any_ndarray, __pyx_k_any_ndarray, sizeof(__pyx_k_any_ndarray), 0, 0, 1, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_begidx, __pyx_k_begidx, sizeof(__pyx_k_begidx), 0, 0, 1, 1}, + {&__pyx_n_s_bytes2str, __pyx_k_bytes2str, sizeof(__pyx_k_bytes2str), 0, 0, 1, 1}, + {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, + {&__pyx_n_s_call_function, __pyx_k_call_function, sizeof(__pyx_k_call_function), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_close_data, __pyx_k_close_data, sizeof(__pyx_k_close_data), 0, 0, 1, 1}, + {&__pyx_kp_s_close_has_wrong_dimensions, __pyx_k_close_has_wrong_dimensions, sizeof(__pyx_k_close_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_close_is_not_double, __pyx_k_close_is_not_double, sizeof(__pyx_k_close_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_column_stack, __pyx_k_column_stack, sizeof(__pyx_k_column_stack), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_default_value, __pyx_k_default_value, sizeof(__pyx_k_default_value), 0, 0, 1, 1}, + {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_display_name, __pyx_k_display_name, sizeof(__pyx_k_display_name), 0, 0, 1, 1}, + {&__pyx_kp_s_display_name_s_group_s, __pyx_k_display_name_s_group_s, sizeof(__pyx_k_display_name_s_group_s), 0, 0, 1, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_docs, __pyx_k_docs, sizeof(__pyx_k_docs), 0, 0, 1, 1}, + {&__pyx_n_s_documentation, __pyx_k_documentation, sizeof(__pyx_k_documentation), 0, 0, 1, 1}, + {&__pyx_n_s_endidx, __pyx_k_endidx, sizeof(__pyx_k_endidx), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_fastd_matype, __pyx_k_fastd_matype, sizeof(__pyx_k_fastd_matype), 0, 0, 1, 1}, + {&__pyx_n_s_fastd_period, __pyx_k_fastd_period, sizeof(__pyx_k_fastd_period), 0, 0, 1, 1}, + {&__pyx_n_s_fastk_period, __pyx_k_fastk_period, sizeof(__pyx_k_fastk_period), 0, 0, 1, 1}, + {&__pyx_n_s_fastlimit, __pyx_k_fastlimit, sizeof(__pyx_k_fastlimit), 0, 0, 1, 1}, + {&__pyx_n_s_fastmatype, __pyx_k_fastmatype, sizeof(__pyx_k_fastmatype), 0, 0, 1, 1}, + {&__pyx_n_s_fastperiod, __pyx_k_fastperiod, sizeof(__pyx_k_fastperiod), 0, 0, 1, 1}, + {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_flags_lookup_dict, __pyx_k_flags_lookup_dict, sizeof(__pyx_k_flags_lookup_dict), 0, 0, 1, 1}, + {&__pyx_n_s_func_args, __pyx_k_func_args, sizeof(__pyx_k_func_args), 0, 0, 1, 1}, + {&__pyx_n_s_func_info, __pyx_k_func_info, sizeof(__pyx_k_func_info), 0, 0, 1, 1}, + {&__pyx_n_s_func_line, __pyx_k_func_line, sizeof(__pyx_k_func_line), 0, 0, 1, 1}, + {&__pyx_n_s_func_object, __pyx_k_func_object, sizeof(__pyx_k_func_object), 0, 0, 1, 1}, + {&__pyx_n_s_function_flags, __pyx_k_function_flags, sizeof(__pyx_k_function_flags), 0, 0, 1, 1}, + {&__pyx_n_s_function_name, __pyx_k_function_name, sizeof(__pyx_k_function_name), 0, 0, 1, 1}, + {&__pyx_n_s_functions, __pyx_k_functions, sizeof(__pyx_k_functions), 0, 0, 1, 1}, + {&__pyx_n_s_get_defaults_and_docs, __pyx_k_get_defaults_and_docs, sizeof(__pyx_k_get_defaults_and_docs), 0, 0, 1, 1}, + {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, + {&__pyx_n_s_get_input_arrays, __pyx_k_get_input_arrays, sizeof(__pyx_k_get_input_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_get_input_names, __pyx_k_get_input_names, sizeof(__pyx_k_get_input_names), 0, 0, 1, 1}, + {&__pyx_n_s_get_opt_input_value, __pyx_k_get_opt_input_value, sizeof(__pyx_k_get_opt_input_value), 0, 0, 1, 1}, + {&__pyx_n_s_get_parameters, __pyx_k_get_parameters, sizeof(__pyx_k_get_parameters), 0, 0, 1, 1}, + {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, + {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1}, + {&__pyx_n_s_help, __pyx_k_help, sizeof(__pyx_k_help), 0, 0, 1, 1}, + {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1}, + {&__pyx_n_s_high_data, __pyx_k_high_data, sizeof(__pyx_k_high_data), 0, 0, 1, 1}, + {&__pyx_kp_s_high_has_wrong_dimensions, __pyx_k_high_has_wrong_dimensions, sizeof(__pyx_k_high_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_high_is_not_double, __pyx_k_high_is_not_double, sizeof(__pyx_k_high_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_holder, __pyx_k_holder, sizeof(__pyx_k_holder), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_in, __pyx_k_in, sizeof(__pyx_k_in), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_initialize_function_info, __pyx_k_initialize_function_info, sizeof(__pyx_k_initialize_function_info), 0, 0, 1, 1}, + {&__pyx_n_s_input_arrays, __pyx_k_input_arrays, sizeof(__pyx_k_input_arrays), 0, 0, 1, 1}, + {&__pyx_kp_s_input_arrays_2, __pyx_k_input_arrays_2, sizeof(__pyx_k_input_arrays_2), 0, 0, 1, 0}, + {&__pyx_kp_s_input_arrays_parameter_missing_r, __pyx_k_input_arrays_parameter_missing_r, sizeof(__pyx_k_input_arrays_parameter_missing_r), 0, 0, 1, 0}, + {&__pyx_kp_s_input_lengths_are_different, __pyx_k_input_lengths_are_different, sizeof(__pyx_k_input_lengths_are_different), 0, 0, 1, 0}, + {&__pyx_n_s_input_name, __pyx_k_input_name, sizeof(__pyx_k_input_name), 0, 0, 1, 1}, + {&__pyx_n_s_input_names, __pyx_k_input_names, sizeof(__pyx_k_input_names), 0, 0, 1, 1}, + {&__pyx_n_s_input_price_series_names, __pyx_k_input_price_series_names, sizeof(__pyx_k_input_price_series_names), 0, 0, 1, 1}, + {&__pyx_n_s_input_price_series_names_2, __pyx_k_input_price_series_names_2, sizeof(__pyx_k_input_price_series_names_2), 0, 0, 1, 1}, + {&__pyx_kp_s_inputs_are_all_NaN, __pyx_k_inputs_are_all_NaN, sizeof(__pyx_k_inputs_are_all_NaN), 0, 0, 1, 0}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_kp_s_integer_values_are_100_0_or_100, __pyx_k_integer_values_are_100_0_or_100, sizeof(__pyx_k_integer_values_are_100_0_or_100), 0, 0, 1, 0}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1}, + {&__pyx_n_s_lookback, __pyx_k_lookback, sizeof(__pyx_k_lookback), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1}, + {&__pyx_n_s_low_data, __pyx_k_low_data, sizeof(__pyx_k_low_data), 0, 0, 1, 1}, + {&__pyx_kp_s_low_has_wrong_dimensions, __pyx_k_low_has_wrong_dimensions, sizeof(__pyx_k_low_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_low_is_not_double, __pyx_k_low_is_not_double, sizeof(__pyx_k_low_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, + {&__pyx_n_s_matype, __pyx_k_matype, sizeof(__pyx_k_matype), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_int, __pyx_k_max_int, sizeof(__pyx_k_max_int), 0, 0, 1, 1}, + {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, + {&__pyx_n_s_maxperiod, __pyx_k_maxperiod, sizeof(__pyx_k_maxperiod), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_min_int, __pyx_k_min_int, sizeof(__pyx_k_min_int), 0, 0, 1, 1}, + {&__pyx_n_s_minperiod, __pyx_k_minperiod, sizeof(__pyx_k_minperiod), 0, 0, 1, 1}, + {&__pyx_n_s_missing_keys, __pyx_k_missing_keys, sizeof(__pyx_k_missing_keys), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nbdev, __pyx_k_nbdev, sizeof(__pyx_k_nbdev), 0, 0, 1, 1}, + {&__pyx_n_s_nbdevdn, __pyx_k_nbdevdn, sizeof(__pyx_k_nbdevdn), 0, 0, 1, 1}, + {&__pyx_n_s_nbdevup, __pyx_k_nbdevup, sizeof(__pyx_k_nbdevup), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_num_inputs, __pyx_k_num_inputs, sizeof(__pyx_k_num_inputs), 0, 0, 1, 1}, + {&__pyx_n_s_num_opt_inputs, __pyx_k_num_opt_inputs, sizeof(__pyx_k_num_opt_inputs), 0, 0, 1, 1}, + {&__pyx_n_s_num_outputs, __pyx_k_num_outputs, sizeof(__pyx_k_num_outputs), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_offsetonreverse, __pyx_k_offsetonreverse, sizeof(__pyx_k_offsetonreverse), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_openInterest, __pyx_k_openInterest, sizeof(__pyx_k_openInterest), 0, 0, 1, 1}, + {&__pyx_n_s_open_data, __pyx_k_open_data, sizeof(__pyx_k_open_data), 0, 0, 1, 1}, + {&__pyx_kp_s_open_has_wrong_dimensions, __pyx_k_open_has_wrong_dimensions, sizeof(__pyx_k_open_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_open_is_not_double, __pyx_k_open_is_not_double, sizeof(__pyx_k_open_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_optIn, __pyx_k_optIn, sizeof(__pyx_k_optIn), 0, 0, 1, 1}, + {&__pyx_n_s_opt_input, __pyx_k_opt_input, sizeof(__pyx_k_opt_input), 0, 0, 1, 1}, + {&__pyx_n_s_ordereddict, __pyx_k_ordereddict, sizeof(__pyx_k_ordereddict), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_outaroondown, __pyx_k_outaroondown, sizeof(__pyx_k_outaroondown), 0, 0, 1, 1}, + {&__pyx_n_s_outaroondown_data, __pyx_k_outaroondown_data, sizeof(__pyx_k_outaroondown_data), 0, 0, 1, 1}, + {&__pyx_n_s_outaroonup, __pyx_k_outaroonup, sizeof(__pyx_k_outaroonup), 0, 0, 1, 1}, + {&__pyx_n_s_outaroonup_data, __pyx_k_outaroonup_data, sizeof(__pyx_k_outaroonup_data), 0, 0, 1, 1}, + {&__pyx_n_s_outbegidx, __pyx_k_outbegidx, sizeof(__pyx_k_outbegidx), 0, 0, 1, 1}, + {&__pyx_n_s_outfama, __pyx_k_outfama, sizeof(__pyx_k_outfama), 0, 0, 1, 1}, + {&__pyx_n_s_outfama_data, __pyx_k_outfama_data, sizeof(__pyx_k_outfama_data), 0, 0, 1, 1}, + {&__pyx_n_s_outfastd, __pyx_k_outfastd, sizeof(__pyx_k_outfastd), 0, 0, 1, 1}, + {&__pyx_n_s_outfastd_data, __pyx_k_outfastd_data, sizeof(__pyx_k_outfastd_data), 0, 0, 1, 1}, + {&__pyx_n_s_outfastk, __pyx_k_outfastk, sizeof(__pyx_k_outfastk), 0, 0, 1, 1}, + {&__pyx_n_s_outfastk_data, __pyx_k_outfastk_data, sizeof(__pyx_k_outfastk_data), 0, 0, 1, 1}, + {&__pyx_n_s_outinphase, __pyx_k_outinphase, sizeof(__pyx_k_outinphase), 0, 0, 1, 1}, + {&__pyx_n_s_outinphase_data, __pyx_k_outinphase_data, sizeof(__pyx_k_outinphase_data), 0, 0, 1, 1}, + {&__pyx_n_s_outinteger, __pyx_k_outinteger, sizeof(__pyx_k_outinteger), 0, 0, 1, 1}, + {&__pyx_n_s_outinteger_data, __pyx_k_outinteger_data, sizeof(__pyx_k_outinteger_data), 0, 0, 1, 1}, + {&__pyx_n_s_outleadsine, __pyx_k_outleadsine, sizeof(__pyx_k_outleadsine), 0, 0, 1, 1}, + {&__pyx_n_s_outleadsine_data, __pyx_k_outleadsine_data, sizeof(__pyx_k_outleadsine_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmacd, __pyx_k_outmacd, sizeof(__pyx_k_outmacd), 0, 0, 1, 1}, + {&__pyx_n_s_outmacd_data, __pyx_k_outmacd_data, sizeof(__pyx_k_outmacd_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmacdhist, __pyx_k_outmacdhist, sizeof(__pyx_k_outmacdhist), 0, 0, 1, 1}, + {&__pyx_n_s_outmacdhist_data, __pyx_k_outmacdhist_data, sizeof(__pyx_k_outmacdhist_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmacdsignal, __pyx_k_outmacdsignal, sizeof(__pyx_k_outmacdsignal), 0, 0, 1, 1}, + {&__pyx_n_s_outmacdsignal_data, __pyx_k_outmacdsignal_data, sizeof(__pyx_k_outmacdsignal_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmama, __pyx_k_outmama, sizeof(__pyx_k_outmama), 0, 0, 1, 1}, + {&__pyx_n_s_outmama_data, __pyx_k_outmama_data, sizeof(__pyx_k_outmama_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmax, __pyx_k_outmax, sizeof(__pyx_k_outmax), 0, 0, 1, 1}, + {&__pyx_n_s_outmax_data, __pyx_k_outmax_data, sizeof(__pyx_k_outmax_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmaxidx, __pyx_k_outmaxidx, sizeof(__pyx_k_outmaxidx), 0, 0, 1, 1}, + {&__pyx_n_s_outmaxidx_data, __pyx_k_outmaxidx_data, sizeof(__pyx_k_outmaxidx_data), 0, 0, 1, 1}, + {&__pyx_n_s_outmin, __pyx_k_outmin, sizeof(__pyx_k_outmin), 0, 0, 1, 1}, + {&__pyx_n_s_outmin_data, __pyx_k_outmin_data, sizeof(__pyx_k_outmin_data), 0, 0, 1, 1}, + {&__pyx_n_s_outminidx, __pyx_k_outminidx, sizeof(__pyx_k_outminidx), 0, 0, 1, 1}, + {&__pyx_n_s_outminidx_data, __pyx_k_outminidx_data, sizeof(__pyx_k_outminidx_data), 0, 0, 1, 1}, + {&__pyx_n_s_outnbelement, __pyx_k_outnbelement, sizeof(__pyx_k_outnbelement), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_output_flags, __pyx_k_output_flags, sizeof(__pyx_k_output_flags), 0, 0, 1, 1}, + {&__pyx_n_s_output_name, __pyx_k_output_name, sizeof(__pyx_k_output_name), 0, 0, 1, 1}, + {&__pyx_n_s_output_names, __pyx_k_output_names, sizeof(__pyx_k_output_names), 0, 0, 1, 1}, + {&__pyx_n_s_outputs, __pyx_k_outputs, sizeof(__pyx_k_outputs), 0, 0, 1, 1}, + {&__pyx_n_s_outquadrature, __pyx_k_outquadrature, sizeof(__pyx_k_outquadrature), 0, 0, 1, 1}, + {&__pyx_n_s_outquadrature_data, __pyx_k_outquadrature_data, sizeof(__pyx_k_outquadrature_data), 0, 0, 1, 1}, + {&__pyx_n_s_outreal, __pyx_k_outreal, sizeof(__pyx_k_outreal), 0, 0, 1, 1}, + {&__pyx_n_s_outreal_data, __pyx_k_outreal_data, sizeof(__pyx_k_outreal_data), 0, 0, 1, 1}, + {&__pyx_n_s_outreallowerband, __pyx_k_outreallowerband, sizeof(__pyx_k_outreallowerband), 0, 0, 1, 1}, + {&__pyx_n_s_outreallowerband_data, __pyx_k_outreallowerband_data, sizeof(__pyx_k_outreallowerband_data), 0, 0, 1, 1}, + {&__pyx_n_s_outrealmiddleband, __pyx_k_outrealmiddleband, sizeof(__pyx_k_outrealmiddleband), 0, 0, 1, 1}, + {&__pyx_n_s_outrealmiddleband_data, __pyx_k_outrealmiddleband_data, sizeof(__pyx_k_outrealmiddleband_data), 0, 0, 1, 1}, + {&__pyx_n_s_outrealupperband, __pyx_k_outrealupperband, sizeof(__pyx_k_outrealupperband), 0, 0, 1, 1}, + {&__pyx_n_s_outrealupperband_data, __pyx_k_outrealupperband_data, sizeof(__pyx_k_outrealupperband_data), 0, 0, 1, 1}, + {&__pyx_n_s_outsine, __pyx_k_outsine, sizeof(__pyx_k_outsine), 0, 0, 1, 1}, + {&__pyx_n_s_outsine_data, __pyx_k_outsine_data, sizeof(__pyx_k_outsine_data), 0, 0, 1, 1}, + {&__pyx_n_s_outslowd, __pyx_k_outslowd, sizeof(__pyx_k_outslowd), 0, 0, 1, 1}, + {&__pyx_n_s_outslowd_data, __pyx_k_outslowd_data, sizeof(__pyx_k_outslowd_data), 0, 0, 1, 1}, + {&__pyx_n_s_outslowk, __pyx_k_outslowk, sizeof(__pyx_k_outslowk), 0, 0, 1, 1}, + {&__pyx_n_s_outslowk_data, __pyx_k_outslowk_data, sizeof(__pyx_k_outslowk_data), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, + {&__pyx_n_s_param_name, __pyx_k_param_name, sizeof(__pyx_k_param_name), 0, 0, 1, 1}, + {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_penetration, __pyx_k_penetration, sizeof(__pyx_k_penetration), 0, 0, 1, 1}, + {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, + {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, + {&__pyx_n_s_periods_data, __pyx_k_periods_data, sizeof(__pyx_k_periods_data), 0, 0, 1, 1}, + {&__pyx_kp_s_periods_has_wrong_dimensions, __pyx_k_periods_has_wrong_dimensions, sizeof(__pyx_k_periods_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_periods_is_not_double, __pyx_k_periods_is_not_double, sizeof(__pyx_k_periods_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_price, __pyx_k_price, sizeof(__pyx_k_price), 0, 0, 1, 1}, + {&__pyx_n_s_price0, __pyx_k_price0, sizeof(__pyx_k_price0), 0, 0, 1, 1}, + {&__pyx_n_s_price1, __pyx_k_price1, sizeof(__pyx_k_price1), 0, 0, 1, 1}, + {&__pyx_n_s_price_series, __pyx_k_price_series, sizeof(__pyx_k_price_series), 0, 0, 1, 1}, + {&__pyx_n_s_prices, __pyx_k_prices, sizeof(__pyx_k_prices), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, + {&__pyx_n_s_real0, __pyx_k_real0, sizeof(__pyx_k_real0), 0, 0, 1, 1}, + {&__pyx_n_s_real0_data, __pyx_k_real0_data, sizeof(__pyx_k_real0_data), 0, 0, 1, 1}, + {&__pyx_kp_s_real0_has_wrong_dimensions, __pyx_k_real0_has_wrong_dimensions, sizeof(__pyx_k_real0_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_real0_is_not_double, __pyx_k_real0_is_not_double, sizeof(__pyx_k_real0_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_real1, __pyx_k_real1, sizeof(__pyx_k_real1), 0, 0, 1, 1}, + {&__pyx_n_s_real1_data, __pyx_k_real1_data, sizeof(__pyx_k_real1_data), 0, 0, 1, 1}, + {&__pyx_kp_s_real1_has_wrong_dimensions, __pyx_k_real1_has_wrong_dimensions, sizeof(__pyx_k_real1_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_real1_is_not_double, __pyx_k_real1_is_not_double, sizeof(__pyx_k_real1_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_real_data, __pyx_k_real_data, sizeof(__pyx_k_real_data), 0, 0, 1, 1}, + {&__pyx_kp_s_real_has_wrong_dimensions, __pyx_k_real_has_wrong_dimensions, sizeof(__pyx_k_real_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_real_is_not_double, __pyx_k_real_is_not_double, sizeof(__pyx_k_real_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_retCode, __pyx_k_retCode, sizeof(__pyx_k_retCode), 0, 0, 1, 1}, + {&__pyx_n_s_ret_code, __pyx_k_ret_code, sizeof(__pyx_k_ret_code), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0}, + {&__pyx_kp_s_s_4, __pyx_k_s_4, sizeof(__pyx_k_s_4), 0, 0, 1, 0}, + {&__pyx_kp_s_s_function_failed_with_error_co, __pyx_k_s_function_failed_with_error_co, sizeof(__pyx_k_s_function_failed_with_error_co), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1}, + {&__pyx_n_s_set_function_args, __pyx_k_set_function_args, sizeof(__pyx_k_set_function_args), 0, 0, 1, 1}, + {&__pyx_n_s_set_input_arrays, __pyx_k_set_input_arrays, sizeof(__pyx_k_set_input_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_set_input_names, __pyx_k_set_input_names, sizeof(__pyx_k_set_input_names), 0, 0, 1, 1}, + {&__pyx_n_s_set_parameters, __pyx_k_set_parameters, sizeof(__pyx_k_set_parameters), 0, 0, 1, 1}, + {&__pyx_n_s_signalmatype, __pyx_k_signalmatype, sizeof(__pyx_k_signalmatype), 0, 0, 1, 1}, + {&__pyx_n_s_signalperiod, __pyx_k_signalperiod, sizeof(__pyx_k_signalperiod), 0, 0, 1, 1}, + {&__pyx_n_s_skip_first, __pyx_k_skip_first, sizeof(__pyx_k_skip_first), 0, 0, 1, 1}, + {&__pyx_n_s_slowd_matype, __pyx_k_slowd_matype, sizeof(__pyx_k_slowd_matype), 0, 0, 1, 1}, + {&__pyx_n_s_slowd_period, __pyx_k_slowd_period, sizeof(__pyx_k_slowd_period), 0, 0, 1, 1}, + {&__pyx_n_s_slowk_matype, __pyx_k_slowk_matype, sizeof(__pyx_k_slowk_matype), 0, 0, 1, 1}, + {&__pyx_n_s_slowk_period, __pyx_k_slowk_period, sizeof(__pyx_k_slowk_period), 0, 0, 1, 1}, + {&__pyx_n_s_slowlimit, __pyx_k_slowlimit, sizeof(__pyx_k_slowlimit), 0, 0, 1, 1}, + {&__pyx_n_s_slowmatype, __pyx_k_slowmatype, sizeof(__pyx_k_slowmatype), 0, 0, 1, 1}, + {&__pyx_n_s_slowperiod, __pyx_k_slowperiod, sizeof(__pyx_k_slowperiod), 0, 0, 1, 1}, + {&__pyx_n_s_startvalue, __pyx_k_startvalue, sizeof(__pyx_k_startvalue), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_str2bytes, __pyx_k_str2bytes, sizeof(__pyx_k_str2bytes), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ACOS, __pyx_k_stream_ACOS, sizeof(__pyx_k_stream_ACOS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_AD, __pyx_k_stream_AD, sizeof(__pyx_k_stream_AD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ADD, __pyx_k_stream_ADD, sizeof(__pyx_k_stream_ADD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ADOSC, __pyx_k_stream_ADOSC, sizeof(__pyx_k_stream_ADOSC), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ADX, __pyx_k_stream_ADX, sizeof(__pyx_k_stream_ADX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ADXR, __pyx_k_stream_ADXR, sizeof(__pyx_k_stream_ADXR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_APO, __pyx_k_stream_APO, sizeof(__pyx_k_stream_APO), 0, 0, 1, 1}, + {&__pyx_n_s_stream_AROON, __pyx_k_stream_AROON, sizeof(__pyx_k_stream_AROON), 0, 0, 1, 1}, + {&__pyx_n_s_stream_AROONOSC, __pyx_k_stream_AROONOSC, sizeof(__pyx_k_stream_AROONOSC), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ASIN, __pyx_k_stream_ASIN, sizeof(__pyx_k_stream_ASIN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ATAN, __pyx_k_stream_ATAN, sizeof(__pyx_k_stream_ATAN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ATR, __pyx_k_stream_ATR, sizeof(__pyx_k_stream_ATR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_AVGPRICE, __pyx_k_stream_AVGPRICE, sizeof(__pyx_k_stream_AVGPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_BBANDS, __pyx_k_stream_BBANDS, sizeof(__pyx_k_stream_BBANDS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_BETA, __pyx_k_stream_BETA, sizeof(__pyx_k_stream_BETA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_BOP, __pyx_k_stream_BOP, sizeof(__pyx_k_stream_BOP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CCI, __pyx_k_stream_CCI, sizeof(__pyx_k_stream_CCI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL2CROWS, __pyx_k_stream_CDL2CROWS, sizeof(__pyx_k_stream_CDL2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3BLACKCROWS, __pyx_k_stream_CDL3BLACKCROWS, sizeof(__pyx_k_stream_CDL3BLACKCROWS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3INSIDE, __pyx_k_stream_CDL3INSIDE, sizeof(__pyx_k_stream_CDL3INSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3LINESTRIKE, __pyx_k_stream_CDL3LINESTRIKE, sizeof(__pyx_k_stream_CDL3LINESTRIKE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3OUTSIDE, __pyx_k_stream_CDL3OUTSIDE, sizeof(__pyx_k_stream_CDL3OUTSIDE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3STARSINSOUTH, __pyx_k_stream_CDL3STARSINSOUTH, sizeof(__pyx_k_stream_CDL3STARSINSOUTH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDL3WHITESOLDIERS, __pyx_k_stream_CDL3WHITESOLDIERS, sizeof(__pyx_k_stream_CDL3WHITESOLDIERS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLABANDONEDBABY, __pyx_k_stream_CDLABANDONEDBABY, sizeof(__pyx_k_stream_CDLABANDONEDBABY), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLADVANCEBLOCK, __pyx_k_stream_CDLADVANCEBLOCK, sizeof(__pyx_k_stream_CDLADVANCEBLOCK), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLBELTHOLD, __pyx_k_stream_CDLBELTHOLD, sizeof(__pyx_k_stream_CDLBELTHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLBREAKAWAY, __pyx_k_stream_CDLBREAKAWAY, sizeof(__pyx_k_stream_CDLBREAKAWAY), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLCLOSINGMARUBOZU, __pyx_k_stream_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_stream_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLCONCEALBABYSWALL, __pyx_k_stream_CDLCONCEALBABYSWALL, sizeof(__pyx_k_stream_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLCOUNTERATTACK, __pyx_k_stream_CDLCOUNTERATTACK, sizeof(__pyx_k_stream_CDLCOUNTERATTACK), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLDARKCLOUDCOVER, __pyx_k_stream_CDLDARKCLOUDCOVER, sizeof(__pyx_k_stream_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLDOJI, __pyx_k_stream_CDLDOJI, sizeof(__pyx_k_stream_CDLDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLDOJISTAR, __pyx_k_stream_CDLDOJISTAR, sizeof(__pyx_k_stream_CDLDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLDRAGONFLYDOJI, __pyx_k_stream_CDLDRAGONFLYDOJI, sizeof(__pyx_k_stream_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLENGULFING, __pyx_k_stream_CDLENGULFING, sizeof(__pyx_k_stream_CDLENGULFING), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLEVENINGDOJISTAR, __pyx_k_stream_CDLEVENINGDOJISTAR, sizeof(__pyx_k_stream_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLEVENINGSTAR, __pyx_k_stream_CDLEVENINGSTAR, sizeof(__pyx_k_stream_CDLEVENINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLGAPSIDESIDEWHITE, __pyx_k_stream_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_stream_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLGRAVESTONEDOJI, __pyx_k_stream_CDLGRAVESTONEDOJI, sizeof(__pyx_k_stream_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHAMMER, __pyx_k_stream_CDLHAMMER, sizeof(__pyx_k_stream_CDLHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHANGINGMAN, __pyx_k_stream_CDLHANGINGMAN, sizeof(__pyx_k_stream_CDLHANGINGMAN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHARAMI, __pyx_k_stream_CDLHARAMI, sizeof(__pyx_k_stream_CDLHARAMI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHARAMICROSS, __pyx_k_stream_CDLHARAMICROSS, sizeof(__pyx_k_stream_CDLHARAMICROSS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHIGHWAVE, __pyx_k_stream_CDLHIGHWAVE, sizeof(__pyx_k_stream_CDLHIGHWAVE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHIKKAKE, __pyx_k_stream_CDLHIKKAKE, sizeof(__pyx_k_stream_CDLHIKKAKE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHIKKAKEMOD, __pyx_k_stream_CDLHIKKAKEMOD, sizeof(__pyx_k_stream_CDLHIKKAKEMOD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLHOMINGPIGEON, __pyx_k_stream_CDLHOMINGPIGEON, sizeof(__pyx_k_stream_CDLHOMINGPIGEON), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLIDENTICAL3CROWS, __pyx_k_stream_CDLIDENTICAL3CROWS, sizeof(__pyx_k_stream_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLINNECK, __pyx_k_stream_CDLINNECK, sizeof(__pyx_k_stream_CDLINNECK), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLINVERTEDHAMMER, __pyx_k_stream_CDLINVERTEDHAMMER, sizeof(__pyx_k_stream_CDLINVERTEDHAMMER), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLKICKING, __pyx_k_stream_CDLKICKING, sizeof(__pyx_k_stream_CDLKICKING), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLKICKINGBYLENGTH, __pyx_k_stream_CDLKICKINGBYLENGTH, sizeof(__pyx_k_stream_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLLADDERBOTTOM, __pyx_k_stream_CDLLADDERBOTTOM, sizeof(__pyx_k_stream_CDLLADDERBOTTOM), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLLONGLEGGEDDOJI, __pyx_k_stream_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_stream_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLLONGLINE, __pyx_k_stream_CDLLONGLINE, sizeof(__pyx_k_stream_CDLLONGLINE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLMARUBOZU, __pyx_k_stream_CDLMARUBOZU, sizeof(__pyx_k_stream_CDLMARUBOZU), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLMATCHINGLOW, __pyx_k_stream_CDLMATCHINGLOW, sizeof(__pyx_k_stream_CDLMATCHINGLOW), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLMATHOLD, __pyx_k_stream_CDLMATHOLD, sizeof(__pyx_k_stream_CDLMATHOLD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLMORNINGDOJISTAR, __pyx_k_stream_CDLMORNINGDOJISTAR, sizeof(__pyx_k_stream_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLMORNINGSTAR, __pyx_k_stream_CDLMORNINGSTAR, sizeof(__pyx_k_stream_CDLMORNINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLONNECK, __pyx_k_stream_CDLONNECK, sizeof(__pyx_k_stream_CDLONNECK), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLPIERCING, __pyx_k_stream_CDLPIERCING, sizeof(__pyx_k_stream_CDLPIERCING), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLRICKSHAWMAN, __pyx_k_stream_CDLRICKSHAWMAN, sizeof(__pyx_k_stream_CDLRICKSHAWMAN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLRISEFALL3METHODS, __pyx_k_stream_CDLRISEFALL3METHODS, sizeof(__pyx_k_stream_CDLRISEFALL3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSEPARATINGLINES, __pyx_k_stream_CDLSEPARATINGLINES, sizeof(__pyx_k_stream_CDLSEPARATINGLINES), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSHOOTINGSTAR, __pyx_k_stream_CDLSHOOTINGSTAR, sizeof(__pyx_k_stream_CDLSHOOTINGSTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSHORTLINE, __pyx_k_stream_CDLSHORTLINE, sizeof(__pyx_k_stream_CDLSHORTLINE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSPINNINGTOP, __pyx_k_stream_CDLSPINNINGTOP, sizeof(__pyx_k_stream_CDLSPINNINGTOP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSTALLEDPATTERN, __pyx_k_stream_CDLSTALLEDPATTERN, sizeof(__pyx_k_stream_CDLSTALLEDPATTERN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLSTICKSANDWICH, __pyx_k_stream_CDLSTICKSANDWICH, sizeof(__pyx_k_stream_CDLSTICKSANDWICH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLTAKURI, __pyx_k_stream_CDLTAKURI, sizeof(__pyx_k_stream_CDLTAKURI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLTASUKIGAP, __pyx_k_stream_CDLTASUKIGAP, sizeof(__pyx_k_stream_CDLTASUKIGAP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLTHRUSTING, __pyx_k_stream_CDLTHRUSTING, sizeof(__pyx_k_stream_CDLTHRUSTING), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLTRISTAR, __pyx_k_stream_CDLTRISTAR, sizeof(__pyx_k_stream_CDLTRISTAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLUNIQUE3RIVER, __pyx_k_stream_CDLUNIQUE3RIVER, sizeof(__pyx_k_stream_CDLUNIQUE3RIVER), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLUPSIDEGAP2CROWS, __pyx_k_stream_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_stream_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CDLXSIDEGAP3METHODS, __pyx_k_stream_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_stream_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CEIL, __pyx_k_stream_CEIL, sizeof(__pyx_k_stream_CEIL), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CMO, __pyx_k_stream_CMO, sizeof(__pyx_k_stream_CMO), 0, 0, 1, 1}, + {&__pyx_n_s_stream_CORREL, __pyx_k_stream_CORREL, sizeof(__pyx_k_stream_CORREL), 0, 0, 1, 1}, + {&__pyx_n_s_stream_COS, __pyx_k_stream_COS, sizeof(__pyx_k_stream_COS), 0, 0, 1, 1}, + {&__pyx_n_s_stream_COSH, __pyx_k_stream_COSH, sizeof(__pyx_k_stream_COSH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_DEMA, __pyx_k_stream_DEMA, sizeof(__pyx_k_stream_DEMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_DIV, __pyx_k_stream_DIV, sizeof(__pyx_k_stream_DIV), 0, 0, 1, 1}, + {&__pyx_n_s_stream_DX, __pyx_k_stream_DX, sizeof(__pyx_k_stream_DX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_EMA, __pyx_k_stream_EMA, sizeof(__pyx_k_stream_EMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_EXP, __pyx_k_stream_EXP, sizeof(__pyx_k_stream_EXP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_FLOOR, __pyx_k_stream_FLOOR, sizeof(__pyx_k_stream_FLOOR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_DCPERIOD, __pyx_k_stream_HT_DCPERIOD, sizeof(__pyx_k_stream_HT_DCPERIOD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_DCPHASE, __pyx_k_stream_HT_DCPHASE, sizeof(__pyx_k_stream_HT_DCPHASE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_PHASOR, __pyx_k_stream_HT_PHASOR, sizeof(__pyx_k_stream_HT_PHASOR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_SINE, __pyx_k_stream_HT_SINE, sizeof(__pyx_k_stream_HT_SINE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_TRENDLINE, __pyx_k_stream_HT_TRENDLINE, sizeof(__pyx_k_stream_HT_TRENDLINE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_HT_TRENDMODE, __pyx_k_stream_HT_TRENDMODE, sizeof(__pyx_k_stream_HT_TRENDMODE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_KAMA, __pyx_k_stream_KAMA, sizeof(__pyx_k_stream_KAMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LINEARREG, __pyx_k_stream_LINEARREG, sizeof(__pyx_k_stream_LINEARREG), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LINEARREG_ANGLE, __pyx_k_stream_LINEARREG_ANGLE, sizeof(__pyx_k_stream_LINEARREG_ANGLE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LINEARREG_INTERCEPT, __pyx_k_stream_LINEARREG_INTERCEPT, sizeof(__pyx_k_stream_LINEARREG_INTERCEPT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LINEARREG_SLOPE, __pyx_k_stream_LINEARREG_SLOPE, sizeof(__pyx_k_stream_LINEARREG_SLOPE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LN, __pyx_k_stream_LN, sizeof(__pyx_k_stream_LN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_LOG10, __pyx_k_stream_LOG10, sizeof(__pyx_k_stream_LOG10), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MA, __pyx_k_stream_MA, sizeof(__pyx_k_stream_MA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MACD, __pyx_k_stream_MACD, sizeof(__pyx_k_stream_MACD), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MACDEXT, __pyx_k_stream_MACDEXT, sizeof(__pyx_k_stream_MACDEXT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MACDFIX, __pyx_k_stream_MACDFIX, sizeof(__pyx_k_stream_MACDFIX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MAMA, __pyx_k_stream_MAMA, sizeof(__pyx_k_stream_MAMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MAVP, __pyx_k_stream_MAVP, sizeof(__pyx_k_stream_MAVP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MAX, __pyx_k_stream_MAX, sizeof(__pyx_k_stream_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MAXINDEX, __pyx_k_stream_MAXINDEX, sizeof(__pyx_k_stream_MAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MEDPRICE, __pyx_k_stream_MEDPRICE, sizeof(__pyx_k_stream_MEDPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MFI, __pyx_k_stream_MFI, sizeof(__pyx_k_stream_MFI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MIDPOINT, __pyx_k_stream_MIDPOINT, sizeof(__pyx_k_stream_MIDPOINT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MIDPRICE, __pyx_k_stream_MIDPRICE, sizeof(__pyx_k_stream_MIDPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MIN, __pyx_k_stream_MIN, sizeof(__pyx_k_stream_MIN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MININDEX, __pyx_k_stream_MININDEX, sizeof(__pyx_k_stream_MININDEX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MINMAX, __pyx_k_stream_MINMAX, sizeof(__pyx_k_stream_MINMAX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MINMAXINDEX, __pyx_k_stream_MINMAXINDEX, sizeof(__pyx_k_stream_MINMAXINDEX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MINUS_DI, __pyx_k_stream_MINUS_DI, sizeof(__pyx_k_stream_MINUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MINUS_DM, __pyx_k_stream_MINUS_DM, sizeof(__pyx_k_stream_MINUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MOM, __pyx_k_stream_MOM, sizeof(__pyx_k_stream_MOM), 0, 0, 1, 1}, + {&__pyx_n_s_stream_MULT, __pyx_k_stream_MULT, sizeof(__pyx_k_stream_MULT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_NATR, __pyx_k_stream_NATR, sizeof(__pyx_k_stream_NATR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_OBV, __pyx_k_stream_OBV, sizeof(__pyx_k_stream_OBV), 0, 0, 1, 1}, + {&__pyx_n_s_stream_PLUS_DI, __pyx_k_stream_PLUS_DI, sizeof(__pyx_k_stream_PLUS_DI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_PLUS_DM, __pyx_k_stream_PLUS_DM, sizeof(__pyx_k_stream_PLUS_DM), 0, 0, 1, 1}, + {&__pyx_n_s_stream_PPO, __pyx_k_stream_PPO, sizeof(__pyx_k_stream_PPO), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ROC, __pyx_k_stream_ROC, sizeof(__pyx_k_stream_ROC), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ROCP, __pyx_k_stream_ROCP, sizeof(__pyx_k_stream_ROCP), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ROCR, __pyx_k_stream_ROCR, sizeof(__pyx_k_stream_ROCR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ROCR100, __pyx_k_stream_ROCR100, sizeof(__pyx_k_stream_ROCR100), 0, 0, 1, 1}, + {&__pyx_n_s_stream_RSI, __pyx_k_stream_RSI, sizeof(__pyx_k_stream_RSI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SAR, __pyx_k_stream_SAR, sizeof(__pyx_k_stream_SAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SAREXT, __pyx_k_stream_SAREXT, sizeof(__pyx_k_stream_SAREXT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SIN, __pyx_k_stream_SIN, sizeof(__pyx_k_stream_SIN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SINH, __pyx_k_stream_SINH, sizeof(__pyx_k_stream_SINH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SMA, __pyx_k_stream_SMA, sizeof(__pyx_k_stream_SMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SQRT, __pyx_k_stream_SQRT, sizeof(__pyx_k_stream_SQRT), 0, 0, 1, 1}, + {&__pyx_n_s_stream_STDDEV, __pyx_k_stream_STDDEV, sizeof(__pyx_k_stream_STDDEV), 0, 0, 1, 1}, + {&__pyx_n_s_stream_STOCH, __pyx_k_stream_STOCH, sizeof(__pyx_k_stream_STOCH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_STOCHF, __pyx_k_stream_STOCHF, sizeof(__pyx_k_stream_STOCHF), 0, 0, 1, 1}, + {&__pyx_n_s_stream_STOCHRSI, __pyx_k_stream_STOCHRSI, sizeof(__pyx_k_stream_STOCHRSI), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SUB, __pyx_k_stream_SUB, sizeof(__pyx_k_stream_SUB), 0, 0, 1, 1}, + {&__pyx_n_s_stream_SUM, __pyx_k_stream_SUM, sizeof(__pyx_k_stream_SUM), 0, 0, 1, 1}, + {&__pyx_n_s_stream_T3, __pyx_k_stream_T3, sizeof(__pyx_k_stream_T3), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TAN, __pyx_k_stream_TAN, sizeof(__pyx_k_stream_TAN), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TANH, __pyx_k_stream_TANH, sizeof(__pyx_k_stream_TANH), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TEMA, __pyx_k_stream_TEMA, sizeof(__pyx_k_stream_TEMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TRANGE, __pyx_k_stream_TRANGE, sizeof(__pyx_k_stream_TRANGE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TRIMA, __pyx_k_stream_TRIMA, sizeof(__pyx_k_stream_TRIMA), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TRIX, __pyx_k_stream_TRIX, sizeof(__pyx_k_stream_TRIX), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TSF, __pyx_k_stream_TSF, sizeof(__pyx_k_stream_TSF), 0, 0, 1, 1}, + {&__pyx_n_s_stream_TYPPRICE, __pyx_k_stream_TYPPRICE, sizeof(__pyx_k_stream_TYPPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_ULTOSC, __pyx_k_stream_ULTOSC, sizeof(__pyx_k_stream_ULTOSC), 0, 0, 1, 1}, + {&__pyx_n_s_stream_VAR, __pyx_k_stream_VAR, sizeof(__pyx_k_stream_VAR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_WCLPRICE, __pyx_k_stream_WCLPRICE, sizeof(__pyx_k_stream_WCLPRICE), 0, 0, 1, 1}, + {&__pyx_n_s_stream_WILLR, __pyx_k_stream_WILLR, sizeof(__pyx_k_stream_WILLR), 0, 0, 1, 1}, + {&__pyx_n_s_stream_WMA, __pyx_k_stream_WMA, sizeof(__pyx_k_stream_WMA), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_ta_func_unst_ids, __pyx_k_ta_func_unst_ids, sizeof(__pyx_k_ta_func_unst_ids), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getFuncInfo, __pyx_k_ta_getFuncInfo, sizeof(__pyx_k_ta_getFuncInfo), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getFuncTable, __pyx_k_ta_getFuncTable, sizeof(__pyx_k_ta_getFuncTable), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getGroupTable, __pyx_k_ta_getGroupTable, sizeof(__pyx_k_ta_getGroupTable), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getInputParameterInfo, __pyx_k_ta_getInputParameterInfo, sizeof(__pyx_k_ta_getInputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getOptInputParameterInfo, __pyx_k_ta_getOptInputParameterInfo, sizeof(__pyx_k_ta_getOptInputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_ta_getOutputParameterInfo, __pyx_k_ta_getOutputParameterInfo, sizeof(__pyx_k_ta_getOutputParameterInfo), 0, 0, 1, 1}, + {&__pyx_n_s_ta_get_unstable_period, __pyx_k_ta_get_unstable_period, sizeof(__pyx_k_ta_get_unstable_period), 0, 0, 1, 1}, + {&__pyx_n_s_ta_initialize, __pyx_k_ta_initialize, sizeof(__pyx_k_ta_initialize), 0, 0, 1, 1}, + {&__pyx_n_s_ta_set_unstable_period, __pyx_k_ta_set_unstable_period, sizeof(__pyx_k_ta_set_unstable_period), 0, 0, 1, 1}, + {&__pyx_n_s_ta_shutdown, __pyx_k_ta_shutdown, sizeof(__pyx_k_ta_shutdown), 0, 0, 1, 1}, + {&__pyx_n_s_ta_version, __pyx_k_ta_version, sizeof(__pyx_k_ta_version), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_talib__ta_lib, __pyx_k_talib__ta_lib, sizeof(__pyx_k_talib__ta_lib), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeStamp, __pyx_k_timeStamp, sizeof(__pyx_k_timeStamp), 0, 0, 1, 1}, + {&__pyx_n_s_timeperiod, __pyx_k_timeperiod, sizeof(__pyx_k_timeperiod), 0, 0, 1, 1}, + {&__pyx_n_s_timeperiod1, __pyx_k_timeperiod1, sizeof(__pyx_k_timeperiod1), 0, 0, 1, 1}, + {&__pyx_n_s_timeperiod2, __pyx_k_timeperiod2, sizeof(__pyx_k_timeperiod2), 0, 0, 1, 1}, + {&__pyx_n_s_timeperiod3, __pyx_k_timeperiod3, sizeof(__pyx_k_timeperiod3), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_update_info, __pyx_k_update_info, sizeof(__pyx_k_update_info), 0, 0, 1, 1}, + {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_value_range, __pyx_k_value_range, sizeof(__pyx_k_value_range), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_vfactor, __pyx_k_vfactor, sizeof(__pyx_k_vfactor), 0, 0, 1, 1}, + {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, + {&__pyx_n_s_volume_data, __pyx_k_volume_data, sizeof(__pyx_k_volume_data), 0, 0, 1, 1}, + {&__pyx_kp_s_volume_has_wrong_dimensions, __pyx_k_volume_has_wrong_dimensions, sizeof(__pyx_k_volume_has_wrong_dimensions), 0, 0, 1, 0}, + {&__pyx_kp_s_volume_is_not_double, __pyx_k_volume_is_not_double, sizeof(__pyx_k_volume_is_not_double), 0, 0, 1, 0}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(1, 138, __pyx_L1_error) + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 30, __pyx_L1_error) + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(1, 114, __pyx_L1_error) + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(1, 114, __pyx_L1_error) + #endif + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(1, 458, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(1, 459, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(4, 799, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "talib/_func.pxi":45 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "talib/_func.pxi":47 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "talib/_func.pxi":60 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ACOS_Lookback( ) + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "talib/_func.pxi":97 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "talib/_func.pxi":99 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "talib/_func.pxi":104 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "talib/_func.pxi":106 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "talib/_func.pxi":111 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "talib/_func.pxi":113 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "talib/_func.pxi":118 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "talib/_func.pxi":120 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "talib/_func.pxi":126 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "talib/_func.pxi":128 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "talib/_func.pxi":130 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "talib/_func.pxi":148 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AD_Lookback( ) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "talib/_func.pxi":184 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "talib/_func.pxi":186 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "talib/_func.pxi":191 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "talib/_func.pxi":193 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "talib/_func.pxi":199 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "talib/_func.pxi":211 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADD_Lookback( ) + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "talib/_func.pxi":251 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "talib/_func.pxi":253 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "talib/_func.pxi":258 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "talib/_func.pxi":260 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "talib/_func.pxi":265 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "talib/_func.pxi":267 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "talib/_func.pxi":272 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "talib/_func.pxi":274 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "talib/_func.pxi":280 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "talib/_func.pxi":282 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "talib/_func.pxi":284 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "talib/_func.pxi":302 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "talib/_func.pxi":340 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "talib/_func.pxi":342 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "talib/_func.pxi":347 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "talib/_func.pxi":349 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "talib/_func.pxi":354 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "talib/_func.pxi":356 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "talib/_func.pxi":362 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "talib/_func.pxi":364 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "talib/_func.pxi":379 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "talib/_func.pxi":417 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "talib/_func.pxi":419 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "talib/_func.pxi":424 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "talib/_func.pxi":426 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "talib/_func.pxi":431 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "talib/_func.pxi":433 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "talib/_func.pxi":439 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "talib/_func.pxi":441 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "talib/_func.pxi":456 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "talib/_func.pxi":494 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "talib/_func.pxi":496 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "talib/_func.pxi":509 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "talib/_func.pxi":549 + * double* outaroonup_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "talib/_func.pxi":551 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "talib/_func.pxi":556 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "talib/_func.pxi":558 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "talib/_func.pxi":564 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "talib/_func.pxi":576 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "talib/_func.pxi":617 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "talib/_func.pxi":619 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "talib/_func.pxi":624 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "talib/_func.pxi":626 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "talib/_func.pxi":632 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "talib/_func.pxi":644 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "talib/_func.pxi":678 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "talib/_func.pxi":680 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "talib/_func.pxi":693 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ASIN_Lookback( ) + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "talib/_func.pxi":727 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "talib/_func.pxi":729 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "talib/_func.pxi":742 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATAN_Lookback( ) + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "talib/_func.pxi":780 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "talib/_func.pxi":782 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "talib/_func.pxi":787 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "talib/_func.pxi":789 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "talib/_func.pxi":794 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "talib/_func.pxi":796 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "talib/_func.pxi":802 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "talib/_func.pxi":804 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "talib/_func.pxi":819 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) + */ + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "talib/_func.pxi":856 + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "talib/_func.pxi":858 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "talib/_func.pxi":863 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "talib/_func.pxi":865 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "talib/_func.pxi":870 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "talib/_func.pxi":872 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "talib/_func.pxi":877 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "talib/_func.pxi":879 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + + /* "talib/_func.pxi":885 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "talib/_func.pxi":887 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + + /* "talib/_func.pxi":889 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + + /* "talib/_func.pxi":907 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) + */ + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "talib/_func.pxi":952 + * double* outreallowerband_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(2, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "talib/_func.pxi":954 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + + /* "talib/_func.pxi":967 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) + */ + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "talib/_func.pxi":1013 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(2, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + + /* "talib/_func.pxi":1015 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(2, 1015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + + /* "talib/_func.pxi":1020 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(2, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + + /* "talib/_func.pxi":1022 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(2, 1022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + + /* "talib/_func.pxi":1028 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(2, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + + /* "talib/_func.pxi":1040 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) + */ + __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(2, 1040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + + /* "talib/_func.pxi":1077 + * double* outreal_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(2, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + + /* "talib/_func.pxi":1079 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(2, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + + /* "talib/_func.pxi":1084 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + + /* "talib/_func.pxi":1086 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(2, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + + /* "talib/_func.pxi":1091 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + + /* "talib/_func.pxi":1093 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 1093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + + /* "talib/_func.pxi":1098 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 1098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + + /* "talib/_func.pxi":1100 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + + /* "talib/_func.pxi":1106 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + + /* "talib/_func.pxi":1108 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 1108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + + /* "talib/_func.pxi":1110 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + + /* "talib/_func.pxi":1128 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_BOP_Lookback( ) + */ + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 1128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + + /* "talib/_func.pxi":1166 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 1166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + + /* "talib/_func.pxi":1168 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 1168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + + /* "talib/_func.pxi":1173 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + + /* "talib/_func.pxi":1175 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + + /* "talib/_func.pxi":1180 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + + /* "talib/_func.pxi":1182 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(2, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + + /* "talib/_func.pxi":1188 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(2, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + + /* "talib/_func.pxi":1190 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(2, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + + /* "talib/_func.pxi":1205 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) + */ + __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 1205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + + /* "talib/_func.pxi":1242 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + + /* "talib/_func.pxi":1244 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(2, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + + /* "talib/_func.pxi":1249 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + + /* "talib/_func.pxi":1251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(2, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + + /* "talib/_func.pxi":1256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(2, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + + /* "talib/_func.pxi":1258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(2, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + + /* "talib/_func.pxi":1263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(2, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + + /* "talib/_func.pxi":1265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(2, 1265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + + /* "talib/_func.pxi":1271 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(2, 1271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + + /* "talib/_func.pxi":1273 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(2, 1273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + + /* "talib/_func.pxi":1275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(2, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + + /* "talib/_func.pxi":1293 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) + */ + __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(2, 1293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + + /* "talib/_func.pxi":1330 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + + /* "talib/_func.pxi":1332 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(2, 1332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__137); + __Pyx_GIVEREF(__pyx_tuple__137); + + /* "talib/_func.pxi":1337 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(2, 1337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + + /* "talib/_func.pxi":1339 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(2, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); + + /* "talib/_func.pxi":1344 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(2, 1344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + + /* "talib/_func.pxi":1346 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(2, 1346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + + /* "talib/_func.pxi":1351 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(2, 1351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + + /* "talib/_func.pxi":1353 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(2, 1353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + + /* "talib/_func.pxi":1359 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(2, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__144); + __Pyx_GIVEREF(__pyx_tuple__144); + + /* "talib/_func.pxi":1361 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(2, 1361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + + /* "talib/_func.pxi":1363 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(2, 1363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__146); + __Pyx_GIVEREF(__pyx_tuple__146); + + /* "talib/_func.pxi":1381 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) + */ + __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(2, 1381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + + /* "talib/_func.pxi":1418 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(2, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__148); + __Pyx_GIVEREF(__pyx_tuple__148); + + /* "talib/_func.pxi":1420 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(2, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + + /* "talib/_func.pxi":1425 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(2, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__150); + __Pyx_GIVEREF(__pyx_tuple__150); + + /* "talib/_func.pxi":1427 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(2, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + + /* "talib/_func.pxi":1432 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(2, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__152); + __Pyx_GIVEREF(__pyx_tuple__152); + + /* "talib/_func.pxi":1434 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(2, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + + /* "talib/_func.pxi":1439 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(2, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__154); + __Pyx_GIVEREF(__pyx_tuple__154); + + /* "talib/_func.pxi":1441 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(2, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + + /* "talib/_func.pxi":1447 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(2, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__156); + __Pyx_GIVEREF(__pyx_tuple__156); + + /* "talib/_func.pxi":1449 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(2, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + + /* "talib/_func.pxi":1451 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(2, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__158); + __Pyx_GIVEREF(__pyx_tuple__158); + + /* "talib/_func.pxi":1469 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) + */ + __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(2, 1469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + + /* "talib/_func.pxi":1506 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__160 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(2, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__160); + __Pyx_GIVEREF(__pyx_tuple__160); + + /* "talib/_func.pxi":1508 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(2, 1508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + + /* "talib/_func.pxi":1513 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(2, 1513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + + /* "talib/_func.pxi":1515 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__163); + __Pyx_GIVEREF(__pyx_tuple__163); + + /* "talib/_func.pxi":1520 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(2, 1520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + + /* "talib/_func.pxi":1522 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(2, 1522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__165); + __Pyx_GIVEREF(__pyx_tuple__165); + + /* "talib/_func.pxi":1527 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(2, 1527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + + /* "talib/_func.pxi":1529 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(2, 1529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__167); + __Pyx_GIVEREF(__pyx_tuple__167); + + /* "talib/_func.pxi":1535 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(2, 1535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + + /* "talib/_func.pxi":1537 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__169 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(2, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__169); + __Pyx_GIVEREF(__pyx_tuple__169); + + /* "talib/_func.pxi":1539 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(2, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + + /* "talib/_func.pxi":1557 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) + */ + __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(2, 1557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__171); + __Pyx_GIVEREF(__pyx_tuple__171); + + /* "talib/_func.pxi":1594 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(2, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + + /* "talib/_func.pxi":1596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(2, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__173); + __Pyx_GIVEREF(__pyx_tuple__173); + + /* "talib/_func.pxi":1601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(2, 1601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + + /* "talib/_func.pxi":1603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(2, 1603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__175); + __Pyx_GIVEREF(__pyx_tuple__175); + + /* "talib/_func.pxi":1608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(2, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + + /* "talib/_func.pxi":1610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(2, 1610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__177); + __Pyx_GIVEREF(__pyx_tuple__177); + + /* "talib/_func.pxi":1615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(2, 1615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + + /* "talib/_func.pxi":1617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(2, 1617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__179); + __Pyx_GIVEREF(__pyx_tuple__179); + + /* "talib/_func.pxi":1623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(2, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + + /* "talib/_func.pxi":1625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__181 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(2, 1625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__181); + __Pyx_GIVEREF(__pyx_tuple__181); + + /* "talib/_func.pxi":1627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(2, 1627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + + /* "talib/_func.pxi":1645 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) + */ + __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(2, 1645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__183); + __Pyx_GIVEREF(__pyx_tuple__183); + + /* "talib/_func.pxi":1682 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(2, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + + /* "talib/_func.pxi":1684 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(2, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__185); + __Pyx_GIVEREF(__pyx_tuple__185); + + /* "talib/_func.pxi":1689 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(2, 1689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + + /* "talib/_func.pxi":1691 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(2, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__187); + __Pyx_GIVEREF(__pyx_tuple__187); + + /* "talib/_func.pxi":1696 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(2, 1696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + + /* "talib/_func.pxi":1698 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(2, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + + /* "talib/_func.pxi":1703 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__190 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(2, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__190); + __Pyx_GIVEREF(__pyx_tuple__190); + + /* "talib/_func.pxi":1705 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(2, 1705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__191); + __Pyx_GIVEREF(__pyx_tuple__191); + + /* "talib/_func.pxi":1711 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(2, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + + /* "talib/_func.pxi":1713 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(2, 1713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + + /* "talib/_func.pxi":1715 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(2, 1715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + + /* "talib/_func.pxi":1733 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) + */ + __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(2, 1733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + + /* "talib/_func.pxi":1770 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(2, 1770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + + /* "talib/_func.pxi":1772 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(2, 1772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__197); + __Pyx_GIVEREF(__pyx_tuple__197); + + /* "talib/_func.pxi":1777 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(2, 1777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + + /* "talib/_func.pxi":1779 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(2, 1779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + + /* "talib/_func.pxi":1784 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(2, 1784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__200); + __Pyx_GIVEREF(__pyx_tuple__200); + + /* "talib/_func.pxi":1786 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(2, 1786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + + /* "talib/_func.pxi":1791 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(2, 1791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__202); + __Pyx_GIVEREF(__pyx_tuple__202); + + /* "talib/_func.pxi":1793 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(2, 1793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + + /* "talib/_func.pxi":1799 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(2, 1799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + + /* "talib/_func.pxi":1801 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(2, 1801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + + /* "talib/_func.pxi":1803 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(2, 1803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__206); + __Pyx_GIVEREF(__pyx_tuple__206); + + /* "talib/_func.pxi":1821 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) + */ + __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(2, 1821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + + /* "talib/_func.pxi":1860 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(2, 1860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + + /* "talib/_func.pxi":1862 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(2, 1862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + + /* "talib/_func.pxi":1867 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(2, 1867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + + /* "talib/_func.pxi":1869 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(2, 1869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + + /* "talib/_func.pxi":1874 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(2, 1874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + + /* "talib/_func.pxi":1876 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(2, 1876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + + /* "talib/_func.pxi":1881 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(2, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + + /* "talib/_func.pxi":1883 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(2, 1883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + + /* "talib/_func.pxi":1889 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(2, 1889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + + /* "talib/_func.pxi":1891 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(2, 1891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + + /* "talib/_func.pxi":1893 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(2, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + + /* "talib/_func.pxi":1911 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) + */ + __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(2, 1911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__219); + __Pyx_GIVEREF(__pyx_tuple__219); + + /* "talib/_func.pxi":1948 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(2, 1948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__220); + __Pyx_GIVEREF(__pyx_tuple__220); + + /* "talib/_func.pxi":1950 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(2, 1950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__221); + __Pyx_GIVEREF(__pyx_tuple__221); + + /* "talib/_func.pxi":1955 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(2, 1955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__222); + __Pyx_GIVEREF(__pyx_tuple__222); + + /* "talib/_func.pxi":1957 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(2, 1957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__223); + __Pyx_GIVEREF(__pyx_tuple__223); + + /* "talib/_func.pxi":1962 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(2, 1962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__224); + __Pyx_GIVEREF(__pyx_tuple__224); + + /* "talib/_func.pxi":1964 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(2, 1964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__225); + __Pyx_GIVEREF(__pyx_tuple__225); + + /* "talib/_func.pxi":1969 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(2, 1969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + + /* "talib/_func.pxi":1971 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(2, 1971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + + /* "talib/_func.pxi":1977 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(2, 1977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__228); + __Pyx_GIVEREF(__pyx_tuple__228); + + /* "talib/_func.pxi":1979 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__229 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(2, 1979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + + /* "talib/_func.pxi":1981 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__230 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(2, 1981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__230); + __Pyx_GIVEREF(__pyx_tuple__230); + + /* "talib/_func.pxi":1999 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) + */ + __pyx_tuple__231 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(2, 1999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + + /* "talib/_func.pxi":2036 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(2, 2036, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + + /* "talib/_func.pxi":2038 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(2, 2038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__233); + __Pyx_GIVEREF(__pyx_tuple__233); + + /* "talib/_func.pxi":2043 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__234 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(2, 2043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__234); + __Pyx_GIVEREF(__pyx_tuple__234); + + /* "talib/_func.pxi":2045 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__235 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(2, 2045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + + /* "talib/_func.pxi":2050 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__236 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(2, 2050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__236); + __Pyx_GIVEREF(__pyx_tuple__236); + + /* "talib/_func.pxi":2052 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__237 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(2, 2052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + + /* "talib/_func.pxi":2057 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__238 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(2, 2057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__238); + __Pyx_GIVEREF(__pyx_tuple__238); + + /* "talib/_func.pxi":2059 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__239 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(2, 2059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + + /* "talib/_func.pxi":2065 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__240 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(2, 2065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__240); + __Pyx_GIVEREF(__pyx_tuple__240); + + /* "talib/_func.pxi":2067 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__241 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(2, 2067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + + /* "talib/_func.pxi":2069 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__242 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(2, 2069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__242); + __Pyx_GIVEREF(__pyx_tuple__242); + + /* "talib/_func.pxi":2087 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) + */ + __pyx_tuple__243 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(2, 2087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + + /* "talib/_func.pxi":2124 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__244 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(2, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__244); + __Pyx_GIVEREF(__pyx_tuple__244); + + /* "talib/_func.pxi":2126 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__245 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(2, 2126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + + /* "talib/_func.pxi":2131 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__246 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(2, 2131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__246); + __Pyx_GIVEREF(__pyx_tuple__246); + + /* "talib/_func.pxi":2133 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__247 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(2, 2133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + + /* "talib/_func.pxi":2138 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__248 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(2, 2138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__248); + __Pyx_GIVEREF(__pyx_tuple__248); + + /* "talib/_func.pxi":2140 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__249 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(2, 2140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__249); + __Pyx_GIVEREF(__pyx_tuple__249); + + /* "talib/_func.pxi":2145 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__250 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(2, 2145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__250); + __Pyx_GIVEREF(__pyx_tuple__250); + + /* "talib/_func.pxi":2147 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__251 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 2147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__251); + __Pyx_GIVEREF(__pyx_tuple__251); + + /* "talib/_func.pxi":2153 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__252 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(2, 2153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__252); + __Pyx_GIVEREF(__pyx_tuple__252); + + /* "talib/_func.pxi":2155 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__253 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(2, 2155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__253); + __Pyx_GIVEREF(__pyx_tuple__253); + + /* "talib/_func.pxi":2157 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(2, 2157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__254); + __Pyx_GIVEREF(__pyx_tuple__254); + + /* "talib/_func.pxi":2175 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) + */ + __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(2, 2175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + + /* "talib/_func.pxi":2212 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(2, 2212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__256); + __Pyx_GIVEREF(__pyx_tuple__256); + + /* "talib/_func.pxi":2214 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(2, 2214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + + /* "talib/_func.pxi":2219 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(2, 2219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__258); + __Pyx_GIVEREF(__pyx_tuple__258); + + /* "talib/_func.pxi":2221 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(2, 2221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + + /* "talib/_func.pxi":2226 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(2, 2226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__260); + __Pyx_GIVEREF(__pyx_tuple__260); + + /* "talib/_func.pxi":2228 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(2, 2228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + + /* "talib/_func.pxi":2233 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(2, 2233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__262); + __Pyx_GIVEREF(__pyx_tuple__262); + + /* "talib/_func.pxi":2235 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(2, 2235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + + /* "talib/_func.pxi":2241 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(2, 2241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__264); + __Pyx_GIVEREF(__pyx_tuple__264); + + /* "talib/_func.pxi":2243 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__265 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(2, 2243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + + /* "talib/_func.pxi":2245 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__266 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(2, 2245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__266); + __Pyx_GIVEREF(__pyx_tuple__266); + + /* "talib/_func.pxi":2263 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) + */ + __pyx_tuple__267 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(2, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + + /* "talib/_func.pxi":2300 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__268 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(2, 2300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__268); + __Pyx_GIVEREF(__pyx_tuple__268); + + /* "talib/_func.pxi":2302 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__269 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(2, 2302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + + /* "talib/_func.pxi":2307 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__270 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(2, 2307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__270); + __Pyx_GIVEREF(__pyx_tuple__270); + + /* "talib/_func.pxi":2309 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__271 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(2, 2309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__271); + __Pyx_GIVEREF(__pyx_tuple__271); + + /* "talib/_func.pxi":2314 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__272 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(2, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__272); + __Pyx_GIVEREF(__pyx_tuple__272); + + /* "talib/_func.pxi":2316 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__273 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(2, 2316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__273); + __Pyx_GIVEREF(__pyx_tuple__273); + + /* "talib/_func.pxi":2321 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__274 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(2, 2321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__274); + __Pyx_GIVEREF(__pyx_tuple__274); + + /* "talib/_func.pxi":2323 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__275 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(2, 2323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__275); + __Pyx_GIVEREF(__pyx_tuple__275); + + /* "talib/_func.pxi":2329 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__276 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(2, 2329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__276); + __Pyx_GIVEREF(__pyx_tuple__276); + + /* "talib/_func.pxi":2331 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__277 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(2, 2331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__277); + __Pyx_GIVEREF(__pyx_tuple__277); + + /* "talib/_func.pxi":2333 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__278 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(2, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__278); + __Pyx_GIVEREF(__pyx_tuple__278); + + /* "talib/_func.pxi":2351 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) + */ + __pyx_tuple__279 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(2, 2351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__279); + __Pyx_GIVEREF(__pyx_tuple__279); + + /* "talib/_func.pxi":2388 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__280 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(2, 2388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__280); + __Pyx_GIVEREF(__pyx_tuple__280); + + /* "talib/_func.pxi":2390 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__281 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(2, 2390, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + + /* "talib/_func.pxi":2395 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__282 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(2, 2395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__282); + __Pyx_GIVEREF(__pyx_tuple__282); + + /* "talib/_func.pxi":2397 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__283 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(2, 2397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__283); + __Pyx_GIVEREF(__pyx_tuple__283); + + /* "talib/_func.pxi":2402 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__284 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(2, 2402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__284); + __Pyx_GIVEREF(__pyx_tuple__284); + + /* "talib/_func.pxi":2404 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__285 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(2, 2404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__285); + __Pyx_GIVEREF(__pyx_tuple__285); + + /* "talib/_func.pxi":2409 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__286 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(2, 2409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__286); + __Pyx_GIVEREF(__pyx_tuple__286); + + /* "talib/_func.pxi":2411 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__287 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(2, 2411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__287); + __Pyx_GIVEREF(__pyx_tuple__287); + + /* "talib/_func.pxi":2417 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__288 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(2, 2417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__288); + __Pyx_GIVEREF(__pyx_tuple__288); + + /* "talib/_func.pxi":2419 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__289 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(2, 2419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + + /* "talib/_func.pxi":2421 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__290 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(2, 2421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__290); + __Pyx_GIVEREF(__pyx_tuple__290); + + /* "talib/_func.pxi":2439 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) + */ + __pyx_tuple__291 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(2, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + + /* "talib/_func.pxi":2478 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__292 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(2, 2478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__292); + __Pyx_GIVEREF(__pyx_tuple__292); + + /* "talib/_func.pxi":2480 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__293 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(2, 2480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + + /* "talib/_func.pxi":2485 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__294 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(2, 2485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__294); + __Pyx_GIVEREF(__pyx_tuple__294); + + /* "talib/_func.pxi":2487 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__295 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(2, 2487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + + /* "talib/_func.pxi":2492 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__296 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(2, 2492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + + /* "talib/_func.pxi":2494 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__297 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(2, 2494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__297); + __Pyx_GIVEREF(__pyx_tuple__297); + + /* "talib/_func.pxi":2499 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__298 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(2, 2499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__298); + __Pyx_GIVEREF(__pyx_tuple__298); + + /* "talib/_func.pxi":2501 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__299 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(2, 2501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__299); + __Pyx_GIVEREF(__pyx_tuple__299); + + /* "talib/_func.pxi":2507 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__300 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(2, 2507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__300); + __Pyx_GIVEREF(__pyx_tuple__300); + + /* "talib/_func.pxi":2509 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__301 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(2, 2509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + + /* "talib/_func.pxi":2511 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__302 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(2, 2511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__302); + __Pyx_GIVEREF(__pyx_tuple__302); + + /* "talib/_func.pxi":2529 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) + */ + __pyx_tuple__303 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(2, 2529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__303); + __Pyx_GIVEREF(__pyx_tuple__303); + + /* "talib/_func.pxi":2566 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__304 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(2, 2566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__304); + __Pyx_GIVEREF(__pyx_tuple__304); + + /* "talib/_func.pxi":2568 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__305 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(2, 2568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__305); + __Pyx_GIVEREF(__pyx_tuple__305); + + /* "talib/_func.pxi":2573 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__306 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(2, 2573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__306); + __Pyx_GIVEREF(__pyx_tuple__306); + + /* "talib/_func.pxi":2575 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__307 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(2, 2575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__307); + __Pyx_GIVEREF(__pyx_tuple__307); + + /* "talib/_func.pxi":2580 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__308 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(2, 2580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__308); + __Pyx_GIVEREF(__pyx_tuple__308); + + /* "talib/_func.pxi":2582 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__309 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(2, 2582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__309); + __Pyx_GIVEREF(__pyx_tuple__309); + + /* "talib/_func.pxi":2587 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__310 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(2, 2587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__310); + __Pyx_GIVEREF(__pyx_tuple__310); + + /* "talib/_func.pxi":2589 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__311 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(2, 2589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__311); + __Pyx_GIVEREF(__pyx_tuple__311); + + /* "talib/_func.pxi":2595 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__312 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(2, 2595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__312); + __Pyx_GIVEREF(__pyx_tuple__312); + + /* "talib/_func.pxi":2597 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__313 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(2, 2597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__313); + __Pyx_GIVEREF(__pyx_tuple__313); + + /* "talib/_func.pxi":2599 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__314 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(2, 2599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__314); + __Pyx_GIVEREF(__pyx_tuple__314); + + /* "talib/_func.pxi":2617 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) + */ + __pyx_tuple__315 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(2, 2617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__315); + __Pyx_GIVEREF(__pyx_tuple__315); + + /* "talib/_func.pxi":2654 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__316 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(2, 2654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__316); + __Pyx_GIVEREF(__pyx_tuple__316); + + /* "talib/_func.pxi":2656 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__317 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(2, 2656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__317); + __Pyx_GIVEREF(__pyx_tuple__317); + + /* "talib/_func.pxi":2661 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__318 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(2, 2661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__318); + __Pyx_GIVEREF(__pyx_tuple__318); + + /* "talib/_func.pxi":2663 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__319 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(2, 2663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__319); + __Pyx_GIVEREF(__pyx_tuple__319); + + /* "talib/_func.pxi":2668 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__320 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(2, 2668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__320); + __Pyx_GIVEREF(__pyx_tuple__320); + + /* "talib/_func.pxi":2670 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__321 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(2, 2670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__321); + __Pyx_GIVEREF(__pyx_tuple__321); + + /* "talib/_func.pxi":2675 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__322 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(2, 2675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__322); + __Pyx_GIVEREF(__pyx_tuple__322); + + /* "talib/_func.pxi":2677 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__323 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(2, 2677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__323); + __Pyx_GIVEREF(__pyx_tuple__323); + + /* "talib/_func.pxi":2683 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__324 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(2, 2683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__324); + __Pyx_GIVEREF(__pyx_tuple__324); + + /* "talib/_func.pxi":2685 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__325 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(2, 2685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__325); + __Pyx_GIVEREF(__pyx_tuple__325); + + /* "talib/_func.pxi":2687 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__326 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(2, 2687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__326); + __Pyx_GIVEREF(__pyx_tuple__326); + + /* "talib/_func.pxi":2705 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) + */ + __pyx_tuple__327 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(2, 2705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__327); + __Pyx_GIVEREF(__pyx_tuple__327); + + /* "talib/_func.pxi":2742 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__328 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(2, 2742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__328); + __Pyx_GIVEREF(__pyx_tuple__328); + + /* "talib/_func.pxi":2744 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__329 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(2, 2744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__329); + __Pyx_GIVEREF(__pyx_tuple__329); + + /* "talib/_func.pxi":2749 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__330 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(2, 2749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__330); + __Pyx_GIVEREF(__pyx_tuple__330); + + /* "talib/_func.pxi":2751 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__331 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(2, 2751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__331); + __Pyx_GIVEREF(__pyx_tuple__331); + + /* "talib/_func.pxi":2756 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__332 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(2, 2756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__332); + __Pyx_GIVEREF(__pyx_tuple__332); + + /* "talib/_func.pxi":2758 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__333 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(2, 2758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__333); + __Pyx_GIVEREF(__pyx_tuple__333); + + /* "talib/_func.pxi":2763 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__334 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(2, 2763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__334); + __Pyx_GIVEREF(__pyx_tuple__334); + + /* "talib/_func.pxi":2765 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__335 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(2, 2765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__335); + __Pyx_GIVEREF(__pyx_tuple__335); + + /* "talib/_func.pxi":2771 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__336 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(2, 2771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__336); + __Pyx_GIVEREF(__pyx_tuple__336); + + /* "talib/_func.pxi":2773 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__337 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(2, 2773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__337); + __Pyx_GIVEREF(__pyx_tuple__337); + + /* "talib/_func.pxi":2775 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__338 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(2, 2775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__338); + __Pyx_GIVEREF(__pyx_tuple__338); + + /* "talib/_func.pxi":2793 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) + */ + __pyx_tuple__339 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(2, 2793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__339); + __Pyx_GIVEREF(__pyx_tuple__339); + + /* "talib/_func.pxi":2830 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__340 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(2, 2830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__340); + __Pyx_GIVEREF(__pyx_tuple__340); + + /* "talib/_func.pxi":2832 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__341 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(2, 2832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__341); + __Pyx_GIVEREF(__pyx_tuple__341); + + /* "talib/_func.pxi":2837 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__342 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(2, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__342); + __Pyx_GIVEREF(__pyx_tuple__342); + + /* "talib/_func.pxi":2839 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__343 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(2, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__343); + __Pyx_GIVEREF(__pyx_tuple__343); + + /* "talib/_func.pxi":2844 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__344 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(2, 2844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__344); + __Pyx_GIVEREF(__pyx_tuple__344); + + /* "talib/_func.pxi":2846 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__345 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(2, 2846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__345); + __Pyx_GIVEREF(__pyx_tuple__345); + + /* "talib/_func.pxi":2851 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__346 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(2, 2851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__346); + __Pyx_GIVEREF(__pyx_tuple__346); + + /* "talib/_func.pxi":2853 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__347 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(2, 2853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__347); + __Pyx_GIVEREF(__pyx_tuple__347); + + /* "talib/_func.pxi":2859 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__348 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(2, 2859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__348); + __Pyx_GIVEREF(__pyx_tuple__348); + + /* "talib/_func.pxi":2861 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__349 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(2, 2861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__349); + __Pyx_GIVEREF(__pyx_tuple__349); + + /* "talib/_func.pxi":2863 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__350 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(2, 2863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__350); + __Pyx_GIVEREF(__pyx_tuple__350); + + /* "talib/_func.pxi":2881 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) + */ + __pyx_tuple__351 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(2, 2881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__351); + __Pyx_GIVEREF(__pyx_tuple__351); + + /* "talib/_func.pxi":2920 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__352 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(2, 2920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__352); + __Pyx_GIVEREF(__pyx_tuple__352); + + /* "talib/_func.pxi":2922 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__353 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(2, 2922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__353); + __Pyx_GIVEREF(__pyx_tuple__353); + + /* "talib/_func.pxi":2927 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__354 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(2, 2927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__354); + __Pyx_GIVEREF(__pyx_tuple__354); + + /* "talib/_func.pxi":2929 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__355 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(2, 2929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__355); + __Pyx_GIVEREF(__pyx_tuple__355); + + /* "talib/_func.pxi":2934 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__356 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(2, 2934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__356); + __Pyx_GIVEREF(__pyx_tuple__356); + + /* "talib/_func.pxi":2936 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__357 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(2, 2936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__357); + __Pyx_GIVEREF(__pyx_tuple__357); + + /* "talib/_func.pxi":2941 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__358 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(2, 2941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__358); + __Pyx_GIVEREF(__pyx_tuple__358); + + /* "talib/_func.pxi":2943 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__359 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(2, 2943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__359); + __Pyx_GIVEREF(__pyx_tuple__359); + + /* "talib/_func.pxi":2949 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__360 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(2, 2949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__360); + __Pyx_GIVEREF(__pyx_tuple__360); + + /* "talib/_func.pxi":2951 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__361 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(2, 2951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__361); + __Pyx_GIVEREF(__pyx_tuple__361); + + /* "talib/_func.pxi":2953 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__362 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(2, 2953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__362); + __Pyx_GIVEREF(__pyx_tuple__362); + + /* "talib/_func.pxi":2971 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) + */ + __pyx_tuple__363 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(2, 2971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__363); + __Pyx_GIVEREF(__pyx_tuple__363); + + /* "talib/_func.pxi":3010 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__364 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(2, 3010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__364); + __Pyx_GIVEREF(__pyx_tuple__364); + + /* "talib/_func.pxi":3012 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__365 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(2, 3012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__365); + __Pyx_GIVEREF(__pyx_tuple__365); + + /* "talib/_func.pxi":3017 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__366 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(2, 3017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__366); + __Pyx_GIVEREF(__pyx_tuple__366); + + /* "talib/_func.pxi":3019 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__367 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(2, 3019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__367); + __Pyx_GIVEREF(__pyx_tuple__367); + + /* "talib/_func.pxi":3024 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__368 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(2, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__368); + __Pyx_GIVEREF(__pyx_tuple__368); + + /* "talib/_func.pxi":3026 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__369 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(2, 3026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__369); + __Pyx_GIVEREF(__pyx_tuple__369); + + /* "talib/_func.pxi":3031 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__370 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(2, 3031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__370); + __Pyx_GIVEREF(__pyx_tuple__370); + + /* "talib/_func.pxi":3033 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__371 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(2, 3033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__371); + __Pyx_GIVEREF(__pyx_tuple__371); + + /* "talib/_func.pxi":3039 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__372 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(2, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__372); + __Pyx_GIVEREF(__pyx_tuple__372); + + /* "talib/_func.pxi":3041 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__373 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(2, 3041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__373); + __Pyx_GIVEREF(__pyx_tuple__373); + + /* "talib/_func.pxi":3043 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__374 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(2, 3043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__374); + __Pyx_GIVEREF(__pyx_tuple__374); + + /* "talib/_func.pxi":3061 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) + */ + __pyx_tuple__375 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(2, 3061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__375); + __Pyx_GIVEREF(__pyx_tuple__375); + + /* "talib/_func.pxi":3098 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__376 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(2, 3098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__376); + __Pyx_GIVEREF(__pyx_tuple__376); + + /* "talib/_func.pxi":3100 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__377 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(2, 3100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__377); + __Pyx_GIVEREF(__pyx_tuple__377); + + /* "talib/_func.pxi":3105 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__378 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(2, 3105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__378); + __Pyx_GIVEREF(__pyx_tuple__378); + + /* "talib/_func.pxi":3107 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__379 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(2, 3107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__379); + __Pyx_GIVEREF(__pyx_tuple__379); + + /* "talib/_func.pxi":3112 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__380 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(2, 3112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__380); + __Pyx_GIVEREF(__pyx_tuple__380); + + /* "talib/_func.pxi":3114 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__381 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(2, 3114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__381); + __Pyx_GIVEREF(__pyx_tuple__381); + + /* "talib/_func.pxi":3119 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__382 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(2, 3119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__382); + __Pyx_GIVEREF(__pyx_tuple__382); + + /* "talib/_func.pxi":3121 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__383 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(2, 3121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__383); + __Pyx_GIVEREF(__pyx_tuple__383); + + /* "talib/_func.pxi":3127 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__384 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(2, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__384); + __Pyx_GIVEREF(__pyx_tuple__384); + + /* "talib/_func.pxi":3129 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__385 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(2, 3129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__385); + __Pyx_GIVEREF(__pyx_tuple__385); + + /* "talib/_func.pxi":3131 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__386 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(2, 3131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__386); + __Pyx_GIVEREF(__pyx_tuple__386); + + /* "talib/_func.pxi":3149 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) + */ + __pyx_tuple__387 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(2, 3149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__387); + __Pyx_GIVEREF(__pyx_tuple__387); + + /* "talib/_func.pxi":3186 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__388 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(2, 3186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__388); + __Pyx_GIVEREF(__pyx_tuple__388); + + /* "talib/_func.pxi":3188 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__389 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(2, 3188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__389); + __Pyx_GIVEREF(__pyx_tuple__389); + + /* "talib/_func.pxi":3193 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__390 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(2, 3193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__390); + __Pyx_GIVEREF(__pyx_tuple__390); + + /* "talib/_func.pxi":3195 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__391 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(2, 3195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__391); + __Pyx_GIVEREF(__pyx_tuple__391); + + /* "talib/_func.pxi":3200 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__392 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(2, 3200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__392); + __Pyx_GIVEREF(__pyx_tuple__392); + + /* "talib/_func.pxi":3202 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__393 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(2, 3202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__393); + __Pyx_GIVEREF(__pyx_tuple__393); + + /* "talib/_func.pxi":3207 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__394 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(2, 3207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__394); + __Pyx_GIVEREF(__pyx_tuple__394); + + /* "talib/_func.pxi":3209 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__395 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(2, 3209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__395); + __Pyx_GIVEREF(__pyx_tuple__395); + + /* "talib/_func.pxi":3215 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__396 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(2, 3215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__396); + __Pyx_GIVEREF(__pyx_tuple__396); + + /* "talib/_func.pxi":3217 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__397 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(2, 3217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__397); + __Pyx_GIVEREF(__pyx_tuple__397); + + /* "talib/_func.pxi":3219 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__398 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(2, 3219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__398); + __Pyx_GIVEREF(__pyx_tuple__398); + + /* "talib/_func.pxi":3237 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) + */ + __pyx_tuple__399 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(2, 3237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__399); + __Pyx_GIVEREF(__pyx_tuple__399); + + /* "talib/_func.pxi":3274 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__400 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(2, 3274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__400); + __Pyx_GIVEREF(__pyx_tuple__400); + + /* "talib/_func.pxi":3276 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__401 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(2, 3276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__401); + __Pyx_GIVEREF(__pyx_tuple__401); + + /* "talib/_func.pxi":3281 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__402 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(2, 3281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__402); + __Pyx_GIVEREF(__pyx_tuple__402); + + /* "talib/_func.pxi":3283 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__403 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(2, 3283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__403); + __Pyx_GIVEREF(__pyx_tuple__403); + + /* "talib/_func.pxi":3288 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__404 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(2, 3288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__404); + __Pyx_GIVEREF(__pyx_tuple__404); + + /* "talib/_func.pxi":3290 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__405 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(2, 3290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__405); + __Pyx_GIVEREF(__pyx_tuple__405); + + /* "talib/_func.pxi":3295 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__406 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(2, 3295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__406); + __Pyx_GIVEREF(__pyx_tuple__406); + + /* "talib/_func.pxi":3297 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__407 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(2, 3297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__407); + __Pyx_GIVEREF(__pyx_tuple__407); + + /* "talib/_func.pxi":3303 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__408 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(2, 3303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__408); + __Pyx_GIVEREF(__pyx_tuple__408); + + /* "talib/_func.pxi":3305 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__409 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(2, 3305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__409); + __Pyx_GIVEREF(__pyx_tuple__409); + + /* "talib/_func.pxi":3307 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__410 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(2, 3307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__410); + __Pyx_GIVEREF(__pyx_tuple__410); + + /* "talib/_func.pxi":3325 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) + */ + __pyx_tuple__411 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(2, 3325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__411); + __Pyx_GIVEREF(__pyx_tuple__411); + + /* "talib/_func.pxi":3362 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__412 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(2, 3362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__412); + __Pyx_GIVEREF(__pyx_tuple__412); + + /* "talib/_func.pxi":3364 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__413 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(2, 3364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__413); + __Pyx_GIVEREF(__pyx_tuple__413); + + /* "talib/_func.pxi":3369 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__414 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(2, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__414); + __Pyx_GIVEREF(__pyx_tuple__414); + + /* "talib/_func.pxi":3371 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__415 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(2, 3371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__415); + __Pyx_GIVEREF(__pyx_tuple__415); + + /* "talib/_func.pxi":3376 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__416 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(2, 3376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__416); + __Pyx_GIVEREF(__pyx_tuple__416); + + /* "talib/_func.pxi":3378 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__417 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(2, 3378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__417); + __Pyx_GIVEREF(__pyx_tuple__417); + + /* "talib/_func.pxi":3383 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__418 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(2, 3383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__418); + __Pyx_GIVEREF(__pyx_tuple__418); + + /* "talib/_func.pxi":3385 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__419 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(2, 3385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__419); + __Pyx_GIVEREF(__pyx_tuple__419); + + /* "talib/_func.pxi":3391 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__420 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(2, 3391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__420); + __Pyx_GIVEREF(__pyx_tuple__420); + + /* "talib/_func.pxi":3393 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__421 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(2, 3393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__421); + __Pyx_GIVEREF(__pyx_tuple__421); + + /* "talib/_func.pxi":3395 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__422 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(2, 3395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__422); + __Pyx_GIVEREF(__pyx_tuple__422); + + /* "talib/_func.pxi":3413 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) + */ + __pyx_tuple__423 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(2, 3413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__423); + __Pyx_GIVEREF(__pyx_tuple__423); + + /* "talib/_func.pxi":3450 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__424 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(2, 3450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__424); + __Pyx_GIVEREF(__pyx_tuple__424); + + /* "talib/_func.pxi":3452 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__425 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(2, 3452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__425); + __Pyx_GIVEREF(__pyx_tuple__425); + + /* "talib/_func.pxi":3457 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__426 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(2, 3457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__426); + __Pyx_GIVEREF(__pyx_tuple__426); + + /* "talib/_func.pxi":3459 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__427 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(2, 3459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__427); + __Pyx_GIVEREF(__pyx_tuple__427); + + /* "talib/_func.pxi":3464 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__428 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(2, 3464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__428); + __Pyx_GIVEREF(__pyx_tuple__428); + + /* "talib/_func.pxi":3466 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__429 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(2, 3466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__429); + __Pyx_GIVEREF(__pyx_tuple__429); + + /* "talib/_func.pxi":3471 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__430 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(2, 3471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__430); + __Pyx_GIVEREF(__pyx_tuple__430); + + /* "talib/_func.pxi":3473 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__431 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(2, 3473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__431); + __Pyx_GIVEREF(__pyx_tuple__431); + + /* "talib/_func.pxi":3479 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__432 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(2, 3479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__432); + __Pyx_GIVEREF(__pyx_tuple__432); + + /* "talib/_func.pxi":3481 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__433 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(2, 3481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__433); + __Pyx_GIVEREF(__pyx_tuple__433); + + /* "talib/_func.pxi":3483 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__434 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(2, 3483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__434); + __Pyx_GIVEREF(__pyx_tuple__434); + + /* "talib/_func.pxi":3501 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) + */ + __pyx_tuple__435 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(2, 3501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__435); + __Pyx_GIVEREF(__pyx_tuple__435); + + /* "talib/_func.pxi":3538 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__436 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(2, 3538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__436); + __Pyx_GIVEREF(__pyx_tuple__436); + + /* "talib/_func.pxi":3540 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__437 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(2, 3540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__437); + __Pyx_GIVEREF(__pyx_tuple__437); + + /* "talib/_func.pxi":3545 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__438 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(2, 3545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__438); + __Pyx_GIVEREF(__pyx_tuple__438); + + /* "talib/_func.pxi":3547 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__439 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(2, 3547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__439); + __Pyx_GIVEREF(__pyx_tuple__439); + + /* "talib/_func.pxi":3552 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__440 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(2, 3552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__440); + __Pyx_GIVEREF(__pyx_tuple__440); + + /* "talib/_func.pxi":3554 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__441 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(2, 3554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__441); + __Pyx_GIVEREF(__pyx_tuple__441); + + /* "talib/_func.pxi":3559 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__442 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(2, 3559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__442); + __Pyx_GIVEREF(__pyx_tuple__442); + + /* "talib/_func.pxi":3561 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__443 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(2, 3561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__443); + __Pyx_GIVEREF(__pyx_tuple__443); + + /* "talib/_func.pxi":3567 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__444 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(2, 3567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__444); + __Pyx_GIVEREF(__pyx_tuple__444); + + /* "talib/_func.pxi":3569 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__445 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(2, 3569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__445); + __Pyx_GIVEREF(__pyx_tuple__445); + + /* "talib/_func.pxi":3571 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__446 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(2, 3571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__446); + __Pyx_GIVEREF(__pyx_tuple__446); + + /* "talib/_func.pxi":3589 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) + */ + __pyx_tuple__447 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(2, 3589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__447); + __Pyx_GIVEREF(__pyx_tuple__447); + + /* "talib/_func.pxi":3626 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__448 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(2, 3626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__448); + __Pyx_GIVEREF(__pyx_tuple__448); + + /* "talib/_func.pxi":3628 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__449 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(2, 3628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__449); + __Pyx_GIVEREF(__pyx_tuple__449); + + /* "talib/_func.pxi":3633 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__450 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(2, 3633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__450); + __Pyx_GIVEREF(__pyx_tuple__450); + + /* "talib/_func.pxi":3635 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__451 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(2, 3635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__451); + __Pyx_GIVEREF(__pyx_tuple__451); + + /* "talib/_func.pxi":3640 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__452 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(2, 3640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__452); + __Pyx_GIVEREF(__pyx_tuple__452); + + /* "talib/_func.pxi":3642 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__453 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(2, 3642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__453); + __Pyx_GIVEREF(__pyx_tuple__453); + + /* "talib/_func.pxi":3647 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__454 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(2, 3647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__454); + __Pyx_GIVEREF(__pyx_tuple__454); + + /* "talib/_func.pxi":3649 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__455 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(2, 3649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__455); + __Pyx_GIVEREF(__pyx_tuple__455); + + /* "talib/_func.pxi":3655 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__456 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(2, 3655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__456); + __Pyx_GIVEREF(__pyx_tuple__456); + + /* "talib/_func.pxi":3657 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__457 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(2, 3657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__457); + __Pyx_GIVEREF(__pyx_tuple__457); + + /* "talib/_func.pxi":3659 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__458 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(2, 3659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__458); + __Pyx_GIVEREF(__pyx_tuple__458); + + /* "talib/_func.pxi":3677 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) + */ + __pyx_tuple__459 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(2, 3677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__459); + __Pyx_GIVEREF(__pyx_tuple__459); + + /* "talib/_func.pxi":3714 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__460 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(2, 3714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__460); + __Pyx_GIVEREF(__pyx_tuple__460); + + /* "talib/_func.pxi":3716 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__461 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(2, 3716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__461); + __Pyx_GIVEREF(__pyx_tuple__461); + + /* "talib/_func.pxi":3721 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__462 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(2, 3721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__462); + __Pyx_GIVEREF(__pyx_tuple__462); + + /* "talib/_func.pxi":3723 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__463 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(2, 3723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__463); + __Pyx_GIVEREF(__pyx_tuple__463); + + /* "talib/_func.pxi":3728 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__464 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(2, 3728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__464); + __Pyx_GIVEREF(__pyx_tuple__464); + + /* "talib/_func.pxi":3730 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__465 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(2, 3730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__465); + __Pyx_GIVEREF(__pyx_tuple__465); + + /* "talib/_func.pxi":3735 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__466 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(2, 3735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__466); + __Pyx_GIVEREF(__pyx_tuple__466); + + /* "talib/_func.pxi":3737 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__467 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 3737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__467); + __Pyx_GIVEREF(__pyx_tuple__467); + + /* "talib/_func.pxi":3743 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__468 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(2, 3743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__468); + __Pyx_GIVEREF(__pyx_tuple__468); + + /* "talib/_func.pxi":3745 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__469 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 3745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__469); + __Pyx_GIVEREF(__pyx_tuple__469); + + /* "talib/_func.pxi":3747 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__470 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(2, 3747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__470); + __Pyx_GIVEREF(__pyx_tuple__470); + + /* "talib/_func.pxi":3765 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) + */ + __pyx_tuple__471 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 3765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__471); + __Pyx_GIVEREF(__pyx_tuple__471); + + /* "talib/_func.pxi":3802 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__472 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(2, 3802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__472); + __Pyx_GIVEREF(__pyx_tuple__472); + + /* "talib/_func.pxi":3804 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__473 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 3804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__473); + __Pyx_GIVEREF(__pyx_tuple__473); + + /* "talib/_func.pxi":3809 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__474 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(2, 3809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__474); + __Pyx_GIVEREF(__pyx_tuple__474); + + /* "talib/_func.pxi":3811 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__475 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 3811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__475); + __Pyx_GIVEREF(__pyx_tuple__475); + + /* "talib/_func.pxi":3816 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__476 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(2, 3816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__476); + __Pyx_GIVEREF(__pyx_tuple__476); + + /* "talib/_func.pxi":3818 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__477 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 3818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__477); + __Pyx_GIVEREF(__pyx_tuple__477); + + /* "talib/_func.pxi":3823 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__478 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(2, 3823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__478); + __Pyx_GIVEREF(__pyx_tuple__478); + + /* "talib/_func.pxi":3825 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__479 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 3825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__479); + __Pyx_GIVEREF(__pyx_tuple__479); + + /* "talib/_func.pxi":3831 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__480 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(2, 3831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__480); + __Pyx_GIVEREF(__pyx_tuple__480); + + /* "talib/_func.pxi":3833 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__481 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 3833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__481); + __Pyx_GIVEREF(__pyx_tuple__481); + + /* "talib/_func.pxi":3835 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__482 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(2, 3835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__482); + __Pyx_GIVEREF(__pyx_tuple__482); + + /* "talib/_func.pxi":3853 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) + */ + __pyx_tuple__483 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(2, 3853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__483); + __Pyx_GIVEREF(__pyx_tuple__483); + + /* "talib/_func.pxi":3890 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__484 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(2, 3890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__484); + __Pyx_GIVEREF(__pyx_tuple__484); + + /* "talib/_func.pxi":3892 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__485 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(2, 3892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__485); + __Pyx_GIVEREF(__pyx_tuple__485); + + /* "talib/_func.pxi":3897 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__486 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(2, 3897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__486); + __Pyx_GIVEREF(__pyx_tuple__486); + + /* "talib/_func.pxi":3899 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__487 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(2, 3899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__487); + __Pyx_GIVEREF(__pyx_tuple__487); + + /* "talib/_func.pxi":3904 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__488 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(2, 3904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__488); + __Pyx_GIVEREF(__pyx_tuple__488); + + /* "talib/_func.pxi":3906 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__489 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(2, 3906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__489); + __Pyx_GIVEREF(__pyx_tuple__489); + + /* "talib/_func.pxi":3911 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__490 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(2, 3911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__490); + __Pyx_GIVEREF(__pyx_tuple__490); + + /* "talib/_func.pxi":3913 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__491 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(2, 3913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__491); + __Pyx_GIVEREF(__pyx_tuple__491); + + /* "talib/_func.pxi":3919 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__492 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(2, 3919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__492); + __Pyx_GIVEREF(__pyx_tuple__492); + + /* "talib/_func.pxi":3921 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__493 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(2, 3921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__493); + __Pyx_GIVEREF(__pyx_tuple__493); + + /* "talib/_func.pxi":3923 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__494 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(2, 3923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__494); + __Pyx_GIVEREF(__pyx_tuple__494); + + /* "talib/_func.pxi":3941 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) + */ + __pyx_tuple__495 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(2, 3941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__495); + __Pyx_GIVEREF(__pyx_tuple__495); + + /* "talib/_func.pxi":3978 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__496 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(2, 3978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__496); + __Pyx_GIVEREF(__pyx_tuple__496); + + /* "talib/_func.pxi":3980 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__497 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(2, 3980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__497); + __Pyx_GIVEREF(__pyx_tuple__497); + + /* "talib/_func.pxi":3985 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__498 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(2, 3985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__498); + __Pyx_GIVEREF(__pyx_tuple__498); + + /* "talib/_func.pxi":3987 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__499 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(2, 3987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__499); + __Pyx_GIVEREF(__pyx_tuple__499); + + /* "talib/_func.pxi":3992 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__500 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(2, 3992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__500); + __Pyx_GIVEREF(__pyx_tuple__500); + + /* "talib/_func.pxi":3994 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__501 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(2, 3994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__501); + __Pyx_GIVEREF(__pyx_tuple__501); + + /* "talib/_func.pxi":3999 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__502 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(2, 3999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__502); + __Pyx_GIVEREF(__pyx_tuple__502); + + /* "talib/_func.pxi":4001 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__503 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(2, 4001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__503); + __Pyx_GIVEREF(__pyx_tuple__503); + + /* "talib/_func.pxi":4007 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__504 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(2, 4007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__504); + __Pyx_GIVEREF(__pyx_tuple__504); + + /* "talib/_func.pxi":4009 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__505 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(2, 4009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__505); + __Pyx_GIVEREF(__pyx_tuple__505); + + /* "talib/_func.pxi":4011 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__506 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(2, 4011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__506); + __Pyx_GIVEREF(__pyx_tuple__506); + + /* "talib/_func.pxi":4029 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) + */ + __pyx_tuple__507 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(2, 4029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__507); + __Pyx_GIVEREF(__pyx_tuple__507); + + /* "talib/_func.pxi":4066 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__508 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(2, 4066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__508); + __Pyx_GIVEREF(__pyx_tuple__508); + + /* "talib/_func.pxi":4068 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__509 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(2, 4068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__509); + __Pyx_GIVEREF(__pyx_tuple__509); + + /* "talib/_func.pxi":4073 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__510 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(2, 4073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__510); + __Pyx_GIVEREF(__pyx_tuple__510); + + /* "talib/_func.pxi":4075 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__511 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(2, 4075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__511); + __Pyx_GIVEREF(__pyx_tuple__511); + + /* "talib/_func.pxi":4080 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__512 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(2, 4080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__512); + __Pyx_GIVEREF(__pyx_tuple__512); + + /* "talib/_func.pxi":4082 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__513 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(2, 4082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__513); + __Pyx_GIVEREF(__pyx_tuple__513); + + /* "talib/_func.pxi":4087 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__514 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(2, 4087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__514); + __Pyx_GIVEREF(__pyx_tuple__514); + + /* "talib/_func.pxi":4089 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__515 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__515)) __PYX_ERR(2, 4089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__515); + __Pyx_GIVEREF(__pyx_tuple__515); + + /* "talib/_func.pxi":4095 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__516 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(2, 4095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__516); + __Pyx_GIVEREF(__pyx_tuple__516); + + /* "talib/_func.pxi":4097 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__517 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(2, 4097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__517); + __Pyx_GIVEREF(__pyx_tuple__517); + + /* "talib/_func.pxi":4099 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__518 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(2, 4099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__518); + __Pyx_GIVEREF(__pyx_tuple__518); + + /* "talib/_func.pxi":4117 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) + */ + __pyx_tuple__519 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(2, 4117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__519); + __Pyx_GIVEREF(__pyx_tuple__519); + + /* "talib/_func.pxi":4154 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__520 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(2, 4154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__520); + __Pyx_GIVEREF(__pyx_tuple__520); + + /* "talib/_func.pxi":4156 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__521 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(2, 4156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__521); + __Pyx_GIVEREF(__pyx_tuple__521); + + /* "talib/_func.pxi":4161 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__522 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(2, 4161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__522); + __Pyx_GIVEREF(__pyx_tuple__522); + + /* "talib/_func.pxi":4163 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__523 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__523)) __PYX_ERR(2, 4163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__523); + __Pyx_GIVEREF(__pyx_tuple__523); + + /* "talib/_func.pxi":4168 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__524 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(2, 4168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__524); + __Pyx_GIVEREF(__pyx_tuple__524); + + /* "talib/_func.pxi":4170 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__525 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__525)) __PYX_ERR(2, 4170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__525); + __Pyx_GIVEREF(__pyx_tuple__525); + + /* "talib/_func.pxi":4175 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__526 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(2, 4175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__526); + __Pyx_GIVEREF(__pyx_tuple__526); + + /* "talib/_func.pxi":4177 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__527 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(2, 4177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__527); + __Pyx_GIVEREF(__pyx_tuple__527); + + /* "talib/_func.pxi":4183 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__528 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(2, 4183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__528); + __Pyx_GIVEREF(__pyx_tuple__528); + + /* "talib/_func.pxi":4185 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__529 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(2, 4185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__529); + __Pyx_GIVEREF(__pyx_tuple__529); + + /* "talib/_func.pxi":4187 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__530 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(2, 4187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__530); + __Pyx_GIVEREF(__pyx_tuple__530); + + /* "talib/_func.pxi":4205 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) + */ + __pyx_tuple__531 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(2, 4205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__531); + __Pyx_GIVEREF(__pyx_tuple__531); + + /* "talib/_func.pxi":4242 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__532 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(2, 4242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__532); + __Pyx_GIVEREF(__pyx_tuple__532); + + /* "talib/_func.pxi":4244 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__533 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__533)) __PYX_ERR(2, 4244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__533); + __Pyx_GIVEREF(__pyx_tuple__533); + + /* "talib/_func.pxi":4249 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__534 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(2, 4249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__534); + __Pyx_GIVEREF(__pyx_tuple__534); + + /* "talib/_func.pxi":4251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__535 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(2, 4251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__535); + __Pyx_GIVEREF(__pyx_tuple__535); + + /* "talib/_func.pxi":4256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__536 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(2, 4256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__536); + __Pyx_GIVEREF(__pyx_tuple__536); + + /* "talib/_func.pxi":4258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__537 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(2, 4258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__537); + __Pyx_GIVEREF(__pyx_tuple__537); + + /* "talib/_func.pxi":4263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__538 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(2, 4263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__538); + __Pyx_GIVEREF(__pyx_tuple__538); + + /* "talib/_func.pxi":4265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__539 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(2, 4265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__539); + __Pyx_GIVEREF(__pyx_tuple__539); + + /* "talib/_func.pxi":4271 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__540 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(2, 4271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__540); + __Pyx_GIVEREF(__pyx_tuple__540); + + /* "talib/_func.pxi":4273 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__541 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(2, 4273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__541); + __Pyx_GIVEREF(__pyx_tuple__541); + + /* "talib/_func.pxi":4275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__542 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(2, 4275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__542); + __Pyx_GIVEREF(__pyx_tuple__542); + + /* "talib/_func.pxi":4293 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) + */ + __pyx_tuple__543 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(2, 4293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__543); + __Pyx_GIVEREF(__pyx_tuple__543); + + /* "talib/_func.pxi":4330 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__544 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(2, 4330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__544); + __Pyx_GIVEREF(__pyx_tuple__544); + + /* "talib/_func.pxi":4332 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__545 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(2, 4332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__545); + __Pyx_GIVEREF(__pyx_tuple__545); + + /* "talib/_func.pxi":4337 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__546 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(2, 4337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__546); + __Pyx_GIVEREF(__pyx_tuple__546); + + /* "talib/_func.pxi":4339 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__547 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(2, 4339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__547); + __Pyx_GIVEREF(__pyx_tuple__547); + + /* "talib/_func.pxi":4344 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__548 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(2, 4344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__548); + __Pyx_GIVEREF(__pyx_tuple__548); + + /* "talib/_func.pxi":4346 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__549 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(2, 4346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__549); + __Pyx_GIVEREF(__pyx_tuple__549); + + /* "talib/_func.pxi":4351 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__550 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(2, 4351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__550); + __Pyx_GIVEREF(__pyx_tuple__550); + + /* "talib/_func.pxi":4353 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__551 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(2, 4353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__551); + __Pyx_GIVEREF(__pyx_tuple__551); + + /* "talib/_func.pxi":4359 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__552 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(2, 4359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__552); + __Pyx_GIVEREF(__pyx_tuple__552); + + /* "talib/_func.pxi":4361 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__553 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(2, 4361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__553); + __Pyx_GIVEREF(__pyx_tuple__553); + + /* "talib/_func.pxi":4363 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__554 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(2, 4363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__554); + __Pyx_GIVEREF(__pyx_tuple__554); + + /* "talib/_func.pxi":4381 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) + */ + __pyx_tuple__555 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__555)) __PYX_ERR(2, 4381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__555); + __Pyx_GIVEREF(__pyx_tuple__555); + + /* "talib/_func.pxi":4418 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__556 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(2, 4418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__556); + __Pyx_GIVEREF(__pyx_tuple__556); + + /* "talib/_func.pxi":4420 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__557 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__557)) __PYX_ERR(2, 4420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__557); + __Pyx_GIVEREF(__pyx_tuple__557); + + /* "talib/_func.pxi":4425 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__558 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(2, 4425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__558); + __Pyx_GIVEREF(__pyx_tuple__558); + + /* "talib/_func.pxi":4427 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__559 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__559)) __PYX_ERR(2, 4427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__559); + __Pyx_GIVEREF(__pyx_tuple__559); + + /* "talib/_func.pxi":4432 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__560 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(2, 4432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__560); + __Pyx_GIVEREF(__pyx_tuple__560); + + /* "talib/_func.pxi":4434 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__561 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__561)) __PYX_ERR(2, 4434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__561); + __Pyx_GIVEREF(__pyx_tuple__561); + + /* "talib/_func.pxi":4439 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__562 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__562)) __PYX_ERR(2, 4439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__562); + __Pyx_GIVEREF(__pyx_tuple__562); + + /* "talib/_func.pxi":4441 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__563 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(2, 4441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__563); + __Pyx_GIVEREF(__pyx_tuple__563); + + /* "talib/_func.pxi":4447 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__564 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(2, 4447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__564); + __Pyx_GIVEREF(__pyx_tuple__564); + + /* "talib/_func.pxi":4449 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__565 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__565)) __PYX_ERR(2, 4449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__565); + __Pyx_GIVEREF(__pyx_tuple__565); + + /* "talib/_func.pxi":4451 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__566 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(2, 4451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__566); + __Pyx_GIVEREF(__pyx_tuple__566); + + /* "talib/_func.pxi":4469 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) + */ + __pyx_tuple__567 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(2, 4469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__567); + __Pyx_GIVEREF(__pyx_tuple__567); + + /* "talib/_func.pxi":4506 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__568 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(2, 4506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__568); + __Pyx_GIVEREF(__pyx_tuple__568); + + /* "talib/_func.pxi":4508 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__569 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(2, 4508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__569); + __Pyx_GIVEREF(__pyx_tuple__569); + + /* "talib/_func.pxi":4513 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__570 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__570)) __PYX_ERR(2, 4513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__570); + __Pyx_GIVEREF(__pyx_tuple__570); + + /* "talib/_func.pxi":4515 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__571 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(2, 4515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__571); + __Pyx_GIVEREF(__pyx_tuple__571); + + /* "talib/_func.pxi":4520 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__572 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__572)) __PYX_ERR(2, 4520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__572); + __Pyx_GIVEREF(__pyx_tuple__572); + + /* "talib/_func.pxi":4522 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__573 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__573)) __PYX_ERR(2, 4522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__573); + __Pyx_GIVEREF(__pyx_tuple__573); + + /* "talib/_func.pxi":4527 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__574 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__574)) __PYX_ERR(2, 4527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__574); + __Pyx_GIVEREF(__pyx_tuple__574); + + /* "talib/_func.pxi":4529 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__575 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(2, 4529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__575); + __Pyx_GIVEREF(__pyx_tuple__575); + + /* "talib/_func.pxi":4535 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__576 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__576)) __PYX_ERR(2, 4535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__576); + __Pyx_GIVEREF(__pyx_tuple__576); + + /* "talib/_func.pxi":4537 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__577 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(2, 4537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__577); + __Pyx_GIVEREF(__pyx_tuple__577); + + /* "talib/_func.pxi":4539 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__578 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__578)) __PYX_ERR(2, 4539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__578); + __Pyx_GIVEREF(__pyx_tuple__578); + + /* "talib/_func.pxi":4557 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) + */ + __pyx_tuple__579 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(2, 4557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__579); + __Pyx_GIVEREF(__pyx_tuple__579); + + /* "talib/_func.pxi":4594 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__580 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__580)) __PYX_ERR(2, 4594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__580); + __Pyx_GIVEREF(__pyx_tuple__580); + + /* "talib/_func.pxi":4596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__581 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(2, 4596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__581); + __Pyx_GIVEREF(__pyx_tuple__581); + + /* "talib/_func.pxi":4601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__582 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__582)) __PYX_ERR(2, 4601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__582); + __Pyx_GIVEREF(__pyx_tuple__582); + + /* "talib/_func.pxi":4603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__583 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(2, 4603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__583); + __Pyx_GIVEREF(__pyx_tuple__583); + + /* "talib/_func.pxi":4608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__584 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__584)) __PYX_ERR(2, 4608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__584); + __Pyx_GIVEREF(__pyx_tuple__584); + + /* "talib/_func.pxi":4610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__585 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(2, 4610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__585); + __Pyx_GIVEREF(__pyx_tuple__585); + + /* "talib/_func.pxi":4615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__586 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__586)) __PYX_ERR(2, 4615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__586); + __Pyx_GIVEREF(__pyx_tuple__586); + + /* "talib/_func.pxi":4617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__587 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(2, 4617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__587); + __Pyx_GIVEREF(__pyx_tuple__587); + + /* "talib/_func.pxi":4623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__588 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__588)) __PYX_ERR(2, 4623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__588); + __Pyx_GIVEREF(__pyx_tuple__588); + + /* "talib/_func.pxi":4625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__589 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__589)) __PYX_ERR(2, 4625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__589); + __Pyx_GIVEREF(__pyx_tuple__589); + + /* "talib/_func.pxi":4627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__590 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__590)) __PYX_ERR(2, 4627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__590); + __Pyx_GIVEREF(__pyx_tuple__590); + + /* "talib/_func.pxi":4645 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) + */ + __pyx_tuple__591 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__591)) __PYX_ERR(2, 4645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__591); + __Pyx_GIVEREF(__pyx_tuple__591); + + /* "talib/_func.pxi":4682 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__592 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__592)) __PYX_ERR(2, 4682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__592); + __Pyx_GIVEREF(__pyx_tuple__592); + + /* "talib/_func.pxi":4684 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__593 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__593)) __PYX_ERR(2, 4684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__593); + __Pyx_GIVEREF(__pyx_tuple__593); + + /* "talib/_func.pxi":4689 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__594 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__594)) __PYX_ERR(2, 4689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__594); + __Pyx_GIVEREF(__pyx_tuple__594); + + /* "talib/_func.pxi":4691 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__595 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(2, 4691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__595); + __Pyx_GIVEREF(__pyx_tuple__595); + + /* "talib/_func.pxi":4696 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__596 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__596)) __PYX_ERR(2, 4696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__596); + __Pyx_GIVEREF(__pyx_tuple__596); + + /* "talib/_func.pxi":4698 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__597 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__597)) __PYX_ERR(2, 4698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__597); + __Pyx_GIVEREF(__pyx_tuple__597); + + /* "talib/_func.pxi":4703 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__598 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(2, 4703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__598); + __Pyx_GIVEREF(__pyx_tuple__598); + + /* "talib/_func.pxi":4705 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__599 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__599)) __PYX_ERR(2, 4705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__599); + __Pyx_GIVEREF(__pyx_tuple__599); + + /* "talib/_func.pxi":4711 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__600 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(2, 4711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__600); + __Pyx_GIVEREF(__pyx_tuple__600); + + /* "talib/_func.pxi":4713 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__601 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__601)) __PYX_ERR(2, 4713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__601); + __Pyx_GIVEREF(__pyx_tuple__601); + + /* "talib/_func.pxi":4715 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__602 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(2, 4715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__602); + __Pyx_GIVEREF(__pyx_tuple__602); + + /* "talib/_func.pxi":4733 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) + */ + __pyx_tuple__603 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__603)) __PYX_ERR(2, 4733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__603); + __Pyx_GIVEREF(__pyx_tuple__603); + + /* "talib/_func.pxi":4770 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__604 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__604)) __PYX_ERR(2, 4770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__604); + __Pyx_GIVEREF(__pyx_tuple__604); + + /* "talib/_func.pxi":4772 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__605 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__605)) __PYX_ERR(2, 4772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__605); + __Pyx_GIVEREF(__pyx_tuple__605); + + /* "talib/_func.pxi":4777 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__606 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(2, 4777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__606); + __Pyx_GIVEREF(__pyx_tuple__606); + + /* "talib/_func.pxi":4779 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__607 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__607)) __PYX_ERR(2, 4779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__607); + __Pyx_GIVEREF(__pyx_tuple__607); + + /* "talib/_func.pxi":4784 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__608 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(2, 4784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__608); + __Pyx_GIVEREF(__pyx_tuple__608); + + /* "talib/_func.pxi":4786 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__609 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__609)) __PYX_ERR(2, 4786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__609); + __Pyx_GIVEREF(__pyx_tuple__609); + + /* "talib/_func.pxi":4791 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__610 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(2, 4791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__610); + __Pyx_GIVEREF(__pyx_tuple__610); + + /* "talib/_func.pxi":4793 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__611 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__611)) __PYX_ERR(2, 4793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__611); + __Pyx_GIVEREF(__pyx_tuple__611); + + /* "talib/_func.pxi":4799 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__612 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(2, 4799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__612); + __Pyx_GIVEREF(__pyx_tuple__612); + + /* "talib/_func.pxi":4801 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__613 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__613)) __PYX_ERR(2, 4801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__613); + __Pyx_GIVEREF(__pyx_tuple__613); + + /* "talib/_func.pxi":4803 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__614 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(2, 4803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__614); + __Pyx_GIVEREF(__pyx_tuple__614); + + /* "talib/_func.pxi":4821 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) + */ + __pyx_tuple__615 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__615)) __PYX_ERR(2, 4821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__615); + __Pyx_GIVEREF(__pyx_tuple__615); + + /* "talib/_func.pxi":4860 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__616 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(2, 4860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__616); + __Pyx_GIVEREF(__pyx_tuple__616); + + /* "talib/_func.pxi":4862 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__617 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__617)) __PYX_ERR(2, 4862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__617); + __Pyx_GIVEREF(__pyx_tuple__617); + + /* "talib/_func.pxi":4867 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__618 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__618)) __PYX_ERR(2, 4867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__618); + __Pyx_GIVEREF(__pyx_tuple__618); + + /* "talib/_func.pxi":4869 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__619 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__619)) __PYX_ERR(2, 4869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__619); + __Pyx_GIVEREF(__pyx_tuple__619); + + /* "talib/_func.pxi":4874 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__620 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__620)) __PYX_ERR(2, 4874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__620); + __Pyx_GIVEREF(__pyx_tuple__620); + + /* "talib/_func.pxi":4876 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__621 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__621)) __PYX_ERR(2, 4876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__621); + __Pyx_GIVEREF(__pyx_tuple__621); + + /* "talib/_func.pxi":4881 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__622 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(2, 4881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__622); + __Pyx_GIVEREF(__pyx_tuple__622); + + /* "talib/_func.pxi":4883 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__623 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__623)) __PYX_ERR(2, 4883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__623); + __Pyx_GIVEREF(__pyx_tuple__623); + + /* "talib/_func.pxi":4889 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__624 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(2, 4889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__624); + __Pyx_GIVEREF(__pyx_tuple__624); + + /* "talib/_func.pxi":4891 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__625 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(2, 4891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__625); + __Pyx_GIVEREF(__pyx_tuple__625); + + /* "talib/_func.pxi":4893 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__626 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__626)) __PYX_ERR(2, 4893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__626); + __Pyx_GIVEREF(__pyx_tuple__626); + + /* "talib/_func.pxi":4911 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) + */ + __pyx_tuple__627 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(2, 4911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__627); + __Pyx_GIVEREF(__pyx_tuple__627); + + /* "talib/_func.pxi":4950 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__628 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__628)) __PYX_ERR(2, 4950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__628); + __Pyx_GIVEREF(__pyx_tuple__628); + + /* "talib/_func.pxi":4952 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__629 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(2, 4952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__629); + __Pyx_GIVEREF(__pyx_tuple__629); + + /* "talib/_func.pxi":4957 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__630 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(2, 4957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__630); + __Pyx_GIVEREF(__pyx_tuple__630); + + /* "talib/_func.pxi":4959 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__631 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(2, 4959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__631); + __Pyx_GIVEREF(__pyx_tuple__631); + + /* "talib/_func.pxi":4964 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__632 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(2, 4964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__632); + __Pyx_GIVEREF(__pyx_tuple__632); + + /* "talib/_func.pxi":4966 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__633 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(2, 4966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__633); + __Pyx_GIVEREF(__pyx_tuple__633); + + /* "talib/_func.pxi":4971 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__634 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(2, 4971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__634); + __Pyx_GIVEREF(__pyx_tuple__634); + + /* "talib/_func.pxi":4973 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__635 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(2, 4973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__635); + __Pyx_GIVEREF(__pyx_tuple__635); + + /* "talib/_func.pxi":4979 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__636 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(2, 4979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__636); + __Pyx_GIVEREF(__pyx_tuple__636); + + /* "talib/_func.pxi":4981 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__637 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(2, 4981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__637); + __Pyx_GIVEREF(__pyx_tuple__637); + + /* "talib/_func.pxi":4983 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__638 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(2, 4983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__638); + __Pyx_GIVEREF(__pyx_tuple__638); + + /* "talib/_func.pxi":5001 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) + */ + __pyx_tuple__639 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(2, 5001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__639); + __Pyx_GIVEREF(__pyx_tuple__639); + + /* "talib/_func.pxi":5040 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__640 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__640)) __PYX_ERR(2, 5040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__640); + __Pyx_GIVEREF(__pyx_tuple__640); + + /* "talib/_func.pxi":5042 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__641 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(2, 5042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__641); + __Pyx_GIVEREF(__pyx_tuple__641); + + /* "talib/_func.pxi":5047 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__642 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(2, 5047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__642); + __Pyx_GIVEREF(__pyx_tuple__642); + + /* "talib/_func.pxi":5049 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__643 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__643)) __PYX_ERR(2, 5049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__643); + __Pyx_GIVEREF(__pyx_tuple__643); + + /* "talib/_func.pxi":5054 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__644 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(2, 5054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__644); + __Pyx_GIVEREF(__pyx_tuple__644); + + /* "talib/_func.pxi":5056 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__645 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__645)) __PYX_ERR(2, 5056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__645); + __Pyx_GIVEREF(__pyx_tuple__645); + + /* "talib/_func.pxi":5061 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__646 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__646)) __PYX_ERR(2, 5061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__646); + __Pyx_GIVEREF(__pyx_tuple__646); + + /* "talib/_func.pxi":5063 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__647 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(2, 5063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__647); + __Pyx_GIVEREF(__pyx_tuple__647); + + /* "talib/_func.pxi":5069 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__648 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__648)) __PYX_ERR(2, 5069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__648); + __Pyx_GIVEREF(__pyx_tuple__648); + + /* "talib/_func.pxi":5071 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__649 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(2, 5071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__649); + __Pyx_GIVEREF(__pyx_tuple__649); + + /* "talib/_func.pxi":5073 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__650 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__650)) __PYX_ERR(2, 5073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__650); + __Pyx_GIVEREF(__pyx_tuple__650); + + /* "talib/_func.pxi":5091 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) + */ + __pyx_tuple__651 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(2, 5091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__651); + __Pyx_GIVEREF(__pyx_tuple__651); + + /* "talib/_func.pxi":5128 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__652 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__652)) __PYX_ERR(2, 5128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__652); + __Pyx_GIVEREF(__pyx_tuple__652); + + /* "talib/_func.pxi":5130 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__653 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(2, 5130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__653); + __Pyx_GIVEREF(__pyx_tuple__653); + + /* "talib/_func.pxi":5135 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__654 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__654)) __PYX_ERR(2, 5135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__654); + __Pyx_GIVEREF(__pyx_tuple__654); + + /* "talib/_func.pxi":5137 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__655 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(2, 5137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__655); + __Pyx_GIVEREF(__pyx_tuple__655); + + /* "talib/_func.pxi":5142 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__656 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__656)) __PYX_ERR(2, 5142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__656); + __Pyx_GIVEREF(__pyx_tuple__656); + + /* "talib/_func.pxi":5144 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__657 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(2, 5144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__657); + __Pyx_GIVEREF(__pyx_tuple__657); + + /* "talib/_func.pxi":5149 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__658 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__658)) __PYX_ERR(2, 5149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__658); + __Pyx_GIVEREF(__pyx_tuple__658); + + /* "talib/_func.pxi":5151 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__659 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(2, 5151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__659); + __Pyx_GIVEREF(__pyx_tuple__659); + + /* "talib/_func.pxi":5157 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__660 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__660)) __PYX_ERR(2, 5157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__660); + __Pyx_GIVEREF(__pyx_tuple__660); + + /* "talib/_func.pxi":5159 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__661 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(2, 5159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__661); + __Pyx_GIVEREF(__pyx_tuple__661); + + /* "talib/_func.pxi":5161 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__662 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__662)) __PYX_ERR(2, 5161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__662); + __Pyx_GIVEREF(__pyx_tuple__662); + + /* "talib/_func.pxi":5179 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) + */ + __pyx_tuple__663 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(2, 5179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__663); + __Pyx_GIVEREF(__pyx_tuple__663); + + /* "talib/_func.pxi":5216 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__664 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__664)) __PYX_ERR(2, 5216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__664); + __Pyx_GIVEREF(__pyx_tuple__664); + + /* "talib/_func.pxi":5218 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__665 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(2, 5218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__665); + __Pyx_GIVEREF(__pyx_tuple__665); + + /* "talib/_func.pxi":5223 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__666 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__666)) __PYX_ERR(2, 5223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__666); + __Pyx_GIVEREF(__pyx_tuple__666); + + /* "talib/_func.pxi":5225 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__667 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(2, 5225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__667); + __Pyx_GIVEREF(__pyx_tuple__667); + + /* "talib/_func.pxi":5230 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__668 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__668)) __PYX_ERR(2, 5230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__668); + __Pyx_GIVEREF(__pyx_tuple__668); + + /* "talib/_func.pxi":5232 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__669 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(2, 5232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__669); + __Pyx_GIVEREF(__pyx_tuple__669); + + /* "talib/_func.pxi":5237 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__670 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__670)) __PYX_ERR(2, 5237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__670); + __Pyx_GIVEREF(__pyx_tuple__670); + + /* "talib/_func.pxi":5239 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__671 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(2, 5239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__671); + __Pyx_GIVEREF(__pyx_tuple__671); + + /* "talib/_func.pxi":5245 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__672 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__672)) __PYX_ERR(2, 5245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__672); + __Pyx_GIVEREF(__pyx_tuple__672); + + /* "talib/_func.pxi":5247 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__673 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(2, 5247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__673); + __Pyx_GIVEREF(__pyx_tuple__673); + + /* "talib/_func.pxi":5249 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__674 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__674)) __PYX_ERR(2, 5249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__674); + __Pyx_GIVEREF(__pyx_tuple__674); + + /* "talib/_func.pxi":5267 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) + */ + __pyx_tuple__675 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(2, 5267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__675); + __Pyx_GIVEREF(__pyx_tuple__675); + + /* "talib/_func.pxi":5304 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__676 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__676)) __PYX_ERR(2, 5304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__676); + __Pyx_GIVEREF(__pyx_tuple__676); + + /* "talib/_func.pxi":5306 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__677 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(2, 5306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__677); + __Pyx_GIVEREF(__pyx_tuple__677); + + /* "talib/_func.pxi":5311 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__678 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__678)) __PYX_ERR(2, 5311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__678); + __Pyx_GIVEREF(__pyx_tuple__678); + + /* "talib/_func.pxi":5313 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__679 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__679)) __PYX_ERR(2, 5313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__679); + __Pyx_GIVEREF(__pyx_tuple__679); + + /* "talib/_func.pxi":5318 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__680 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__680)) __PYX_ERR(2, 5318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__680); + __Pyx_GIVEREF(__pyx_tuple__680); + + /* "talib/_func.pxi":5320 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__681 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__681)) __PYX_ERR(2, 5320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__681); + __Pyx_GIVEREF(__pyx_tuple__681); + + /* "talib/_func.pxi":5325 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__682 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__682)) __PYX_ERR(2, 5325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__682); + __Pyx_GIVEREF(__pyx_tuple__682); + + /* "talib/_func.pxi":5327 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__683 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__683)) __PYX_ERR(2, 5327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__683); + __Pyx_GIVEREF(__pyx_tuple__683); + + /* "talib/_func.pxi":5333 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__684 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__684)) __PYX_ERR(2, 5333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__684); + __Pyx_GIVEREF(__pyx_tuple__684); + + /* "talib/_func.pxi":5335 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__685 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__685)) __PYX_ERR(2, 5335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__685); + __Pyx_GIVEREF(__pyx_tuple__685); + + /* "talib/_func.pxi":5337 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__686 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(2, 5337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__686); + __Pyx_GIVEREF(__pyx_tuple__686); + + /* "talib/_func.pxi":5355 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) + */ + __pyx_tuple__687 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__687)) __PYX_ERR(2, 5355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__687); + __Pyx_GIVEREF(__pyx_tuple__687); + + /* "talib/_func.pxi":5392 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__688 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__688)) __PYX_ERR(2, 5392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__688); + __Pyx_GIVEREF(__pyx_tuple__688); + + /* "talib/_func.pxi":5394 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__689 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__689)) __PYX_ERR(2, 5394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__689); + __Pyx_GIVEREF(__pyx_tuple__689); + + /* "talib/_func.pxi":5399 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__690 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__690)) __PYX_ERR(2, 5399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__690); + __Pyx_GIVEREF(__pyx_tuple__690); + + /* "talib/_func.pxi":5401 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__691 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__691)) __PYX_ERR(2, 5401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__691); + __Pyx_GIVEREF(__pyx_tuple__691); + + /* "talib/_func.pxi":5406 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__692 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__692)) __PYX_ERR(2, 5406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__692); + __Pyx_GIVEREF(__pyx_tuple__692); + + /* "talib/_func.pxi":5408 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__693 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__693)) __PYX_ERR(2, 5408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__693); + __Pyx_GIVEREF(__pyx_tuple__693); + + /* "talib/_func.pxi":5413 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__694 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__694)) __PYX_ERR(2, 5413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__694); + __Pyx_GIVEREF(__pyx_tuple__694); + + /* "talib/_func.pxi":5415 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__695 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__695)) __PYX_ERR(2, 5415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__695); + __Pyx_GIVEREF(__pyx_tuple__695); + + /* "talib/_func.pxi":5421 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__696 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__696)) __PYX_ERR(2, 5421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__696); + __Pyx_GIVEREF(__pyx_tuple__696); + + /* "talib/_func.pxi":5423 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__697 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__697)) __PYX_ERR(2, 5423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__697); + __Pyx_GIVEREF(__pyx_tuple__697); + + /* "talib/_func.pxi":5425 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__698 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__698)) __PYX_ERR(2, 5425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__698); + __Pyx_GIVEREF(__pyx_tuple__698); + + /* "talib/_func.pxi":5443 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) + */ + __pyx_tuple__699 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__699)) __PYX_ERR(2, 5443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__699); + __Pyx_GIVEREF(__pyx_tuple__699); + + /* "talib/_func.pxi":5480 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__700 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__700)) __PYX_ERR(2, 5480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__700); + __Pyx_GIVEREF(__pyx_tuple__700); + + /* "talib/_func.pxi":5482 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__701 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__701)) __PYX_ERR(2, 5482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__701); + __Pyx_GIVEREF(__pyx_tuple__701); + + /* "talib/_func.pxi":5487 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__702 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__702)) __PYX_ERR(2, 5487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__702); + __Pyx_GIVEREF(__pyx_tuple__702); + + /* "talib/_func.pxi":5489 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__703 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__703)) __PYX_ERR(2, 5489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__703); + __Pyx_GIVEREF(__pyx_tuple__703); + + /* "talib/_func.pxi":5494 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__704 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__704)) __PYX_ERR(2, 5494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__704); + __Pyx_GIVEREF(__pyx_tuple__704); + + /* "talib/_func.pxi":5496 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__705 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__705)) __PYX_ERR(2, 5496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__705); + __Pyx_GIVEREF(__pyx_tuple__705); + + /* "talib/_func.pxi":5501 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__706 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__706)) __PYX_ERR(2, 5501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__706); + __Pyx_GIVEREF(__pyx_tuple__706); + + /* "talib/_func.pxi":5503 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__707 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__707)) __PYX_ERR(2, 5503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__707); + __Pyx_GIVEREF(__pyx_tuple__707); + + /* "talib/_func.pxi":5509 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__708 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__708)) __PYX_ERR(2, 5509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__708); + __Pyx_GIVEREF(__pyx_tuple__708); + + /* "talib/_func.pxi":5511 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__709 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__709)) __PYX_ERR(2, 5511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__709); + __Pyx_GIVEREF(__pyx_tuple__709); + + /* "talib/_func.pxi":5513 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__710 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__710)) __PYX_ERR(2, 5513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__710); + __Pyx_GIVEREF(__pyx_tuple__710); + + /* "talib/_func.pxi":5531 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) + */ + __pyx_tuple__711 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__711)) __PYX_ERR(2, 5531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__711); + __Pyx_GIVEREF(__pyx_tuple__711); + + /* "talib/_func.pxi":5568 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__712 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__712)) __PYX_ERR(2, 5568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__712); + __Pyx_GIVEREF(__pyx_tuple__712); + + /* "talib/_func.pxi":5570 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__713 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__713)) __PYX_ERR(2, 5570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__713); + __Pyx_GIVEREF(__pyx_tuple__713); + + /* "talib/_func.pxi":5575 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__714 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__714)) __PYX_ERR(2, 5575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__714); + __Pyx_GIVEREF(__pyx_tuple__714); + + /* "talib/_func.pxi":5577 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__715 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__715)) __PYX_ERR(2, 5577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__715); + __Pyx_GIVEREF(__pyx_tuple__715); + + /* "talib/_func.pxi":5582 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__716)) __PYX_ERR(2, 5582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__716); + __Pyx_GIVEREF(__pyx_tuple__716); + + /* "talib/_func.pxi":5584 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__717)) __PYX_ERR(2, 5584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__717); + __Pyx_GIVEREF(__pyx_tuple__717); + + /* "talib/_func.pxi":5589 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__718)) __PYX_ERR(2, 5589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__718); + __Pyx_GIVEREF(__pyx_tuple__718); + + /* "talib/_func.pxi":5591 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__719)) __PYX_ERR(2, 5591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__719); + __Pyx_GIVEREF(__pyx_tuple__719); + + /* "talib/_func.pxi":5597 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__720)) __PYX_ERR(2, 5597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__720); + __Pyx_GIVEREF(__pyx_tuple__720); + + /* "talib/_func.pxi":5599 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__721 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__721)) __PYX_ERR(2, 5599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__721); + __Pyx_GIVEREF(__pyx_tuple__721); + + /* "talib/_func.pxi":5601 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__722 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__722)) __PYX_ERR(2, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__722); + __Pyx_GIVEREF(__pyx_tuple__722); + + /* "talib/_func.pxi":5619 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) + */ + __pyx_tuple__723 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__723)) __PYX_ERR(2, 5619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__723); + __Pyx_GIVEREF(__pyx_tuple__723); + + /* "talib/_func.pxi":5656 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__724 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__724)) __PYX_ERR(2, 5656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__724); + __Pyx_GIVEREF(__pyx_tuple__724); + + /* "talib/_func.pxi":5658 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__725 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__725)) __PYX_ERR(2, 5658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__725); + __Pyx_GIVEREF(__pyx_tuple__725); + + /* "talib/_func.pxi":5663 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__726 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__726)) __PYX_ERR(2, 5663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__726); + __Pyx_GIVEREF(__pyx_tuple__726); + + /* "talib/_func.pxi":5665 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__727 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__727)) __PYX_ERR(2, 5665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__727); + __Pyx_GIVEREF(__pyx_tuple__727); + + /* "talib/_func.pxi":5670 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__728 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__728)) __PYX_ERR(2, 5670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__728); + __Pyx_GIVEREF(__pyx_tuple__728); + + /* "talib/_func.pxi":5672 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__729 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__729)) __PYX_ERR(2, 5672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__729); + __Pyx_GIVEREF(__pyx_tuple__729); + + /* "talib/_func.pxi":5677 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__730 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__730)) __PYX_ERR(2, 5677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__730); + __Pyx_GIVEREF(__pyx_tuple__730); + + /* "talib/_func.pxi":5679 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__731 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__731)) __PYX_ERR(2, 5679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__731); + __Pyx_GIVEREF(__pyx_tuple__731); + + /* "talib/_func.pxi":5685 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__732 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__732)) __PYX_ERR(2, 5685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__732); + __Pyx_GIVEREF(__pyx_tuple__732); + + /* "talib/_func.pxi":5687 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__733 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__733)) __PYX_ERR(2, 5687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__733); + __Pyx_GIVEREF(__pyx_tuple__733); + + /* "talib/_func.pxi":5689 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__734 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__734)) __PYX_ERR(2, 5689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__734); + __Pyx_GIVEREF(__pyx_tuple__734); + + /* "talib/_func.pxi":5707 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) + */ + __pyx_tuple__735 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__735)) __PYX_ERR(2, 5707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__735); + __Pyx_GIVEREF(__pyx_tuple__735); + + /* "talib/_func.pxi":5744 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__736 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__736)) __PYX_ERR(2, 5744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__736); + __Pyx_GIVEREF(__pyx_tuple__736); + + /* "talib/_func.pxi":5746 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__737 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__737)) __PYX_ERR(2, 5746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__737); + __Pyx_GIVEREF(__pyx_tuple__737); + + /* "talib/_func.pxi":5751 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__738 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__738)) __PYX_ERR(2, 5751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__738); + __Pyx_GIVEREF(__pyx_tuple__738); + + /* "talib/_func.pxi":5753 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__739 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__739)) __PYX_ERR(2, 5753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__739); + __Pyx_GIVEREF(__pyx_tuple__739); + + /* "talib/_func.pxi":5758 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__740 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__740)) __PYX_ERR(2, 5758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__740); + __Pyx_GIVEREF(__pyx_tuple__740); + + /* "talib/_func.pxi":5760 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__741 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__741)) __PYX_ERR(2, 5760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__741); + __Pyx_GIVEREF(__pyx_tuple__741); + + /* "talib/_func.pxi":5765 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__742 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__742)) __PYX_ERR(2, 5765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__742); + __Pyx_GIVEREF(__pyx_tuple__742); + + /* "talib/_func.pxi":5767 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__743 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__743)) __PYX_ERR(2, 5767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__743); + __Pyx_GIVEREF(__pyx_tuple__743); + + /* "talib/_func.pxi":5773 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__744 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__744)) __PYX_ERR(2, 5773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__744); + __Pyx_GIVEREF(__pyx_tuple__744); + + /* "talib/_func.pxi":5775 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__745 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__745)) __PYX_ERR(2, 5775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__745); + __Pyx_GIVEREF(__pyx_tuple__745); + + /* "talib/_func.pxi":5777 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__746 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__746)) __PYX_ERR(2, 5777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__746); + __Pyx_GIVEREF(__pyx_tuple__746); + + /* "talib/_func.pxi":5795 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) + */ + __pyx_tuple__747 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__747)) __PYX_ERR(2, 5795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__747); + __Pyx_GIVEREF(__pyx_tuple__747); + + /* "talib/_func.pxi":5832 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__748 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__748)) __PYX_ERR(2, 5832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__748); + __Pyx_GIVEREF(__pyx_tuple__748); + + /* "talib/_func.pxi":5834 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__749 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__749)) __PYX_ERR(2, 5834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__749); + __Pyx_GIVEREF(__pyx_tuple__749); + + /* "talib/_func.pxi":5839 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__750 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__750)) __PYX_ERR(2, 5839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__750); + __Pyx_GIVEREF(__pyx_tuple__750); + + /* "talib/_func.pxi":5841 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__751 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__751)) __PYX_ERR(2, 5841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__751); + __Pyx_GIVEREF(__pyx_tuple__751); + + /* "talib/_func.pxi":5846 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__752 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__752)) __PYX_ERR(2, 5846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__752); + __Pyx_GIVEREF(__pyx_tuple__752); + + /* "talib/_func.pxi":5848 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__753 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__753)) __PYX_ERR(2, 5848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__753); + __Pyx_GIVEREF(__pyx_tuple__753); + + /* "talib/_func.pxi":5853 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__754 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__754)) __PYX_ERR(2, 5853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__754); + __Pyx_GIVEREF(__pyx_tuple__754); + + /* "talib/_func.pxi":5855 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__755 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__755)) __PYX_ERR(2, 5855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__755); + __Pyx_GIVEREF(__pyx_tuple__755); + + /* "talib/_func.pxi":5861 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__756 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__756)) __PYX_ERR(2, 5861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__756); + __Pyx_GIVEREF(__pyx_tuple__756); + + /* "talib/_func.pxi":5863 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__757 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__757)) __PYX_ERR(2, 5863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__757); + __Pyx_GIVEREF(__pyx_tuple__757); + + /* "talib/_func.pxi":5865 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__758 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__758)) __PYX_ERR(2, 5865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__758); + __Pyx_GIVEREF(__pyx_tuple__758); + + /* "talib/_func.pxi":5883 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) + */ + __pyx_tuple__759 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__759)) __PYX_ERR(2, 5883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__759); + __Pyx_GIVEREF(__pyx_tuple__759); + + /* "talib/_func.pxi":5920 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__760 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__760)) __PYX_ERR(2, 5920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__760); + __Pyx_GIVEREF(__pyx_tuple__760); + + /* "talib/_func.pxi":5922 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__761 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__761)) __PYX_ERR(2, 5922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__761); + __Pyx_GIVEREF(__pyx_tuple__761); + + /* "talib/_func.pxi":5927 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__762 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__762)) __PYX_ERR(2, 5927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__762); + __Pyx_GIVEREF(__pyx_tuple__762); + + /* "talib/_func.pxi":5929 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__763 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__763)) __PYX_ERR(2, 5929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__763); + __Pyx_GIVEREF(__pyx_tuple__763); + + /* "talib/_func.pxi":5934 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__764 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__764)) __PYX_ERR(2, 5934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__764); + __Pyx_GIVEREF(__pyx_tuple__764); + + /* "talib/_func.pxi":5936 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__765 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__765)) __PYX_ERR(2, 5936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__765); + __Pyx_GIVEREF(__pyx_tuple__765); + + /* "talib/_func.pxi":5941 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__766 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__766)) __PYX_ERR(2, 5941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__766); + __Pyx_GIVEREF(__pyx_tuple__766); + + /* "talib/_func.pxi":5943 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__767 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__767)) __PYX_ERR(2, 5943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__767); + __Pyx_GIVEREF(__pyx_tuple__767); + + /* "talib/_func.pxi":5949 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__768 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__768)) __PYX_ERR(2, 5949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__768); + __Pyx_GIVEREF(__pyx_tuple__768); + + /* "talib/_func.pxi":5951 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__769 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__769)) __PYX_ERR(2, 5951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__769); + __Pyx_GIVEREF(__pyx_tuple__769); + + /* "talib/_func.pxi":5953 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__770 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__770)) __PYX_ERR(2, 5953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__770); + __Pyx_GIVEREF(__pyx_tuple__770); + + /* "talib/_func.pxi":5971 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) + */ + __pyx_tuple__771 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__771)) __PYX_ERR(2, 5971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__771); + __Pyx_GIVEREF(__pyx_tuple__771); + + /* "talib/_func.pxi":6008 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__772 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__772)) __PYX_ERR(2, 6008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__772); + __Pyx_GIVEREF(__pyx_tuple__772); + + /* "talib/_func.pxi":6010 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__773 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__773)) __PYX_ERR(2, 6010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__773); + __Pyx_GIVEREF(__pyx_tuple__773); + + /* "talib/_func.pxi":6015 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__774 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__774)) __PYX_ERR(2, 6015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__774); + __Pyx_GIVEREF(__pyx_tuple__774); + + /* "talib/_func.pxi":6017 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__775 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__775)) __PYX_ERR(2, 6017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__775); + __Pyx_GIVEREF(__pyx_tuple__775); + + /* "talib/_func.pxi":6022 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__776 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__776)) __PYX_ERR(2, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__776); + __Pyx_GIVEREF(__pyx_tuple__776); + + /* "talib/_func.pxi":6024 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__777 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__777)) __PYX_ERR(2, 6024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__777); + __Pyx_GIVEREF(__pyx_tuple__777); + + /* "talib/_func.pxi":6029 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__778 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__778)) __PYX_ERR(2, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__778); + __Pyx_GIVEREF(__pyx_tuple__778); + + /* "talib/_func.pxi":6031 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__779 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__779)) __PYX_ERR(2, 6031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__779); + __Pyx_GIVEREF(__pyx_tuple__779); + + /* "talib/_func.pxi":6037 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__780 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__780)) __PYX_ERR(2, 6037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__780); + __Pyx_GIVEREF(__pyx_tuple__780); + + /* "talib/_func.pxi":6039 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__781 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__781)) __PYX_ERR(2, 6039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__781); + __Pyx_GIVEREF(__pyx_tuple__781); + + /* "talib/_func.pxi":6041 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__782 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__782)) __PYX_ERR(2, 6041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__782); + __Pyx_GIVEREF(__pyx_tuple__782); + + /* "talib/_func.pxi":6059 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) + */ + __pyx_tuple__783 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__783)) __PYX_ERR(2, 6059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__783); + __Pyx_GIVEREF(__pyx_tuple__783); + + /* "talib/_func.pxi":6096 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__784 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__784)) __PYX_ERR(2, 6096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__784); + __Pyx_GIVEREF(__pyx_tuple__784); + + /* "talib/_func.pxi":6098 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__785 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__785)) __PYX_ERR(2, 6098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__785); + __Pyx_GIVEREF(__pyx_tuple__785); + + /* "talib/_func.pxi":6103 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__786 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__786)) __PYX_ERR(2, 6103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__786); + __Pyx_GIVEREF(__pyx_tuple__786); + + /* "talib/_func.pxi":6105 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__787 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__787)) __PYX_ERR(2, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__787); + __Pyx_GIVEREF(__pyx_tuple__787); + + /* "talib/_func.pxi":6110 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__788 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__788)) __PYX_ERR(2, 6110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__788); + __Pyx_GIVEREF(__pyx_tuple__788); + + /* "talib/_func.pxi":6112 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__789 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__789)) __PYX_ERR(2, 6112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__789); + __Pyx_GIVEREF(__pyx_tuple__789); + + /* "talib/_func.pxi":6117 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__790 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__790)) __PYX_ERR(2, 6117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__790); + __Pyx_GIVEREF(__pyx_tuple__790); + + /* "talib/_func.pxi":6119 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__791 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__791)) __PYX_ERR(2, 6119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__791); + __Pyx_GIVEREF(__pyx_tuple__791); + + /* "talib/_func.pxi":6125 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__792 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__792)) __PYX_ERR(2, 6125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__792); + __Pyx_GIVEREF(__pyx_tuple__792); + + /* "talib/_func.pxi":6127 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__793 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__793)) __PYX_ERR(2, 6127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__793); + __Pyx_GIVEREF(__pyx_tuple__793); + + /* "talib/_func.pxi":6129 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__794 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__794)) __PYX_ERR(2, 6129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__794); + __Pyx_GIVEREF(__pyx_tuple__794); + + /* "talib/_func.pxi":6147 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) + */ + __pyx_tuple__795 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__795)) __PYX_ERR(2, 6147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__795); + __Pyx_GIVEREF(__pyx_tuple__795); + + /* "talib/_func.pxi":6184 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__796 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__796)) __PYX_ERR(2, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__796); + __Pyx_GIVEREF(__pyx_tuple__796); + + /* "talib/_func.pxi":6186 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__797 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__797)) __PYX_ERR(2, 6186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__797); + __Pyx_GIVEREF(__pyx_tuple__797); + + /* "talib/_func.pxi":6191 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__798 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__798)) __PYX_ERR(2, 6191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__798); + __Pyx_GIVEREF(__pyx_tuple__798); + + /* "talib/_func.pxi":6193 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__799 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__799)) __PYX_ERR(2, 6193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__799); + __Pyx_GIVEREF(__pyx_tuple__799); + + /* "talib/_func.pxi":6198 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__800 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__800)) __PYX_ERR(2, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__800); + __Pyx_GIVEREF(__pyx_tuple__800); + + /* "talib/_func.pxi":6200 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__801 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__801)) __PYX_ERR(2, 6200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__801); + __Pyx_GIVEREF(__pyx_tuple__801); + + /* "talib/_func.pxi":6205 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__802 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__802)) __PYX_ERR(2, 6205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__802); + __Pyx_GIVEREF(__pyx_tuple__802); + + /* "talib/_func.pxi":6207 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__803 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__803)) __PYX_ERR(2, 6207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__803); + __Pyx_GIVEREF(__pyx_tuple__803); + + /* "talib/_func.pxi":6213 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__804 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__804)) __PYX_ERR(2, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__804); + __Pyx_GIVEREF(__pyx_tuple__804); + + /* "talib/_func.pxi":6215 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__805 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__805)) __PYX_ERR(2, 6215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__805); + __Pyx_GIVEREF(__pyx_tuple__805); + + /* "talib/_func.pxi":6217 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__806 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__806)) __PYX_ERR(2, 6217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__806); + __Pyx_GIVEREF(__pyx_tuple__806); + + /* "talib/_func.pxi":6235 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) + */ + __pyx_tuple__807 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__807)) __PYX_ERR(2, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__807); + __Pyx_GIVEREF(__pyx_tuple__807); + + /* "talib/_func.pxi":6272 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__808 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__808)) __PYX_ERR(2, 6272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__808); + __Pyx_GIVEREF(__pyx_tuple__808); + + /* "talib/_func.pxi":6274 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__809 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__809)) __PYX_ERR(2, 6274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__809); + __Pyx_GIVEREF(__pyx_tuple__809); + + /* "talib/_func.pxi":6279 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__810 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__810)) __PYX_ERR(2, 6279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__810); + __Pyx_GIVEREF(__pyx_tuple__810); + + /* "talib/_func.pxi":6281 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__811 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__811)) __PYX_ERR(2, 6281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__811); + __Pyx_GIVEREF(__pyx_tuple__811); + + /* "talib/_func.pxi":6286 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__812 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__812)) __PYX_ERR(2, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__812); + __Pyx_GIVEREF(__pyx_tuple__812); + + /* "talib/_func.pxi":6288 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__813 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__813)) __PYX_ERR(2, 6288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__813); + __Pyx_GIVEREF(__pyx_tuple__813); + + /* "talib/_func.pxi":6293 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__814 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__814)) __PYX_ERR(2, 6293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__814); + __Pyx_GIVEREF(__pyx_tuple__814); + + /* "talib/_func.pxi":6295 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__815 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__815)) __PYX_ERR(2, 6295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__815); + __Pyx_GIVEREF(__pyx_tuple__815); + + /* "talib/_func.pxi":6301 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__816 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__816)) __PYX_ERR(2, 6301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__816); + __Pyx_GIVEREF(__pyx_tuple__816); + + /* "talib/_func.pxi":6303 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__817 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__817)) __PYX_ERR(2, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__817); + __Pyx_GIVEREF(__pyx_tuple__817); + + /* "talib/_func.pxi":6305 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__818 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__818)) __PYX_ERR(2, 6305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__818); + __Pyx_GIVEREF(__pyx_tuple__818); + + /* "talib/_func.pxi":6323 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) + */ + __pyx_tuple__819 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__819)) __PYX_ERR(2, 6323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__819); + __Pyx_GIVEREF(__pyx_tuple__819); + + /* "talib/_func.pxi":6360 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__820 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__820)) __PYX_ERR(2, 6360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__820); + __Pyx_GIVEREF(__pyx_tuple__820); + + /* "talib/_func.pxi":6362 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__821 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__821)) __PYX_ERR(2, 6362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__821); + __Pyx_GIVEREF(__pyx_tuple__821); + + /* "talib/_func.pxi":6367 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__822 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__822)) __PYX_ERR(2, 6367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__822); + __Pyx_GIVEREF(__pyx_tuple__822); + + /* "talib/_func.pxi":6369 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__823 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__823)) __PYX_ERR(2, 6369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__823); + __Pyx_GIVEREF(__pyx_tuple__823); + + /* "talib/_func.pxi":6374 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__824 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__824)) __PYX_ERR(2, 6374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__824); + __Pyx_GIVEREF(__pyx_tuple__824); + + /* "talib/_func.pxi":6376 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__825 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__825)) __PYX_ERR(2, 6376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__825); + __Pyx_GIVEREF(__pyx_tuple__825); + + /* "talib/_func.pxi":6381 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__826 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__826)) __PYX_ERR(2, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__826); + __Pyx_GIVEREF(__pyx_tuple__826); + + /* "talib/_func.pxi":6383 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__827 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__827)) __PYX_ERR(2, 6383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__827); + __Pyx_GIVEREF(__pyx_tuple__827); + + /* "talib/_func.pxi":6389 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__828 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__828)) __PYX_ERR(2, 6389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__828); + __Pyx_GIVEREF(__pyx_tuple__828); + + /* "talib/_func.pxi":6391 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__829 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__829)) __PYX_ERR(2, 6391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__829); + __Pyx_GIVEREF(__pyx_tuple__829); + + /* "talib/_func.pxi":6393 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__830 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__830)) __PYX_ERR(2, 6393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__830); + __Pyx_GIVEREF(__pyx_tuple__830); + + /* "talib/_func.pxi":6411 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) + */ + __pyx_tuple__831 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__831)) __PYX_ERR(2, 6411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__831); + __Pyx_GIVEREF(__pyx_tuple__831); + + /* "talib/_func.pxi":6448 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__832 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__832)) __PYX_ERR(2, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__832); + __Pyx_GIVEREF(__pyx_tuple__832); + + /* "talib/_func.pxi":6450 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__833 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__833)) __PYX_ERR(2, 6450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__833); + __Pyx_GIVEREF(__pyx_tuple__833); + + /* "talib/_func.pxi":6455 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__834 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__834)) __PYX_ERR(2, 6455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__834); + __Pyx_GIVEREF(__pyx_tuple__834); + + /* "talib/_func.pxi":6457 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__835 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__835)) __PYX_ERR(2, 6457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__835); + __Pyx_GIVEREF(__pyx_tuple__835); + + /* "talib/_func.pxi":6462 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__836 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__836)) __PYX_ERR(2, 6462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__836); + __Pyx_GIVEREF(__pyx_tuple__836); + + /* "talib/_func.pxi":6464 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__837 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__837)) __PYX_ERR(2, 6464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__837); + __Pyx_GIVEREF(__pyx_tuple__837); + + /* "talib/_func.pxi":6469 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__838 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__838)) __PYX_ERR(2, 6469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__838); + __Pyx_GIVEREF(__pyx_tuple__838); + + /* "talib/_func.pxi":6471 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__839 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__839)) __PYX_ERR(2, 6471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__839); + __Pyx_GIVEREF(__pyx_tuple__839); + + /* "talib/_func.pxi":6477 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__840 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__840)) __PYX_ERR(2, 6477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__840); + __Pyx_GIVEREF(__pyx_tuple__840); + + /* "talib/_func.pxi":6479 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__841 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__841)) __PYX_ERR(2, 6479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__841); + __Pyx_GIVEREF(__pyx_tuple__841); + + /* "talib/_func.pxi":6481 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__842 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__842)) __PYX_ERR(2, 6481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__842); + __Pyx_GIVEREF(__pyx_tuple__842); + + /* "talib/_func.pxi":6499 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) + */ + __pyx_tuple__843 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__843)) __PYX_ERR(2, 6499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__843); + __Pyx_GIVEREF(__pyx_tuple__843); + + /* "talib/_func.pxi":6536 + * int* outinteger_data + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__844 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__844)) __PYX_ERR(2, 6536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__844); + __Pyx_GIVEREF(__pyx_tuple__844); + + /* "talib/_func.pxi":6538 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__845 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__845)) __PYX_ERR(2, 6538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__845); + __Pyx_GIVEREF(__pyx_tuple__845); + + /* "talib/_func.pxi":6543 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__846 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__846)) __PYX_ERR(2, 6543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__846); + __Pyx_GIVEREF(__pyx_tuple__846); + + /* "talib/_func.pxi":6545 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__847 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__847)) __PYX_ERR(2, 6545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__847); + __Pyx_GIVEREF(__pyx_tuple__847); + + /* "talib/_func.pxi":6550 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__848 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__848)) __PYX_ERR(2, 6550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__848); + __Pyx_GIVEREF(__pyx_tuple__848); + + /* "talib/_func.pxi":6552 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__849 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__849)) __PYX_ERR(2, 6552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__849); + __Pyx_GIVEREF(__pyx_tuple__849); + + /* "talib/_func.pxi":6557 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__850 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__850)) __PYX_ERR(2, 6557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__850); + __Pyx_GIVEREF(__pyx_tuple__850); + + /* "talib/_func.pxi":6559 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__851 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__851)) __PYX_ERR(2, 6559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__851); + __Pyx_GIVEREF(__pyx_tuple__851); + + /* "talib/_func.pxi":6565 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__852 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__852)) __PYX_ERR(2, 6565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__852); + __Pyx_GIVEREF(__pyx_tuple__852); + + /* "talib/_func.pxi":6567 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__853 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__853)) __PYX_ERR(2, 6567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__853); + __Pyx_GIVEREF(__pyx_tuple__853); + + /* "talib/_func.pxi":6569 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__854 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__854)) __PYX_ERR(2, 6569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__854); + __Pyx_GIVEREF(__pyx_tuple__854); + + /* "talib/_func.pxi":6587 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) + */ + __pyx_tuple__855 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__855)) __PYX_ERR(2, 6587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__855); + __Pyx_GIVEREF(__pyx_tuple__855); + + /* "talib/_func.pxi":6621 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__856 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__856)) __PYX_ERR(2, 6621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__856); + __Pyx_GIVEREF(__pyx_tuple__856); + + /* "talib/_func.pxi":6623 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__857 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__857)) __PYX_ERR(2, 6623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__857); + __Pyx_GIVEREF(__pyx_tuple__857); + + /* "talib/_func.pxi":6636 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CEIL_Lookback( ) + */ + __pyx_tuple__858 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__858)) __PYX_ERR(2, 6636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__858); + __Pyx_GIVEREF(__pyx_tuple__858); + + /* "talib/_func.pxi":6672 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__859 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__859)) __PYX_ERR(2, 6672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__859); + __Pyx_GIVEREF(__pyx_tuple__859); + + /* "talib/_func.pxi":6674 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__860 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__860)) __PYX_ERR(2, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__860); + __Pyx_GIVEREF(__pyx_tuple__860); + + /* "talib/_func.pxi":6687 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) + */ + __pyx_tuple__861 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__861)) __PYX_ERR(2, 6687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__861); + __Pyx_GIVEREF(__pyx_tuple__861); + + /* "talib/_func.pxi":6725 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__862 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__862)) __PYX_ERR(2, 6725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__862); + __Pyx_GIVEREF(__pyx_tuple__862); + + /* "talib/_func.pxi":6727 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__863 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__863)) __PYX_ERR(2, 6727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__863); + __Pyx_GIVEREF(__pyx_tuple__863); + + /* "talib/_func.pxi":6732 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__864 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__864)) __PYX_ERR(2, 6732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__864); + __Pyx_GIVEREF(__pyx_tuple__864); + + /* "talib/_func.pxi":6734 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__865 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__865)) __PYX_ERR(2, 6734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__865); + __Pyx_GIVEREF(__pyx_tuple__865); + + /* "talib/_func.pxi":6740 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__866 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__866)) __PYX_ERR(2, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__866); + __Pyx_GIVEREF(__pyx_tuple__866); + + /* "talib/_func.pxi":6752 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) + */ + __pyx_tuple__867 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__867)) __PYX_ERR(2, 6752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__867); + __Pyx_GIVEREF(__pyx_tuple__867); + + /* "talib/_func.pxi":6786 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__868 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__868)) __PYX_ERR(2, 6786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__868); + __Pyx_GIVEREF(__pyx_tuple__868); + + /* "talib/_func.pxi":6788 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__869 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__869)) __PYX_ERR(2, 6788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__869); + __Pyx_GIVEREF(__pyx_tuple__869); + + /* "talib/_func.pxi":6801 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COS_Lookback( ) + */ + __pyx_tuple__870 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__870)) __PYX_ERR(2, 6801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__870); + __Pyx_GIVEREF(__pyx_tuple__870); + + /* "talib/_func.pxi":6835 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__871 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__871)) __PYX_ERR(2, 6835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__871); + __Pyx_GIVEREF(__pyx_tuple__871); + + /* "talib/_func.pxi":6837 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__872 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__872)) __PYX_ERR(2, 6837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__872); + __Pyx_GIVEREF(__pyx_tuple__872); + + /* "talib/_func.pxi":6850 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_COSH_Lookback( ) + */ + __pyx_tuple__873 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__873)) __PYX_ERR(2, 6850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__873); + __Pyx_GIVEREF(__pyx_tuple__873); + + /* "talib/_func.pxi":6886 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__874 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__874)) __PYX_ERR(2, 6886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__874); + __Pyx_GIVEREF(__pyx_tuple__874); + + /* "talib/_func.pxi":6888 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__875 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__875)) __PYX_ERR(2, 6888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__875); + __Pyx_GIVEREF(__pyx_tuple__875); + + /* "talib/_func.pxi":6901 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) + */ + __pyx_tuple__876 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__876)) __PYX_ERR(2, 6901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__876); + __Pyx_GIVEREF(__pyx_tuple__876); + + /* "talib/_func.pxi":6937 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__877 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__877)) __PYX_ERR(2, 6937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__877); + __Pyx_GIVEREF(__pyx_tuple__877); + + /* "talib/_func.pxi":6939 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__878 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__878)) __PYX_ERR(2, 6939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__878); + __Pyx_GIVEREF(__pyx_tuple__878); + + /* "talib/_func.pxi":6944 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__879 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__879)) __PYX_ERR(2, 6944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__879); + __Pyx_GIVEREF(__pyx_tuple__879); + + /* "talib/_func.pxi":6946 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__880 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__880)) __PYX_ERR(2, 6946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__880); + __Pyx_GIVEREF(__pyx_tuple__880); + + /* "talib/_func.pxi":6952 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__881 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__881)) __PYX_ERR(2, 6952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__881); + __Pyx_GIVEREF(__pyx_tuple__881); + + /* "talib/_func.pxi":6964 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DIV_Lookback( ) + */ + __pyx_tuple__882 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__882)) __PYX_ERR(2, 6964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__882); + __Pyx_GIVEREF(__pyx_tuple__882); + + /* "talib/_func.pxi":7002 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__883 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__883)) __PYX_ERR(2, 7002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__883); + __Pyx_GIVEREF(__pyx_tuple__883); + + /* "talib/_func.pxi":7004 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__884 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__884)) __PYX_ERR(2, 7004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__884); + __Pyx_GIVEREF(__pyx_tuple__884); + + /* "talib/_func.pxi":7009 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__885 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__885)) __PYX_ERR(2, 7009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__885); + __Pyx_GIVEREF(__pyx_tuple__885); + + /* "talib/_func.pxi":7011 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__886 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__886)) __PYX_ERR(2, 7011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__886); + __Pyx_GIVEREF(__pyx_tuple__886); + + /* "talib/_func.pxi":7016 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__887 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__887)) __PYX_ERR(2, 7016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__887); + __Pyx_GIVEREF(__pyx_tuple__887); + + /* "talib/_func.pxi":7018 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__888 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__888)) __PYX_ERR(2, 7018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__888); + __Pyx_GIVEREF(__pyx_tuple__888); + + /* "talib/_func.pxi":7024 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__889 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__889)) __PYX_ERR(2, 7024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__889); + __Pyx_GIVEREF(__pyx_tuple__889); + + /* "talib/_func.pxi":7026 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__890 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__890)) __PYX_ERR(2, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__890); + __Pyx_GIVEREF(__pyx_tuple__890); + + /* "talib/_func.pxi":7041 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) + */ + __pyx_tuple__891 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__891)) __PYX_ERR(2, 7041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__891); + __Pyx_GIVEREF(__pyx_tuple__891); + + /* "talib/_func.pxi":7077 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__892 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__892)) __PYX_ERR(2, 7077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__892); + __Pyx_GIVEREF(__pyx_tuple__892); + + /* "talib/_func.pxi":7079 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__893 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__893)) __PYX_ERR(2, 7079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__893); + __Pyx_GIVEREF(__pyx_tuple__893); + + /* "talib/_func.pxi":7092 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) + */ + __pyx_tuple__894 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__894)) __PYX_ERR(2, 7092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__894); + __Pyx_GIVEREF(__pyx_tuple__894); + + /* "talib/_func.pxi":7126 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__895 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__895)) __PYX_ERR(2, 7126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__895); + __Pyx_GIVEREF(__pyx_tuple__895); + + /* "talib/_func.pxi":7128 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__896 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__896)) __PYX_ERR(2, 7128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__896); + __Pyx_GIVEREF(__pyx_tuple__896); + + /* "talib/_func.pxi":7141 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_EXP_Lookback( ) + */ + __pyx_tuple__897 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__897)) __PYX_ERR(2, 7141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__897); + __Pyx_GIVEREF(__pyx_tuple__897); + + /* "talib/_func.pxi":7175 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__898 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__898)) __PYX_ERR(2, 7175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__898); + __Pyx_GIVEREF(__pyx_tuple__898); + + /* "talib/_func.pxi":7177 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__899 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__899)) __PYX_ERR(2, 7177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__899); + __Pyx_GIVEREF(__pyx_tuple__899); + + /* "talib/_func.pxi":7190 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_FLOOR_Lookback( ) + */ + __pyx_tuple__900 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__900)) __PYX_ERR(2, 7190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__900); + __Pyx_GIVEREF(__pyx_tuple__900); + + /* "talib/_func.pxi":7224 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__901 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__901)) __PYX_ERR(2, 7224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__901); + __Pyx_GIVEREF(__pyx_tuple__901); + + /* "talib/_func.pxi":7226 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__902 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__902)) __PYX_ERR(2, 7226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__902); + __Pyx_GIVEREF(__pyx_tuple__902); + + /* "talib/_func.pxi":7239 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) + */ + __pyx_tuple__903 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__903)) __PYX_ERR(2, 7239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__903); + __Pyx_GIVEREF(__pyx_tuple__903); + + /* "talib/_func.pxi":7273 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__904 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__904)) __PYX_ERR(2, 7273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__904); + __Pyx_GIVEREF(__pyx_tuple__904); + + /* "talib/_func.pxi":7275 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__905 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__905)) __PYX_ERR(2, 7275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__905); + __Pyx_GIVEREF(__pyx_tuple__905); + + /* "talib/_func.pxi":7288 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) + */ + __pyx_tuple__906 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__906)) __PYX_ERR(2, 7288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__906); + __Pyx_GIVEREF(__pyx_tuple__906); + + /* "talib/_func.pxi":7325 + * double* outquadrature_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__907 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__907)) __PYX_ERR(2, 7325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__907); + __Pyx_GIVEREF(__pyx_tuple__907); + + /* "talib/_func.pxi":7327 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__908 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__908)) __PYX_ERR(2, 7327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__908); + __Pyx_GIVEREF(__pyx_tuple__908); + + /* "talib/_func.pxi":7340 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) + */ + __pyx_tuple__909 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__909)) __PYX_ERR(2, 7340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__909); + __Pyx_GIVEREF(__pyx_tuple__909); + + /* "talib/_func.pxi":7381 + * double* outleadsine_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__910 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__910)) __PYX_ERR(2, 7381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__910); + __Pyx_GIVEREF(__pyx_tuple__910); + + /* "talib/_func.pxi":7383 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__911 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__911)) __PYX_ERR(2, 7383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__911); + __Pyx_GIVEREF(__pyx_tuple__911); + + /* "talib/_func.pxi":7396 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_SINE_Lookback( ) + */ + __pyx_tuple__912 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__912)) __PYX_ERR(2, 7396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__912); + __Pyx_GIVEREF(__pyx_tuple__912); + + /* "talib/_func.pxi":7434 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__913 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__913)) __PYX_ERR(2, 7434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__913); + __Pyx_GIVEREF(__pyx_tuple__913); + + /* "talib/_func.pxi":7436 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__914 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__914)) __PYX_ERR(2, 7436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__914); + __Pyx_GIVEREF(__pyx_tuple__914); + + /* "talib/_func.pxi":7449 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) + */ + __pyx_tuple__915 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__915)) __PYX_ERR(2, 7449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__915); + __Pyx_GIVEREF(__pyx_tuple__915); + + /* "talib/_func.pxi":7483 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__916 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__916)) __PYX_ERR(2, 7483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__916); + __Pyx_GIVEREF(__pyx_tuple__916); + + /* "talib/_func.pxi":7485 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__917 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__917)) __PYX_ERR(2, 7485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__917); + __Pyx_GIVEREF(__pyx_tuple__917); + + /* "talib/_func.pxi":7498 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) + */ + __pyx_tuple__918 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__918)) __PYX_ERR(2, 7498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__918); + __Pyx_GIVEREF(__pyx_tuple__918); + + /* "talib/_func.pxi":7534 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__919 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__919)) __PYX_ERR(2, 7534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__919); + __Pyx_GIVEREF(__pyx_tuple__919); + + /* "talib/_func.pxi":7536 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__920 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__920)) __PYX_ERR(2, 7536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__920); + __Pyx_GIVEREF(__pyx_tuple__920); + + /* "talib/_func.pxi":7549 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) + */ + __pyx_tuple__921 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__921)) __PYX_ERR(2, 7549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__921); + __Pyx_GIVEREF(__pyx_tuple__921); + + /* "talib/_func.pxi":7585 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__922 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__922)) __PYX_ERR(2, 7585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__922); + __Pyx_GIVEREF(__pyx_tuple__922); + + /* "talib/_func.pxi":7587 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__923 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__923)) __PYX_ERR(2, 7587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__923); + __Pyx_GIVEREF(__pyx_tuple__923); + + /* "talib/_func.pxi":7600 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) + */ + __pyx_tuple__924 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__924)) __PYX_ERR(2, 7600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__924); + __Pyx_GIVEREF(__pyx_tuple__924); + + /* "talib/_func.pxi":7636 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__925 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__925)) __PYX_ERR(2, 7636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__925); + __Pyx_GIVEREF(__pyx_tuple__925); + + /* "talib/_func.pxi":7638 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__926 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__926)) __PYX_ERR(2, 7638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__926); + __Pyx_GIVEREF(__pyx_tuple__926); + + /* "talib/_func.pxi":7651 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) + */ + __pyx_tuple__927 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__927)) __PYX_ERR(2, 7651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__927); + __Pyx_GIVEREF(__pyx_tuple__927); + + /* "talib/_func.pxi":7687 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__928 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__928)) __PYX_ERR(2, 7687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__928); + __Pyx_GIVEREF(__pyx_tuple__928); + + /* "talib/_func.pxi":7689 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__929 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__929)) __PYX_ERR(2, 7689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__929); + __Pyx_GIVEREF(__pyx_tuple__929); + + /* "talib/_func.pxi":7702 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) + */ + __pyx_tuple__930 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__930)) __PYX_ERR(2, 7702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__930); + __Pyx_GIVEREF(__pyx_tuple__930); + + /* "talib/_func.pxi":7738 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__931 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__931)) __PYX_ERR(2, 7738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__931); + __Pyx_GIVEREF(__pyx_tuple__931); + + /* "talib/_func.pxi":7740 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__932 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__932)) __PYX_ERR(2, 7740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__932); + __Pyx_GIVEREF(__pyx_tuple__932); + + /* "talib/_func.pxi":7753 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) + */ + __pyx_tuple__933 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__933)) __PYX_ERR(2, 7753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__933); + __Pyx_GIVEREF(__pyx_tuple__933); + + /* "talib/_func.pxi":7787 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__934 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__934)) __PYX_ERR(2, 7787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__934); + __Pyx_GIVEREF(__pyx_tuple__934); + + /* "talib/_func.pxi":7789 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__935 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__935)) __PYX_ERR(2, 7789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__935); + __Pyx_GIVEREF(__pyx_tuple__935); + + /* "talib/_func.pxi":7802 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LN_Lookback( ) + */ + __pyx_tuple__936 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__936)) __PYX_ERR(2, 7802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__936); + __Pyx_GIVEREF(__pyx_tuple__936); + + /* "talib/_func.pxi":7836 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__937 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__937)) __PYX_ERR(2, 7836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__937); + __Pyx_GIVEREF(__pyx_tuple__937); + + /* "talib/_func.pxi":7838 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__938 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__938)) __PYX_ERR(2, 7838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__938); + __Pyx_GIVEREF(__pyx_tuple__938); + + /* "talib/_func.pxi":7851 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_LOG10_Lookback( ) + */ + __pyx_tuple__939 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__939)) __PYX_ERR(2, 7851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__939); + __Pyx_GIVEREF(__pyx_tuple__939); + + /* "talib/_func.pxi":7888 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__940 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__940)) __PYX_ERR(2, 7888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__940); + __Pyx_GIVEREF(__pyx_tuple__940); + + /* "talib/_func.pxi":7890 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__941 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__941)) __PYX_ERR(2, 7890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__941); + __Pyx_GIVEREF(__pyx_tuple__941); + + /* "talib/_func.pxi":7903 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) + */ + __pyx_tuple__942 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__942)) __PYX_ERR(2, 7903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__942); + __Pyx_GIVEREF(__pyx_tuple__942); + + /* "talib/_func.pxi":7947 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__943 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__943)) __PYX_ERR(2, 7947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__943); + __Pyx_GIVEREF(__pyx_tuple__943); + + /* "talib/_func.pxi":7949 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__944 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__944)) __PYX_ERR(2, 7949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__944); + __Pyx_GIVEREF(__pyx_tuple__944); + + /* "talib/_func.pxi":7962 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) + */ + __pyx_tuple__945 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__945)) __PYX_ERR(2, 7962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__945); + __Pyx_GIVEREF(__pyx_tuple__945); + + /* "talib/_func.pxi":8017 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__946 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__946)) __PYX_ERR(2, 8017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__946); + __Pyx_GIVEREF(__pyx_tuple__946); + + /* "talib/_func.pxi":8019 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__947 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__947)) __PYX_ERR(2, 8019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__947); + __Pyx_GIVEREF(__pyx_tuple__947); + + /* "talib/_func.pxi":8032 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) + */ + __pyx_tuple__948 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__948)) __PYX_ERR(2, 8032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__948); + __Pyx_GIVEREF(__pyx_tuple__948); + + /* "talib/_func.pxi":8082 + * double* outmacdhist_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__949 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__949)) __PYX_ERR(2, 8082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__949); + __Pyx_GIVEREF(__pyx_tuple__949); + + /* "talib/_func.pxi":8084 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__950 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__950)) __PYX_ERR(2, 8084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__950); + __Pyx_GIVEREF(__pyx_tuple__950); + + /* "talib/_func.pxi":8097 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) + */ + __pyx_tuple__951 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__951)) __PYX_ERR(2, 8097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__951); + __Pyx_GIVEREF(__pyx_tuple__951); + + /* "talib/_func.pxi":8145 + * double* outfama_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__952 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__952)) __PYX_ERR(2, 8145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__952); + __Pyx_GIVEREF(__pyx_tuple__952); + + /* "talib/_func.pxi":8147 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__953 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__953)) __PYX_ERR(2, 8147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__953); + __Pyx_GIVEREF(__pyx_tuple__953); + + /* "talib/_func.pxi":8160 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) + */ + __pyx_tuple__954 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__954)) __PYX_ERR(2, 8160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__954); + __Pyx_GIVEREF(__pyx_tuple__954); + + /* "talib/_func.pxi":8204 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__955 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__955)) __PYX_ERR(2, 8204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__955); + __Pyx_GIVEREF(__pyx_tuple__955); + + /* "talib/_func.pxi":8206 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__956 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__956)) __PYX_ERR(2, 8206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__956); + __Pyx_GIVEREF(__pyx_tuple__956); + + /* "talib/_func.pxi":8211 + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") # <<<<<<<<<<<<<< + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + */ + __pyx_tuple__957 = PyTuple_Pack(1, __pyx_kp_s_periods_is_not_double); if (unlikely(!__pyx_tuple__957)) __PYX_ERR(2, 8211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__957); + __Pyx_GIVEREF(__pyx_tuple__957); + + /* "talib/_func.pxi":8213 + * raise Exception("periods is not double") + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + */ + __pyx_tuple__958 = PyTuple_Pack(1, __pyx_kp_s_periods_has_wrong_dimensions); if (unlikely(!__pyx_tuple__958)) __PYX_ERR(2, 8213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__958); + __Pyx_GIVEREF(__pyx_tuple__958); + + /* "talib/_func.pxi":8219 + * length = real.shape[0] + * if length != periods.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__959 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__959)) __PYX_ERR(2, 8219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__959); + __Pyx_GIVEREF(__pyx_tuple__959); + + /* "talib/_func.pxi":8231 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) + */ + __pyx_tuple__960 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__960)) __PYX_ERR(2, 8231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__960); + __Pyx_GIVEREF(__pyx_tuple__960); + + /* "talib/_func.pxi":8267 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__961 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__961)) __PYX_ERR(2, 8267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__961); + __Pyx_GIVEREF(__pyx_tuple__961); + + /* "talib/_func.pxi":8269 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__962 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__962)) __PYX_ERR(2, 8269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__962); + __Pyx_GIVEREF(__pyx_tuple__962); + + /* "talib/_func.pxi":8282 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) + */ + __pyx_tuple__963 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__963)) __PYX_ERR(2, 8282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__963); + __Pyx_GIVEREF(__pyx_tuple__963); + + /* "talib/_func.pxi":8318 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__964 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__964)) __PYX_ERR(2, 8318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__964); + __Pyx_GIVEREF(__pyx_tuple__964); + + /* "talib/_func.pxi":8320 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__965 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__965)) __PYX_ERR(2, 8320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__965); + __Pyx_GIVEREF(__pyx_tuple__965); + + /* "talib/_func.pxi":8333 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) + */ + __pyx_tuple__966 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__966)) __PYX_ERR(2, 8333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__966); + __Pyx_GIVEREF(__pyx_tuple__966); + + /* "talib/_func.pxi":8368 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__967 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__967)) __PYX_ERR(2, 8368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__967); + __Pyx_GIVEREF(__pyx_tuple__967); + + /* "talib/_func.pxi":8370 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__968 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__968)) __PYX_ERR(2, 8370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__968); + __Pyx_GIVEREF(__pyx_tuple__968); + + /* "talib/_func.pxi":8375 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__969 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__969)) __PYX_ERR(2, 8375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__969); + __Pyx_GIVEREF(__pyx_tuple__969); + + /* "talib/_func.pxi":8377 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__970 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__970)) __PYX_ERR(2, 8377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__970); + __Pyx_GIVEREF(__pyx_tuple__970); + + /* "talib/_func.pxi":8383 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__971 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__971)) __PYX_ERR(2, 8383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__971); + __Pyx_GIVEREF(__pyx_tuple__971); + + /* "talib/_func.pxi":8395 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) + */ + __pyx_tuple__972 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__972)) __PYX_ERR(2, 8395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__972); + __Pyx_GIVEREF(__pyx_tuple__972); + + /* "talib/_func.pxi":8434 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__973 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__973)) __PYX_ERR(2, 8434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__973); + __Pyx_GIVEREF(__pyx_tuple__973); + + /* "talib/_func.pxi":8436 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__974 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__974)) __PYX_ERR(2, 8436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__974); + __Pyx_GIVEREF(__pyx_tuple__974); + + /* "talib/_func.pxi":8441 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__975 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__975)) __PYX_ERR(2, 8441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__975); + __Pyx_GIVEREF(__pyx_tuple__975); + + /* "talib/_func.pxi":8443 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__976 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__976)) __PYX_ERR(2, 8443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__976); + __Pyx_GIVEREF(__pyx_tuple__976); + + /* "talib/_func.pxi":8448 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__977 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__977)) __PYX_ERR(2, 8448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__977); + __Pyx_GIVEREF(__pyx_tuple__977); + + /* "talib/_func.pxi":8450 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__978 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__978)) __PYX_ERR(2, 8450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__978); + __Pyx_GIVEREF(__pyx_tuple__978); + + /* "talib/_func.pxi":8455 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__979 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__979)) __PYX_ERR(2, 8455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__979); + __Pyx_GIVEREF(__pyx_tuple__979); + + /* "talib/_func.pxi":8457 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__980 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__980)) __PYX_ERR(2, 8457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__980); + __Pyx_GIVEREF(__pyx_tuple__980); + + /* "talib/_func.pxi":8463 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__981 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__981)) __PYX_ERR(2, 8463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__981); + __Pyx_GIVEREF(__pyx_tuple__981); + + /* "talib/_func.pxi":8465 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__982 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__982)) __PYX_ERR(2, 8465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__982); + __Pyx_GIVEREF(__pyx_tuple__982); + + /* "talib/_func.pxi":8467 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__983 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__983)) __PYX_ERR(2, 8467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__983); + __Pyx_GIVEREF(__pyx_tuple__983); + + /* "talib/_func.pxi":8485 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) + */ + __pyx_tuple__984 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__984)) __PYX_ERR(2, 8485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__984); + __Pyx_GIVEREF(__pyx_tuple__984); + + /* "talib/_func.pxi":8521 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__985 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__985)) __PYX_ERR(2, 8521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__985); + __Pyx_GIVEREF(__pyx_tuple__985); + + /* "talib/_func.pxi":8523 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__986 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__986)) __PYX_ERR(2, 8523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__986); + __Pyx_GIVEREF(__pyx_tuple__986); + + /* "talib/_func.pxi":8536 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) + */ + __pyx_tuple__987 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__987)) __PYX_ERR(2, 8536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__987); + __Pyx_GIVEREF(__pyx_tuple__987); + + /* "talib/_func.pxi":8573 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__988 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__988)) __PYX_ERR(2, 8573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__988); + __Pyx_GIVEREF(__pyx_tuple__988); + + /* "talib/_func.pxi":8575 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__989 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__989)) __PYX_ERR(2, 8575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__989); + __Pyx_GIVEREF(__pyx_tuple__989); + + /* "talib/_func.pxi":8580 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__990 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__990)) __PYX_ERR(2, 8580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__990); + __Pyx_GIVEREF(__pyx_tuple__990); + + /* "talib/_func.pxi":8582 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__991 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__991)) __PYX_ERR(2, 8582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__991); + __Pyx_GIVEREF(__pyx_tuple__991); + + /* "talib/_func.pxi":8588 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__992 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__992)) __PYX_ERR(2, 8588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__992); + __Pyx_GIVEREF(__pyx_tuple__992); + + /* "talib/_func.pxi":8600 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) + */ + __pyx_tuple__993 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__993)) __PYX_ERR(2, 8600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__993); + __Pyx_GIVEREF(__pyx_tuple__993); + + /* "talib/_func.pxi":8636 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__994 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__994)) __PYX_ERR(2, 8636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__994); + __Pyx_GIVEREF(__pyx_tuple__994); + + /* "talib/_func.pxi":8638 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__995 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__995)) __PYX_ERR(2, 8638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__995); + __Pyx_GIVEREF(__pyx_tuple__995); + + /* "talib/_func.pxi":8651 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) + */ + __pyx_tuple__996 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__996)) __PYX_ERR(2, 8651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__996); + __Pyx_GIVEREF(__pyx_tuple__996); + + /* "talib/_func.pxi":8687 + * int* outinteger_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__997 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__997)) __PYX_ERR(2, 8687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__997); + __Pyx_GIVEREF(__pyx_tuple__997); + + /* "talib/_func.pxi":8689 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__998 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__998)) __PYX_ERR(2, 8689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__998); + __Pyx_GIVEREF(__pyx_tuple__998); + + /* "talib/_func.pxi":8702 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) + */ + __pyx_tuple__999 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__999)) __PYX_ERR(2, 8702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__999); + __Pyx_GIVEREF(__pyx_tuple__999); + + /* "talib/_func.pxi":8741 + * double* outmax_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1000 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1000)) __PYX_ERR(2, 8741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1000); + __Pyx_GIVEREF(__pyx_tuple__1000); + + /* "talib/_func.pxi":8743 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1001 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1001)) __PYX_ERR(2, 8743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1001); + __Pyx_GIVEREF(__pyx_tuple__1001); + + /* "talib/_func.pxi":8756 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) + */ + __pyx_tuple__1002 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1002)) __PYX_ERR(2, 8756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1002); + __Pyx_GIVEREF(__pyx_tuple__1002); + + /* "talib/_func.pxi":8799 + * int* outmaxidx_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1003 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1003)) __PYX_ERR(2, 8799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1003); + __Pyx_GIVEREF(__pyx_tuple__1003); + + /* "talib/_func.pxi":8801 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1004 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1004)) __PYX_ERR(2, 8801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1004); + __Pyx_GIVEREF(__pyx_tuple__1004); + + /* "talib/_func.pxi":8814 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) + */ + __pyx_tuple__1005 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1005)) __PYX_ERR(2, 8814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1005); + __Pyx_GIVEREF(__pyx_tuple__1005); + + /* "talib/_func.pxi":8856 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1006 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1006)) __PYX_ERR(2, 8856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1006); + __Pyx_GIVEREF(__pyx_tuple__1006); + + /* "talib/_func.pxi":8858 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1007 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1007)) __PYX_ERR(2, 8858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1007); + __Pyx_GIVEREF(__pyx_tuple__1007); + + /* "talib/_func.pxi":8863 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1008 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1008)) __PYX_ERR(2, 8863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1008); + __Pyx_GIVEREF(__pyx_tuple__1008); + + /* "talib/_func.pxi":8865 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1009 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1009)) __PYX_ERR(2, 8865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1009); + __Pyx_GIVEREF(__pyx_tuple__1009); + + /* "talib/_func.pxi":8870 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1010 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1010)) __PYX_ERR(2, 8870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1010); + __Pyx_GIVEREF(__pyx_tuple__1010); + + /* "talib/_func.pxi":8872 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1011 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1011)) __PYX_ERR(2, 8872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1011); + __Pyx_GIVEREF(__pyx_tuple__1011); + + /* "talib/_func.pxi":8878 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1012 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1012)) __PYX_ERR(2, 8878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1012); + __Pyx_GIVEREF(__pyx_tuple__1012); + + /* "talib/_func.pxi":8880 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1013 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1013)) __PYX_ERR(2, 8880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1013); + __Pyx_GIVEREF(__pyx_tuple__1013); + + /* "talib/_func.pxi":8895 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) + */ + __pyx_tuple__1014 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1014)) __PYX_ERR(2, 8895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1014); + __Pyx_GIVEREF(__pyx_tuple__1014); + + /* "talib/_func.pxi":8932 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1015 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1015)) __PYX_ERR(2, 8932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1015); + __Pyx_GIVEREF(__pyx_tuple__1015); + + /* "talib/_func.pxi":8934 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1016 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1016)) __PYX_ERR(2, 8934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1016); + __Pyx_GIVEREF(__pyx_tuple__1016); + + /* "talib/_func.pxi":8939 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1017 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1017)) __PYX_ERR(2, 8939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1017); + __Pyx_GIVEREF(__pyx_tuple__1017); + + /* "talib/_func.pxi":8941 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1018 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1018)) __PYX_ERR(2, 8941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1018); + __Pyx_GIVEREF(__pyx_tuple__1018); + + /* "talib/_func.pxi":8947 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1019 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1019)) __PYX_ERR(2, 8947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1019); + __Pyx_GIVEREF(__pyx_tuple__1019); + + /* "talib/_func.pxi":8959 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) + */ + __pyx_tuple__1020 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1020)) __PYX_ERR(2, 8959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1020); + __Pyx_GIVEREF(__pyx_tuple__1020); + + /* "talib/_func.pxi":8995 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1021 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1021)) __PYX_ERR(2, 8995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1021); + __Pyx_GIVEREF(__pyx_tuple__1021); + + /* "talib/_func.pxi":8997 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1022 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1022)) __PYX_ERR(2, 8997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1022); + __Pyx_GIVEREF(__pyx_tuple__1022); + + /* "talib/_func.pxi":9010 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) + */ + __pyx_tuple__1023 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1023)) __PYX_ERR(2, 9010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1023); + __Pyx_GIVEREF(__pyx_tuple__1023); + + /* "talib/_func.pxi":9046 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__1024 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1024)) __PYX_ERR(2, 9046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1024); + __Pyx_GIVEREF(__pyx_tuple__1024); + + /* "talib/_func.pxi":9048 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__1025 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1025)) __PYX_ERR(2, 9048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1025); + __Pyx_GIVEREF(__pyx_tuple__1025); + + /* "talib/_func.pxi":9053 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__1026 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1026)) __PYX_ERR(2, 9053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1026); + __Pyx_GIVEREF(__pyx_tuple__1026); + + /* "talib/_func.pxi":9055 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__1027 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1027)) __PYX_ERR(2, 9055, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1027); + __Pyx_GIVEREF(__pyx_tuple__1027); + + /* "talib/_func.pxi":9061 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1028 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1028)) __PYX_ERR(2, 9061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1028); + __Pyx_GIVEREF(__pyx_tuple__1028); + + /* "talib/_func.pxi":9073 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_MULT_Lookback( ) + */ + __pyx_tuple__1029 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1029)) __PYX_ERR(2, 9073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1029); + __Pyx_GIVEREF(__pyx_tuple__1029); + + /* "talib/_func.pxi":9111 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1030 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1030)) __PYX_ERR(2, 9111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1030); + __Pyx_GIVEREF(__pyx_tuple__1030); + + /* "talib/_func.pxi":9113 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1031 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1031)) __PYX_ERR(2, 9113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1031); + __Pyx_GIVEREF(__pyx_tuple__1031); + + /* "talib/_func.pxi":9118 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1032 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1032)) __PYX_ERR(2, 9118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1032); + __Pyx_GIVEREF(__pyx_tuple__1032); + + /* "talib/_func.pxi":9120 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1033 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1033)) __PYX_ERR(2, 9120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1033); + __Pyx_GIVEREF(__pyx_tuple__1033); + + /* "talib/_func.pxi":9125 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1034 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1034)) __PYX_ERR(2, 9125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1034); + __Pyx_GIVEREF(__pyx_tuple__1034); + + /* "talib/_func.pxi":9127 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1035 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1035)) __PYX_ERR(2, 9127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1035); + __Pyx_GIVEREF(__pyx_tuple__1035); + + /* "talib/_func.pxi":9133 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1036 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1036)) __PYX_ERR(2, 9133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1036); + __Pyx_GIVEREF(__pyx_tuple__1036); + + /* "talib/_func.pxi":9135 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1037 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1037)) __PYX_ERR(2, 9135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1037); + __Pyx_GIVEREF(__pyx_tuple__1037); + + /* "talib/_func.pxi":9150 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) + */ + __pyx_tuple__1038 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1038)) __PYX_ERR(2, 9150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1038); + __Pyx_GIVEREF(__pyx_tuple__1038); + + /* "talib/_func.pxi":9186 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1039 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1039)) __PYX_ERR(2, 9186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1039); + __Pyx_GIVEREF(__pyx_tuple__1039); + + /* "talib/_func.pxi":9188 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1040 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1040)) __PYX_ERR(2, 9188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1040); + __Pyx_GIVEREF(__pyx_tuple__1040); + + /* "talib/_func.pxi":9193 + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__1041 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__1041)) __PYX_ERR(2, 9193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1041); + __Pyx_GIVEREF(__pyx_tuple__1041); + + /* "talib/_func.pxi":9195 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__1042 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1042)) __PYX_ERR(2, 9195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1042); + __Pyx_GIVEREF(__pyx_tuple__1042); + + /* "talib/_func.pxi":9201 + * length = real.shape[0] + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1043 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1043)) __PYX_ERR(2, 9201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1043); + __Pyx_GIVEREF(__pyx_tuple__1043); + + /* "talib/_func.pxi":9213 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_OBV_Lookback( ) + */ + __pyx_tuple__1044 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1044)) __PYX_ERR(2, 9213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1044); + __Pyx_GIVEREF(__pyx_tuple__1044); + + /* "talib/_func.pxi":9251 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1045 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1045)) __PYX_ERR(2, 9251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1045); + __Pyx_GIVEREF(__pyx_tuple__1045); + + /* "talib/_func.pxi":9253 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1046 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1046)) __PYX_ERR(2, 9253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1046); + __Pyx_GIVEREF(__pyx_tuple__1046); + + /* "talib/_func.pxi":9258 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1047 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1047)) __PYX_ERR(2, 9258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1047); + __Pyx_GIVEREF(__pyx_tuple__1047); + + /* "talib/_func.pxi":9260 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1048 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1048)) __PYX_ERR(2, 9260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1048); + __Pyx_GIVEREF(__pyx_tuple__1048); + + /* "talib/_func.pxi":9265 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1049 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1049)) __PYX_ERR(2, 9265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1049); + __Pyx_GIVEREF(__pyx_tuple__1049); + + /* "talib/_func.pxi":9267 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1050 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1050)) __PYX_ERR(2, 9267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1050); + __Pyx_GIVEREF(__pyx_tuple__1050); + + /* "talib/_func.pxi":9273 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1051 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1051)) __PYX_ERR(2, 9273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1051); + __Pyx_GIVEREF(__pyx_tuple__1051); + + /* "talib/_func.pxi":9275 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1052 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1052)) __PYX_ERR(2, 9275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1052); + __Pyx_GIVEREF(__pyx_tuple__1052); + + /* "talib/_func.pxi":9290 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) + */ + __pyx_tuple__1053 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1053)) __PYX_ERR(2, 9290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1053); + __Pyx_GIVEREF(__pyx_tuple__1053); + + /* "talib/_func.pxi":9327 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1054 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1054)) __PYX_ERR(2, 9327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1054); + __Pyx_GIVEREF(__pyx_tuple__1054); + + /* "talib/_func.pxi":9329 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1055 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1055)) __PYX_ERR(2, 9329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1055); + __Pyx_GIVEREF(__pyx_tuple__1055); + + /* "talib/_func.pxi":9334 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1056 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1056)) __PYX_ERR(2, 9334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1056); + __Pyx_GIVEREF(__pyx_tuple__1056); + + /* "talib/_func.pxi":9336 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1057 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1057)) __PYX_ERR(2, 9336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1057); + __Pyx_GIVEREF(__pyx_tuple__1057); + + /* "talib/_func.pxi":9342 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1058 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1058)) __PYX_ERR(2, 9342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1058); + __Pyx_GIVEREF(__pyx_tuple__1058); + + /* "talib/_func.pxi":9354 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) + */ + __pyx_tuple__1059 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1059)) __PYX_ERR(2, 9354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1059); + __Pyx_GIVEREF(__pyx_tuple__1059); + + /* "talib/_func.pxi":9392 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1060 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1060)) __PYX_ERR(2, 9392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1060); + __Pyx_GIVEREF(__pyx_tuple__1060); + + /* "talib/_func.pxi":9394 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1061 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1061)) __PYX_ERR(2, 9394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1061); + __Pyx_GIVEREF(__pyx_tuple__1061); + + /* "talib/_func.pxi":9407 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) + */ + __pyx_tuple__1062 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1062)) __PYX_ERR(2, 9407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1062); + __Pyx_GIVEREF(__pyx_tuple__1062); + + /* "talib/_func.pxi":9443 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1063 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1063)) __PYX_ERR(2, 9443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1063); + __Pyx_GIVEREF(__pyx_tuple__1063); + + /* "talib/_func.pxi":9445 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1064 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1064)) __PYX_ERR(2, 9445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1064); + __Pyx_GIVEREF(__pyx_tuple__1064); + + /* "talib/_func.pxi":9458 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) + */ + __pyx_tuple__1065 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1065)) __PYX_ERR(2, 9458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1065); + __Pyx_GIVEREF(__pyx_tuple__1065); + + /* "talib/_func.pxi":9494 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1066 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1066)) __PYX_ERR(2, 9494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1066); + __Pyx_GIVEREF(__pyx_tuple__1066); + + /* "talib/_func.pxi":9496 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1067 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1067)) __PYX_ERR(2, 9496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1067); + __Pyx_GIVEREF(__pyx_tuple__1067); + + /* "talib/_func.pxi":9509 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) + */ + __pyx_tuple__1068 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1068)) __PYX_ERR(2, 9509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1068); + __Pyx_GIVEREF(__pyx_tuple__1068); + + /* "talib/_func.pxi":9545 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1069 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1069)) __PYX_ERR(2, 9545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1069); + __Pyx_GIVEREF(__pyx_tuple__1069); + + /* "talib/_func.pxi":9547 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1070 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1070)) __PYX_ERR(2, 9547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1070); + __Pyx_GIVEREF(__pyx_tuple__1070); + + /* "talib/_func.pxi":9560 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) + */ + __pyx_tuple__1071 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1071)) __PYX_ERR(2, 9560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1071); + __Pyx_GIVEREF(__pyx_tuple__1071); + + /* "talib/_func.pxi":9596 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1072 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1072)) __PYX_ERR(2, 9596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1072); + __Pyx_GIVEREF(__pyx_tuple__1072); + + /* "talib/_func.pxi":9598 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1073 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1073)) __PYX_ERR(2, 9598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1073); + __Pyx_GIVEREF(__pyx_tuple__1073); + + /* "talib/_func.pxi":9611 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) + */ + __pyx_tuple__1074 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1074)) __PYX_ERR(2, 9611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1074); + __Pyx_GIVEREF(__pyx_tuple__1074); + + /* "talib/_func.pxi":9647 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1075 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1075)) __PYX_ERR(2, 9647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1075); + __Pyx_GIVEREF(__pyx_tuple__1075); + + /* "talib/_func.pxi":9649 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1076 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1076)) __PYX_ERR(2, 9649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1076); + __Pyx_GIVEREF(__pyx_tuple__1076); + + /* "talib/_func.pxi":9662 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) + */ + __pyx_tuple__1077 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1077)) __PYX_ERR(2, 9662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1077); + __Pyx_GIVEREF(__pyx_tuple__1077); + + /* "talib/_func.pxi":9700 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1078 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1078)) __PYX_ERR(2, 9700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1078); + __Pyx_GIVEREF(__pyx_tuple__1078); + + /* "talib/_func.pxi":9702 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1079 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1079)) __PYX_ERR(2, 9702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1079); + __Pyx_GIVEREF(__pyx_tuple__1079); + + /* "talib/_func.pxi":9707 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1080 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1080)) __PYX_ERR(2, 9707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1080); + __Pyx_GIVEREF(__pyx_tuple__1080); + + /* "talib/_func.pxi":9709 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1081 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1081)) __PYX_ERR(2, 9709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1081); + __Pyx_GIVEREF(__pyx_tuple__1081); + + /* "talib/_func.pxi":9715 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1082 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1082)) __PYX_ERR(2, 9715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1082); + __Pyx_GIVEREF(__pyx_tuple__1082); + + /* "talib/_func.pxi":9727 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) + */ + __pyx_tuple__1083 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1083)) __PYX_ERR(2, 9727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1083); + __Pyx_GIVEREF(__pyx_tuple__1083); + + /* "talib/_func.pxi":9771 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1084 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1084)) __PYX_ERR(2, 9771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1084); + __Pyx_GIVEREF(__pyx_tuple__1084); + + /* "talib/_func.pxi":9773 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1085 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1085)) __PYX_ERR(2, 9773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1085); + __Pyx_GIVEREF(__pyx_tuple__1085); + + /* "talib/_func.pxi":9778 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1086 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1086)) __PYX_ERR(2, 9778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1086); + __Pyx_GIVEREF(__pyx_tuple__1086); + + /* "talib/_func.pxi":9780 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1087 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1087)) __PYX_ERR(2, 9780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1087); + __Pyx_GIVEREF(__pyx_tuple__1087); + + /* "talib/_func.pxi":9786 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1088 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1088)) __PYX_ERR(2, 9786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1088); + __Pyx_GIVEREF(__pyx_tuple__1088); + + /* "talib/_func.pxi":9798 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) + */ + __pyx_tuple__1089 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1089)) __PYX_ERR(2, 9798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1089); + __Pyx_GIVEREF(__pyx_tuple__1089); + + /* "talib/_func.pxi":9832 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1090 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1090)) __PYX_ERR(2, 9832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1090); + __Pyx_GIVEREF(__pyx_tuple__1090); + + /* "talib/_func.pxi":9834 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1091 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1091)) __PYX_ERR(2, 9834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1091); + __Pyx_GIVEREF(__pyx_tuple__1091); + + /* "talib/_func.pxi":9847 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SIN_Lookback( ) + */ + __pyx_tuple__1092 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1092)) __PYX_ERR(2, 9847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1092); + __Pyx_GIVEREF(__pyx_tuple__1092); + + /* "talib/_func.pxi":9881 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1093 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1093)) __PYX_ERR(2, 9881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1093); + __Pyx_GIVEREF(__pyx_tuple__1093); + + /* "talib/_func.pxi":9883 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1094 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1094)) __PYX_ERR(2, 9883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1094); + __Pyx_GIVEREF(__pyx_tuple__1094); + + /* "talib/_func.pxi":9896 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SINH_Lookback( ) + */ + __pyx_tuple__1095 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1095)) __PYX_ERR(2, 9896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1095); + __Pyx_GIVEREF(__pyx_tuple__1095); + + /* "talib/_func.pxi":9932 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1096 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1096)) __PYX_ERR(2, 9932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1096); + __Pyx_GIVEREF(__pyx_tuple__1096); + + /* "talib/_func.pxi":9934 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1097 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1097)) __PYX_ERR(2, 9934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1097); + __Pyx_GIVEREF(__pyx_tuple__1097); + + /* "talib/_func.pxi":9947 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) + */ + __pyx_tuple__1098 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1098)) __PYX_ERR(2, 9947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1098); + __Pyx_GIVEREF(__pyx_tuple__1098); + + /* "talib/_func.pxi":9981 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1099 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1099)) __PYX_ERR(2, 9981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1099); + __Pyx_GIVEREF(__pyx_tuple__1099); + + /* "talib/_func.pxi":9983 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1100 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1100)) __PYX_ERR(2, 9983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1100); + __Pyx_GIVEREF(__pyx_tuple__1100); + + /* "talib/_func.pxi":9996 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SQRT_Lookback( ) + */ + __pyx_tuple__1101 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1101)) __PYX_ERR(2, 9996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1101); + __Pyx_GIVEREF(__pyx_tuple__1101); + + /* "talib/_func.pxi":10033 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1102 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1102)) __PYX_ERR(2, 10033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1102); + __Pyx_GIVEREF(__pyx_tuple__1102); + + /* "talib/_func.pxi":10035 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1103 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1103)) __PYX_ERR(2, 10035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1103); + __Pyx_GIVEREF(__pyx_tuple__1103); + + /* "talib/_func.pxi":10048 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) + */ + __pyx_tuple__1104 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1104)) __PYX_ERR(2, 10048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1104); + __Pyx_GIVEREF(__pyx_tuple__1104); + + /* "talib/_func.pxi":10093 + * double* outslowd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1105 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1105)) __PYX_ERR(2, 10093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1105); + __Pyx_GIVEREF(__pyx_tuple__1105); + + /* "talib/_func.pxi":10095 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1106 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1106)) __PYX_ERR(2, 10095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1106); + __Pyx_GIVEREF(__pyx_tuple__1106); + + /* "talib/_func.pxi":10100 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1107 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1107)) __PYX_ERR(2, 10100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1107); + __Pyx_GIVEREF(__pyx_tuple__1107); + + /* "talib/_func.pxi":10102 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1108 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1108)) __PYX_ERR(2, 10102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1108); + __Pyx_GIVEREF(__pyx_tuple__1108); + + /* "talib/_func.pxi":10107 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1109 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1109)) __PYX_ERR(2, 10107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1109); + __Pyx_GIVEREF(__pyx_tuple__1109); + + /* "talib/_func.pxi":10109 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1110 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1110)) __PYX_ERR(2, 10109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1110); + __Pyx_GIVEREF(__pyx_tuple__1110); + + /* "talib/_func.pxi":10115 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1111 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1111)) __PYX_ERR(2, 10115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1111); + __Pyx_GIVEREF(__pyx_tuple__1111); + + /* "talib/_func.pxi":10117 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1112 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1112)) __PYX_ERR(2, 10117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1112); + __Pyx_GIVEREF(__pyx_tuple__1112); + + /* "talib/_func.pxi":10132 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) + */ + __pyx_tuple__1113 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1113)) __PYX_ERR(2, 10132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1113); + __Pyx_GIVEREF(__pyx_tuple__1113); + + /* "talib/_func.pxi":10179 + * double* outfastd_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1114 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1114)) __PYX_ERR(2, 10179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1114); + __Pyx_GIVEREF(__pyx_tuple__1114); + + /* "talib/_func.pxi":10181 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1115 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1115)) __PYX_ERR(2, 10181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1115); + __Pyx_GIVEREF(__pyx_tuple__1115); + + /* "talib/_func.pxi":10186 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1116 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1116)) __PYX_ERR(2, 10186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1116); + __Pyx_GIVEREF(__pyx_tuple__1116); + + /* "talib/_func.pxi":10188 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1117 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1117)) __PYX_ERR(2, 10188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1117); + __Pyx_GIVEREF(__pyx_tuple__1117); + + /* "talib/_func.pxi":10193 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1118 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1118)) __PYX_ERR(2, 10193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1118); + __Pyx_GIVEREF(__pyx_tuple__1118); + + /* "talib/_func.pxi":10195 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1119 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1119)) __PYX_ERR(2, 10195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1119); + __Pyx_GIVEREF(__pyx_tuple__1119); + + /* "talib/_func.pxi":10201 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1120 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1120)) __PYX_ERR(2, 10201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1120); + __Pyx_GIVEREF(__pyx_tuple__1120); + + /* "talib/_func.pxi":10203 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1121 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1121)) __PYX_ERR(2, 10203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1121); + __Pyx_GIVEREF(__pyx_tuple__1121); + + /* "talib/_func.pxi":10218 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) + */ + __pyx_tuple__1122 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1122)) __PYX_ERR(2, 10218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1122); + __Pyx_GIVEREF(__pyx_tuple__1122); + + /* "talib/_func.pxi":10264 + * double* outfastd_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1123 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1123)) __PYX_ERR(2, 10264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1123); + __Pyx_GIVEREF(__pyx_tuple__1123); + + /* "talib/_func.pxi":10266 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1124 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1124)) __PYX_ERR(2, 10266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1124); + __Pyx_GIVEREF(__pyx_tuple__1124); + + /* "talib/_func.pxi":10279 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) + */ + __pyx_tuple__1125 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1125)) __PYX_ERR(2, 10279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1125); + __Pyx_GIVEREF(__pyx_tuple__1125); + + /* "talib/_func.pxi":10319 + * double* outreal_data + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__1126 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1126)) __PYX_ERR(2, 10319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1126); + __Pyx_GIVEREF(__pyx_tuple__1126); + + /* "talib/_func.pxi":10321 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__1127 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1127)) __PYX_ERR(2, 10321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1127); + __Pyx_GIVEREF(__pyx_tuple__1127); + + /* "talib/_func.pxi":10326 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__1128 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1128)) __PYX_ERR(2, 10326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1128); + __Pyx_GIVEREF(__pyx_tuple__1128); + + /* "talib/_func.pxi":10328 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__1129 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1129)) __PYX_ERR(2, 10328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1129); + __Pyx_GIVEREF(__pyx_tuple__1129); + + /* "talib/_func.pxi":10334 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1130 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1130)) __PYX_ERR(2, 10334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1130); + __Pyx_GIVEREF(__pyx_tuple__1130); + + /* "talib/_func.pxi":10346 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUB_Lookback( ) + */ + __pyx_tuple__1131 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1131)) __PYX_ERR(2, 10346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1131); + __Pyx_GIVEREF(__pyx_tuple__1131); + + /* "talib/_func.pxi":10382 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1132 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1132)) __PYX_ERR(2, 10382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1132); + __Pyx_GIVEREF(__pyx_tuple__1132); + + /* "talib/_func.pxi":10384 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1133 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1133)) __PYX_ERR(2, 10384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1133); + __Pyx_GIVEREF(__pyx_tuple__1133); + + /* "talib/_func.pxi":10397 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) + */ + __pyx_tuple__1134 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1134)) __PYX_ERR(2, 10397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1134); + __Pyx_GIVEREF(__pyx_tuple__1134); + + /* "talib/_func.pxi":10434 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1135 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1135)) __PYX_ERR(2, 10434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1135); + __Pyx_GIVEREF(__pyx_tuple__1135); + + /* "talib/_func.pxi":10436 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1136 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1136)) __PYX_ERR(2, 10436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1136); + __Pyx_GIVEREF(__pyx_tuple__1136); + + /* "talib/_func.pxi":10449 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) + */ + __pyx_tuple__1137 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1137)) __PYX_ERR(2, 10449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1137); + __Pyx_GIVEREF(__pyx_tuple__1137); + + /* "talib/_func.pxi":10483 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1138 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1138)) __PYX_ERR(2, 10483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1138); + __Pyx_GIVEREF(__pyx_tuple__1138); + + /* "talib/_func.pxi":10485 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1139 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1139)) __PYX_ERR(2, 10485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1139); + __Pyx_GIVEREF(__pyx_tuple__1139); + + /* "talib/_func.pxi":10498 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TAN_Lookback( ) + */ + __pyx_tuple__1140 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1140)) __PYX_ERR(2, 10498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1140); + __Pyx_GIVEREF(__pyx_tuple__1140); + + /* "talib/_func.pxi":10532 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1141 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1141)) __PYX_ERR(2, 10532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1141); + __Pyx_GIVEREF(__pyx_tuple__1141); + + /* "talib/_func.pxi":10534 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1142 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1142)) __PYX_ERR(2, 10534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1142); + __Pyx_GIVEREF(__pyx_tuple__1142); + + /* "talib/_func.pxi":10547 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TANH_Lookback( ) + */ + __pyx_tuple__1143 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1143)) __PYX_ERR(2, 10547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1143); + __Pyx_GIVEREF(__pyx_tuple__1143); + + /* "talib/_func.pxi":10583 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1144 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1144)) __PYX_ERR(2, 10583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1144); + __Pyx_GIVEREF(__pyx_tuple__1144); + + /* "talib/_func.pxi":10585 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1145 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1145)) __PYX_ERR(2, 10585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1145); + __Pyx_GIVEREF(__pyx_tuple__1145); + + /* "talib/_func.pxi":10598 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) + */ + __pyx_tuple__1146 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1146)) __PYX_ERR(2, 10598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1146); + __Pyx_GIVEREF(__pyx_tuple__1146); + + /* "talib/_func.pxi":10634 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1147 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1147)) __PYX_ERR(2, 10634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1147); + __Pyx_GIVEREF(__pyx_tuple__1147); + + /* "talib/_func.pxi":10636 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1148 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1148)) __PYX_ERR(2, 10636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1148); + __Pyx_GIVEREF(__pyx_tuple__1148); + + /* "talib/_func.pxi":10641 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1149 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1149)) __PYX_ERR(2, 10641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1149); + __Pyx_GIVEREF(__pyx_tuple__1149); + + /* "talib/_func.pxi":10643 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1150 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1150)) __PYX_ERR(2, 10643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1150); + __Pyx_GIVEREF(__pyx_tuple__1150); + + /* "talib/_func.pxi":10648 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1151 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1151)) __PYX_ERR(2, 10648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1151); + __Pyx_GIVEREF(__pyx_tuple__1151); + + /* "talib/_func.pxi":10650 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1152 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1152)) __PYX_ERR(2, 10650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1152); + __Pyx_GIVEREF(__pyx_tuple__1152); + + /* "talib/_func.pxi":10656 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1153 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1153)) __PYX_ERR(2, 10656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1153); + __Pyx_GIVEREF(__pyx_tuple__1153); + + /* "talib/_func.pxi":10658 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1154 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1154)) __PYX_ERR(2, 10658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1154); + __Pyx_GIVEREF(__pyx_tuple__1154); + + /* "talib/_func.pxi":10673 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRANGE_Lookback( ) + */ + __pyx_tuple__1155 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1155)) __PYX_ERR(2, 10673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1155); + __Pyx_GIVEREF(__pyx_tuple__1155); + + /* "talib/_func.pxi":10709 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1156 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1156)) __PYX_ERR(2, 10709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1156); + __Pyx_GIVEREF(__pyx_tuple__1156); + + /* "talib/_func.pxi":10711 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1157 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1157)) __PYX_ERR(2, 10711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1157); + __Pyx_GIVEREF(__pyx_tuple__1157); + + /* "talib/_func.pxi":10724 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) + */ + __pyx_tuple__1158 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1158)) __PYX_ERR(2, 10724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1158); + __Pyx_GIVEREF(__pyx_tuple__1158); + + /* "talib/_func.pxi":10760 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1159 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1159)) __PYX_ERR(2, 10760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1159); + __Pyx_GIVEREF(__pyx_tuple__1159); + + /* "talib/_func.pxi":10762 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1160 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1160)) __PYX_ERR(2, 10762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1160); + __Pyx_GIVEREF(__pyx_tuple__1160); + + /* "talib/_func.pxi":10775 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) + */ + __pyx_tuple__1161 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1161)) __PYX_ERR(2, 10775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1161); + __Pyx_GIVEREF(__pyx_tuple__1161); + + /* "talib/_func.pxi":10811 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1162 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1162)) __PYX_ERR(2, 10811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1162); + __Pyx_GIVEREF(__pyx_tuple__1162); + + /* "talib/_func.pxi":10813 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1163 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1163)) __PYX_ERR(2, 10813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1163); + __Pyx_GIVEREF(__pyx_tuple__1163); + + /* "talib/_func.pxi":10826 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) + */ + __pyx_tuple__1164 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1164)) __PYX_ERR(2, 10826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1164); + __Pyx_GIVEREF(__pyx_tuple__1164); + + /* "talib/_func.pxi":10862 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1165 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1165)) __PYX_ERR(2, 10862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1165); + __Pyx_GIVEREF(__pyx_tuple__1165); + + /* "talib/_func.pxi":10864 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1166 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1166)) __PYX_ERR(2, 10864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1166); + __Pyx_GIVEREF(__pyx_tuple__1166); + + /* "talib/_func.pxi":10869 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1167 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1167)) __PYX_ERR(2, 10869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1167); + __Pyx_GIVEREF(__pyx_tuple__1167); + + /* "talib/_func.pxi":10871 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1168 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1168)) __PYX_ERR(2, 10871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1168); + __Pyx_GIVEREF(__pyx_tuple__1168); + + /* "talib/_func.pxi":10876 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1169 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1169)) __PYX_ERR(2, 10876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1169); + __Pyx_GIVEREF(__pyx_tuple__1169); + + /* "talib/_func.pxi":10878 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1170 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1170)) __PYX_ERR(2, 10878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1170); + __Pyx_GIVEREF(__pyx_tuple__1170); + + /* "talib/_func.pxi":10884 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1171 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1171)) __PYX_ERR(2, 10884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1171); + __Pyx_GIVEREF(__pyx_tuple__1171); + + /* "talib/_func.pxi":10886 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1172 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1172)) __PYX_ERR(2, 10886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1172); + __Pyx_GIVEREF(__pyx_tuple__1172); + + /* "talib/_func.pxi":10901 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) + */ + __pyx_tuple__1173 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1173)) __PYX_ERR(2, 10901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1173); + __Pyx_GIVEREF(__pyx_tuple__1173); + + /* "talib/_func.pxi":10941 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1174 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1174)) __PYX_ERR(2, 10941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1174); + __Pyx_GIVEREF(__pyx_tuple__1174); + + /* "talib/_func.pxi":10943 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1175 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1175)) __PYX_ERR(2, 10943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1175); + __Pyx_GIVEREF(__pyx_tuple__1175); + + /* "talib/_func.pxi":10948 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1176 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1176)) __PYX_ERR(2, 10948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1176); + __Pyx_GIVEREF(__pyx_tuple__1176); + + /* "talib/_func.pxi":10950 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1177 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1177)) __PYX_ERR(2, 10950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1177); + __Pyx_GIVEREF(__pyx_tuple__1177); + + /* "talib/_func.pxi":10955 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1178 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1178)) __PYX_ERR(2, 10955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1178); + __Pyx_GIVEREF(__pyx_tuple__1178); + + /* "talib/_func.pxi":10957 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1179 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1179)) __PYX_ERR(2, 10957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1179); + __Pyx_GIVEREF(__pyx_tuple__1179); + + /* "talib/_func.pxi":10963 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1180 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1180)) __PYX_ERR(2, 10963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1180); + __Pyx_GIVEREF(__pyx_tuple__1180); + + /* "talib/_func.pxi":10965 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1181 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1181)) __PYX_ERR(2, 10965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1181); + __Pyx_GIVEREF(__pyx_tuple__1181); + + /* "talib/_func.pxi":10980 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) + */ + __pyx_tuple__1182 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1182)) __PYX_ERR(2, 10980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1182); + __Pyx_GIVEREF(__pyx_tuple__1182); + + /* "talib/_func.pxi":11017 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1183 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1183)) __PYX_ERR(2, 11017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1183); + __Pyx_GIVEREF(__pyx_tuple__1183); + + /* "talib/_func.pxi":11019 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1184 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1184)) __PYX_ERR(2, 11019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1184); + __Pyx_GIVEREF(__pyx_tuple__1184); + + /* "talib/_func.pxi":11032 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) + */ + __pyx_tuple__1185 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1185)) __PYX_ERR(2, 11032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1185); + __Pyx_GIVEREF(__pyx_tuple__1185); + + /* "talib/_func.pxi":11068 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1186 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1186)) __PYX_ERR(2, 11068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1186); + __Pyx_GIVEREF(__pyx_tuple__1186); + + /* "talib/_func.pxi":11070 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1187 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1187)) __PYX_ERR(2, 11070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1187); + __Pyx_GIVEREF(__pyx_tuple__1187); + + /* "talib/_func.pxi":11075 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1188 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1188)) __PYX_ERR(2, 11075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1188); + __Pyx_GIVEREF(__pyx_tuple__1188); + + /* "talib/_func.pxi":11077 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1189 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1189)) __PYX_ERR(2, 11077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1189); + __Pyx_GIVEREF(__pyx_tuple__1189); + + /* "talib/_func.pxi":11082 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1190 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1190)) __PYX_ERR(2, 11082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1190); + __Pyx_GIVEREF(__pyx_tuple__1190); + + /* "talib/_func.pxi":11084 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1191 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1191)) __PYX_ERR(2, 11084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1191); + __Pyx_GIVEREF(__pyx_tuple__1191); + + /* "talib/_func.pxi":11090 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1192 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1192)) __PYX_ERR(2, 11090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1192); + __Pyx_GIVEREF(__pyx_tuple__1192); + + /* "talib/_func.pxi":11092 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1193 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1193)) __PYX_ERR(2, 11092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1193); + __Pyx_GIVEREF(__pyx_tuple__1193); + + /* "talib/_func.pxi":11107 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) + */ + __pyx_tuple__1194 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1194)) __PYX_ERR(2, 11107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1194); + __Pyx_GIVEREF(__pyx_tuple__1194); + + /* "talib/_func.pxi":11145 + * double* outreal_data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1195 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1195)) __PYX_ERR(2, 11145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1195); + __Pyx_GIVEREF(__pyx_tuple__1195); + + /* "talib/_func.pxi":11147 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1196 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1196)) __PYX_ERR(2, 11147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1196); + __Pyx_GIVEREF(__pyx_tuple__1196); + + /* "talib/_func.pxi":11152 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1197 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1197)) __PYX_ERR(2, 11152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1197); + __Pyx_GIVEREF(__pyx_tuple__1197); + + /* "talib/_func.pxi":11154 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1198 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1198)) __PYX_ERR(2, 11154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1198); + __Pyx_GIVEREF(__pyx_tuple__1198); + + /* "talib/_func.pxi":11159 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1199 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1199)) __PYX_ERR(2, 11159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1199); + __Pyx_GIVEREF(__pyx_tuple__1199); + + /* "talib/_func.pxi":11161 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1200 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1200)) __PYX_ERR(2, 11161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1200); + __Pyx_GIVEREF(__pyx_tuple__1200); + + /* "talib/_func.pxi":11167 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1201 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1201)) __PYX_ERR(2, 11167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1201); + __Pyx_GIVEREF(__pyx_tuple__1201); + + /* "talib/_func.pxi":11169 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * begidx = 0 + * for i from 0 <= i < length: + */ + __pyx_tuple__1202 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1202)) __PYX_ERR(2, 11169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1202); + __Pyx_GIVEREF(__pyx_tuple__1202); + + /* "talib/_func.pxi":11184 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) + */ + __pyx_tuple__1203 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1203)) __PYX_ERR(2, 11184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1203); + __Pyx_GIVEREF(__pyx_tuple__1203); + + /* "talib/_func.pxi":11220 + * double* outreal_data + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1204 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1204)) __PYX_ERR(2, 11220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1204); + __Pyx_GIVEREF(__pyx_tuple__1204); + + /* "talib/_func.pxi":11222 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1205 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1205)) __PYX_ERR(2, 11222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1205); + __Pyx_GIVEREF(__pyx_tuple__1205); + + /* "talib/_func.pxi":11235 + * break + * else: + * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< + * endidx = length - begidx - 1 + * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) + */ + __pyx_tuple__1206 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1206)) __PYX_ERR(2, 11235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1206); + __Pyx_GIVEREF(__pyx_tuple__1206); + + /* "talib/_abstract.pxi":51 + * + * def bytes2str(b): + * return b.decode('ascii') # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_tuple__1207 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__1207)) __PYX_ERR(1, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1207); + __Pyx_GIVEREF(__pyx_tuple__1207); + + /* "talib/_abstract.pxi":114 + * + * # inputs (price series names) + * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getInputParameterInfo(self.__name, i) + * input_name = info['name'] + */ + __pyx_tuple__1208 = PyTuple_Pack(1, __pyx_n_s_num_inputs); if (unlikely(!__pyx_tuple__1208)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1208); + __Pyx_GIVEREF(__pyx_tuple__1208); + + /* "talib/_abstract.pxi":123 + * + * # optional inputs (function parameters) + * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< + * info = _ta_getOptInputParameterInfo(self.__name, i) + * param_name = info['name'] + */ + __pyx_tuple__1209 = PyTuple_Pack(1, __pyx_n_s_num_opt_inputs); if (unlikely(!__pyx_tuple__1209)) __PYX_ERR(1, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1209); + __Pyx_GIVEREF(__pyx_tuple__1209); + + /* "talib/_abstract.pxi":131 + * # outputs + * self.__info['output_flags'] = OrderedDict() + * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< + * info = _ta_getOutputParameterInfo(self.__name, i) + * output_name = info['name'] + */ + __pyx_tuple__1210 = PyTuple_Pack(1, __pyx_n_s_num_outputs); if (unlikely(!__pyx_tuple__1210)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1210); + __Pyx_GIVEREF(__pyx_tuple__1210); + + /* "talib/_abstract.pxi":539 + * name = name[len('in'):].lower() + * if 'real' in name: + * name = name.replace('real', 'price') # <<<<<<<<<<<<<< + * elif 'price' in name: + * name = 'prices' + */ + __pyx_tuple__1213 = PyTuple_Pack(2, __pyx_n_s_real, __pyx_n_s_price); if (unlikely(!__pyx_tuple__1213)) __PYX_ERR(1, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1213); + __Pyx_GIVEREF(__pyx_tuple__1213); + + /* "talib/_stream.pxi":30 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1218 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1218)) __PYX_ERR(3, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1218); + __Pyx_GIVEREF(__pyx_tuple__1218); + + /* "talib/_stream.pxi":32 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1219 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1219)) __PYX_ERR(3, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1219); + __Pyx_GIVEREF(__pyx_tuple__1219); + + /* "talib/_stream.pxi":67 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1220 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1220)) __PYX_ERR(3, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1220); + __Pyx_GIVEREF(__pyx_tuple__1220); + + /* "talib/_stream.pxi":69 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1221 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1221)) __PYX_ERR(3, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1221); + __Pyx_GIVEREF(__pyx_tuple__1221); + + /* "talib/_stream.pxi":74 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1222 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1222)) __PYX_ERR(3, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1222); + __Pyx_GIVEREF(__pyx_tuple__1222); + + /* "talib/_stream.pxi":76 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1223 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1223)) __PYX_ERR(3, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1223); + __Pyx_GIVEREF(__pyx_tuple__1223); + + /* "talib/_stream.pxi":81 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1224 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1224)) __PYX_ERR(3, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1224); + __Pyx_GIVEREF(__pyx_tuple__1224); + + /* "talib/_stream.pxi":83 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1225 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1225)) __PYX_ERR(3, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1225); + __Pyx_GIVEREF(__pyx_tuple__1225); + + /* "talib/_stream.pxi":88 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__1226 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__1226)) __PYX_ERR(3, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1226); + __Pyx_GIVEREF(__pyx_tuple__1226); + + /* "talib/_stream.pxi":90 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__1227 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1227)) __PYX_ERR(3, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1227); + __Pyx_GIVEREF(__pyx_tuple__1227); + + /* "talib/_stream.pxi":96 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1228 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1228)) __PYX_ERR(3, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1228); + __Pyx_GIVEREF(__pyx_tuple__1228); + + /* "talib/_stream.pxi":98 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1229 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1229)) __PYX_ERR(3, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1229); + __Pyx_GIVEREF(__pyx_tuple__1229); + + /* "talib/_stream.pxi":100 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1230 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1230)) __PYX_ERR(3, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1230); + __Pyx_GIVEREF(__pyx_tuple__1230); + + /* "talib/_stream.pxi":130 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__1231 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1231)) __PYX_ERR(3, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1231); + __Pyx_GIVEREF(__pyx_tuple__1231); + + /* "talib/_stream.pxi":132 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__1232 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1232)) __PYX_ERR(3, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1232); + __Pyx_GIVEREF(__pyx_tuple__1232); + + /* "talib/_stream.pxi":137 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__1233 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1233)) __PYX_ERR(3, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1233); + __Pyx_GIVEREF(__pyx_tuple__1233); + + /* "talib/_stream.pxi":139 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__1234 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1234)) __PYX_ERR(3, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1234); + __Pyx_GIVEREF(__pyx_tuple__1234); + + /* "talib/_stream.pxi":145 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1235 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1235)) __PYX_ERR(3, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1235); + __Pyx_GIVEREF(__pyx_tuple__1235); + + /* "talib/_stream.pxi":179 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1236 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1236)) __PYX_ERR(3, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1236); + __Pyx_GIVEREF(__pyx_tuple__1236); + + /* "talib/_stream.pxi":181 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1237 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1237)) __PYX_ERR(3, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1237); + __Pyx_GIVEREF(__pyx_tuple__1237); + + /* "talib/_stream.pxi":186 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1238 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1238)) __PYX_ERR(3, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1238); + __Pyx_GIVEREF(__pyx_tuple__1238); + + /* "talib/_stream.pxi":188 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1239 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1239)) __PYX_ERR(3, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1239); + __Pyx_GIVEREF(__pyx_tuple__1239); + + /* "talib/_stream.pxi":193 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1240 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1240)) __PYX_ERR(3, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1240); + __Pyx_GIVEREF(__pyx_tuple__1240); + + /* "talib/_stream.pxi":195 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1241 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1241)) __PYX_ERR(3, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1241); + __Pyx_GIVEREF(__pyx_tuple__1241); + + /* "talib/_stream.pxi":200 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__1242 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__1242)) __PYX_ERR(3, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1242); + __Pyx_GIVEREF(__pyx_tuple__1242); + + /* "talib/_stream.pxi":202 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__1243 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1243)) __PYX_ERR(3, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1243); + __Pyx_GIVEREF(__pyx_tuple__1243); + + /* "talib/_stream.pxi":208 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1244 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1244)) __PYX_ERR(3, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1244); + __Pyx_GIVEREF(__pyx_tuple__1244); + + /* "talib/_stream.pxi":210 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1245 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1245)) __PYX_ERR(3, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1245); + __Pyx_GIVEREF(__pyx_tuple__1245); + + /* "talib/_stream.pxi":212 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1246 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1246)) __PYX_ERR(3, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1246); + __Pyx_GIVEREF(__pyx_tuple__1246); + + /* "talib/_stream.pxi":244 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1247 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1247)) __PYX_ERR(3, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1247); + __Pyx_GIVEREF(__pyx_tuple__1247); + + /* "talib/_stream.pxi":246 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1248 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1248)) __PYX_ERR(3, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1248); + __Pyx_GIVEREF(__pyx_tuple__1248); + + /* "talib/_stream.pxi":251 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1249 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1249)) __PYX_ERR(3, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1249); + __Pyx_GIVEREF(__pyx_tuple__1249); + + /* "talib/_stream.pxi":253 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1250 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1250)) __PYX_ERR(3, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1250); + __Pyx_GIVEREF(__pyx_tuple__1250); + + /* "talib/_stream.pxi":258 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1251 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1251)) __PYX_ERR(3, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1251); + __Pyx_GIVEREF(__pyx_tuple__1251); + + /* "talib/_stream.pxi":260 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1252 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1252)) __PYX_ERR(3, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1252); + __Pyx_GIVEREF(__pyx_tuple__1252); + + /* "talib/_stream.pxi":266 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1253 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1253)) __PYX_ERR(3, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1253); + __Pyx_GIVEREF(__pyx_tuple__1253); + + /* "talib/_stream.pxi":268 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1254 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1254)) __PYX_ERR(3, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1254); + __Pyx_GIVEREF(__pyx_tuple__1254); + + /* "talib/_stream.pxi":300 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1255 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1255)) __PYX_ERR(3, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1255); + __Pyx_GIVEREF(__pyx_tuple__1255); + + /* "talib/_stream.pxi":302 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1256 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1256)) __PYX_ERR(3, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1256); + __Pyx_GIVEREF(__pyx_tuple__1256); + + /* "talib/_stream.pxi":307 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1257 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1257)) __PYX_ERR(3, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1257); + __Pyx_GIVEREF(__pyx_tuple__1257); + + /* "talib/_stream.pxi":309 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1258 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1258)) __PYX_ERR(3, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1258); + __Pyx_GIVEREF(__pyx_tuple__1258); + + /* "talib/_stream.pxi":314 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1259 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1259)) __PYX_ERR(3, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1259); + __Pyx_GIVEREF(__pyx_tuple__1259); + + /* "talib/_stream.pxi":316 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1260 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1260)) __PYX_ERR(3, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1260); + __Pyx_GIVEREF(__pyx_tuple__1260); + + /* "talib/_stream.pxi":322 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1261 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1261)) __PYX_ERR(3, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1261); + __Pyx_GIVEREF(__pyx_tuple__1261); + + /* "talib/_stream.pxi":324 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1262 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1262)) __PYX_ERR(3, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1262); + __Pyx_GIVEREF(__pyx_tuple__1262); + + /* "talib/_stream.pxi":356 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1263 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1263)) __PYX_ERR(3, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1263); + __Pyx_GIVEREF(__pyx_tuple__1263); + + /* "talib/_stream.pxi":358 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1264 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1264)) __PYX_ERR(3, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1264); + __Pyx_GIVEREF(__pyx_tuple__1264); + + /* "talib/_stream.pxi":395 + * double outaroonup + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1265 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1265)) __PYX_ERR(3, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1265); + __Pyx_GIVEREF(__pyx_tuple__1265); + + /* "talib/_stream.pxi":397 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1266 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1266)) __PYX_ERR(3, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1266); + __Pyx_GIVEREF(__pyx_tuple__1266); + + /* "talib/_stream.pxi":402 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1267 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1267)) __PYX_ERR(3, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1267); + __Pyx_GIVEREF(__pyx_tuple__1267); + + /* "talib/_stream.pxi":404 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1268 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1268)) __PYX_ERR(3, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1268); + __Pyx_GIVEREF(__pyx_tuple__1268); + + /* "talib/_stream.pxi":410 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outaroondown = NaN + * outaroonup = NaN + */ + __pyx_tuple__1269 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1269)) __PYX_ERR(3, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1269); + __Pyx_GIVEREF(__pyx_tuple__1269); + + /* "talib/_stream.pxi":442 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1270 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1270)) __PYX_ERR(3, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1270); + __Pyx_GIVEREF(__pyx_tuple__1270); + + /* "talib/_stream.pxi":444 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1271 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1271)) __PYX_ERR(3, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1271); + __Pyx_GIVEREF(__pyx_tuple__1271); + + /* "talib/_stream.pxi":449 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1272 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1272)) __PYX_ERR(3, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1272); + __Pyx_GIVEREF(__pyx_tuple__1272); + + /* "talib/_stream.pxi":451 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1273 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1273)) __PYX_ERR(3, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1273); + __Pyx_GIVEREF(__pyx_tuple__1273); + + /* "talib/_stream.pxi":457 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1274 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1274)) __PYX_ERR(3, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1274); + __Pyx_GIVEREF(__pyx_tuple__1274); + + /* "talib/_stream.pxi":485 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1275 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1275)) __PYX_ERR(3, 485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1275); + __Pyx_GIVEREF(__pyx_tuple__1275); + + /* "talib/_stream.pxi":487 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1276 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1276)) __PYX_ERR(3, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1276); + __Pyx_GIVEREF(__pyx_tuple__1276); + + /* "talib/_stream.pxi":519 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1277 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1277)) __PYX_ERR(3, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1277); + __Pyx_GIVEREF(__pyx_tuple__1277); + + /* "talib/_stream.pxi":521 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1278 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1278)) __PYX_ERR(3, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1278); + __Pyx_GIVEREF(__pyx_tuple__1278); + + /* "talib/_stream.pxi":557 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1279 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1279)) __PYX_ERR(3, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1279); + __Pyx_GIVEREF(__pyx_tuple__1279); + + /* "talib/_stream.pxi":559 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1280 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1280)) __PYX_ERR(3, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1280); + __Pyx_GIVEREF(__pyx_tuple__1280); + + /* "talib/_stream.pxi":564 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1281 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1281)) __PYX_ERR(3, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1281); + __Pyx_GIVEREF(__pyx_tuple__1281); + + /* "talib/_stream.pxi":566 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1282 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1282)) __PYX_ERR(3, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1282); + __Pyx_GIVEREF(__pyx_tuple__1282); + + /* "talib/_stream.pxi":571 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1283 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1283)) __PYX_ERR(3, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1283); + __Pyx_GIVEREF(__pyx_tuple__1283); + + /* "talib/_stream.pxi":573 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1284 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1284)) __PYX_ERR(3, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1284); + __Pyx_GIVEREF(__pyx_tuple__1284); + + /* "talib/_stream.pxi":579 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1285 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1285)) __PYX_ERR(3, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1285); + __Pyx_GIVEREF(__pyx_tuple__1285); + + /* "talib/_stream.pxi":581 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1286 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1286)) __PYX_ERR(3, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1286); + __Pyx_GIVEREF(__pyx_tuple__1286); + + /* "talib/_stream.pxi":612 + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1287 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1287)) __PYX_ERR(3, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1287); + __Pyx_GIVEREF(__pyx_tuple__1287); + + /* "talib/_stream.pxi":614 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1288 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1288)) __PYX_ERR(3, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1288); + __Pyx_GIVEREF(__pyx_tuple__1288); + + /* "talib/_stream.pxi":619 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1289 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1289)) __PYX_ERR(3, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1289); + __Pyx_GIVEREF(__pyx_tuple__1289); + + /* "talib/_stream.pxi":621 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1290 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1290)) __PYX_ERR(3, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1290); + __Pyx_GIVEREF(__pyx_tuple__1290); + + /* "talib/_stream.pxi":626 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1291 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1291)) __PYX_ERR(3, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1291); + __Pyx_GIVEREF(__pyx_tuple__1291); + + /* "talib/_stream.pxi":628 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1292 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1292)) __PYX_ERR(3, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1292); + __Pyx_GIVEREF(__pyx_tuple__1292); + + /* "talib/_stream.pxi":633 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1293 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1293)) __PYX_ERR(3, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1293); + __Pyx_GIVEREF(__pyx_tuple__1293); + + /* "talib/_stream.pxi":635 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1294 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1294)) __PYX_ERR(3, 635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1294); + __Pyx_GIVEREF(__pyx_tuple__1294); + + /* "talib/_stream.pxi":641 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1295 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1295)) __PYX_ERR(3, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1295); + __Pyx_GIVEREF(__pyx_tuple__1295); + + /* "talib/_stream.pxi":643 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1296 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1296)) __PYX_ERR(3, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1296); + __Pyx_GIVEREF(__pyx_tuple__1296); + + /* "talib/_stream.pxi":645 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1297 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1297)) __PYX_ERR(3, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1297); + __Pyx_GIVEREF(__pyx_tuple__1297); + + /* "talib/_stream.pxi":682 + * double outreallowerband + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1298 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1298)) __PYX_ERR(3, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1298); + __Pyx_GIVEREF(__pyx_tuple__1298); + + /* "talib/_stream.pxi":684 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1299 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1299)) __PYX_ERR(3, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1299); + __Pyx_GIVEREF(__pyx_tuple__1299); + + /* "talib/_stream.pxi":722 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__1300 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1300)) __PYX_ERR(3, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1300); + __Pyx_GIVEREF(__pyx_tuple__1300); + + /* "talib/_stream.pxi":724 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__1301 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1301)) __PYX_ERR(3, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1301); + __Pyx_GIVEREF(__pyx_tuple__1301); + + /* "talib/_stream.pxi":729 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__1302 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1302)) __PYX_ERR(3, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1302); + __Pyx_GIVEREF(__pyx_tuple__1302); + + /* "talib/_stream.pxi":731 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__1303 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1303)) __PYX_ERR(3, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1303); + __Pyx_GIVEREF(__pyx_tuple__1303); + + /* "talib/_stream.pxi":737 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1304 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1304)) __PYX_ERR(3, 737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1304); + __Pyx_GIVEREF(__pyx_tuple__1304); + + /* "talib/_stream.pxi":768 + * double outreal + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1305 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1305)) __PYX_ERR(3, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1305); + __Pyx_GIVEREF(__pyx_tuple__1305); + + /* "talib/_stream.pxi":770 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1306 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1306)) __PYX_ERR(3, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1306); + __Pyx_GIVEREF(__pyx_tuple__1306); + + /* "talib/_stream.pxi":775 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1307 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1307)) __PYX_ERR(3, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1307); + __Pyx_GIVEREF(__pyx_tuple__1307); + + /* "talib/_stream.pxi":777 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1308 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1308)) __PYX_ERR(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1308); + __Pyx_GIVEREF(__pyx_tuple__1308); + + /* "talib/_stream.pxi":782 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1309 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1309)) __PYX_ERR(3, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1309); + __Pyx_GIVEREF(__pyx_tuple__1309); + + /* "talib/_stream.pxi":784 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1310 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1310)) __PYX_ERR(3, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1310); + __Pyx_GIVEREF(__pyx_tuple__1310); + + /* "talib/_stream.pxi":789 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1311 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1311)) __PYX_ERR(3, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1311); + __Pyx_GIVEREF(__pyx_tuple__1311); + + /* "talib/_stream.pxi":791 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1312 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1312)) __PYX_ERR(3, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1312); + __Pyx_GIVEREF(__pyx_tuple__1312); + + /* "talib/_stream.pxi":797 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1313 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1313)) __PYX_ERR(3, 797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1313); + __Pyx_GIVEREF(__pyx_tuple__1313); + + /* "talib/_stream.pxi":799 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1314 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1314)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1314); + __Pyx_GIVEREF(__pyx_tuple__1314); + + /* "talib/_stream.pxi":801 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1315 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1315)) __PYX_ERR(3, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1315); + __Pyx_GIVEREF(__pyx_tuple__1315); + + /* "talib/_stream.pxi":833 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1316 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1316)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1316); + __Pyx_GIVEREF(__pyx_tuple__1316); + + /* "talib/_stream.pxi":835 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1317 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1317)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1317); + __Pyx_GIVEREF(__pyx_tuple__1317); + + /* "talib/_stream.pxi":840 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1318 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1318)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1318); + __Pyx_GIVEREF(__pyx_tuple__1318); + + /* "talib/_stream.pxi":842 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1319 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1319)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1319); + __Pyx_GIVEREF(__pyx_tuple__1319); + + /* "talib/_stream.pxi":847 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1320 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1320)) __PYX_ERR(3, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1320); + __Pyx_GIVEREF(__pyx_tuple__1320); + + /* "talib/_stream.pxi":849 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1321 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1321)) __PYX_ERR(3, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1321); + __Pyx_GIVEREF(__pyx_tuple__1321); + + /* "talib/_stream.pxi":855 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1322 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1322)) __PYX_ERR(3, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1322); + __Pyx_GIVEREF(__pyx_tuple__1322); + + /* "talib/_stream.pxi":857 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__1323 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1323)) __PYX_ERR(3, 857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1323); + __Pyx_GIVEREF(__pyx_tuple__1323); + + /* "talib/_stream.pxi":888 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1324 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1324)) __PYX_ERR(3, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1324); + __Pyx_GIVEREF(__pyx_tuple__1324); + + /* "talib/_stream.pxi":890 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1325 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1325)) __PYX_ERR(3, 890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1325); + __Pyx_GIVEREF(__pyx_tuple__1325); + + /* "talib/_stream.pxi":895 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1326 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1326)) __PYX_ERR(3, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1326); + __Pyx_GIVEREF(__pyx_tuple__1326); + + /* "talib/_stream.pxi":897 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1327 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1327)) __PYX_ERR(3, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1327); + __Pyx_GIVEREF(__pyx_tuple__1327); + + /* "talib/_stream.pxi":902 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1328 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1328)) __PYX_ERR(3, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1328); + __Pyx_GIVEREF(__pyx_tuple__1328); + + /* "talib/_stream.pxi":904 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1329 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1329)) __PYX_ERR(3, 904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1329); + __Pyx_GIVEREF(__pyx_tuple__1329); + + /* "talib/_stream.pxi":909 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1330 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1330)) __PYX_ERR(3, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1330); + __Pyx_GIVEREF(__pyx_tuple__1330); + + /* "talib/_stream.pxi":911 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1331 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1331)) __PYX_ERR(3, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1331); + __Pyx_GIVEREF(__pyx_tuple__1331); + + /* "talib/_stream.pxi":917 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1332 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1332)) __PYX_ERR(3, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1332); + __Pyx_GIVEREF(__pyx_tuple__1332); + + /* "talib/_stream.pxi":919 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1333 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1333)) __PYX_ERR(3, 919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1333); + __Pyx_GIVEREF(__pyx_tuple__1333); + + /* "talib/_stream.pxi":921 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1334 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1334)) __PYX_ERR(3, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1334); + __Pyx_GIVEREF(__pyx_tuple__1334); + + /* "talib/_stream.pxi":952 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1335 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1335)) __PYX_ERR(3, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1335); + __Pyx_GIVEREF(__pyx_tuple__1335); + + /* "talib/_stream.pxi":954 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1336 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1336)) __PYX_ERR(3, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1336); + __Pyx_GIVEREF(__pyx_tuple__1336); + + /* "talib/_stream.pxi":959 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1337 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1337)) __PYX_ERR(3, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1337); + __Pyx_GIVEREF(__pyx_tuple__1337); + + /* "talib/_stream.pxi":961 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1338 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1338)) __PYX_ERR(3, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1338); + __Pyx_GIVEREF(__pyx_tuple__1338); + + /* "talib/_stream.pxi":966 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1339 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1339)) __PYX_ERR(3, 966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1339); + __Pyx_GIVEREF(__pyx_tuple__1339); + + /* "talib/_stream.pxi":968 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1340 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1340)) __PYX_ERR(3, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1340); + __Pyx_GIVEREF(__pyx_tuple__1340); + + /* "talib/_stream.pxi":973 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1341 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1341)) __PYX_ERR(3, 973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1341); + __Pyx_GIVEREF(__pyx_tuple__1341); + + /* "talib/_stream.pxi":975 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1342 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1342)) __PYX_ERR(3, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1342); + __Pyx_GIVEREF(__pyx_tuple__1342); + + /* "talib/_stream.pxi":981 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1343 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1343)) __PYX_ERR(3, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1343); + __Pyx_GIVEREF(__pyx_tuple__1343); + + /* "talib/_stream.pxi":983 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1344 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1344)) __PYX_ERR(3, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1344); + __Pyx_GIVEREF(__pyx_tuple__1344); + + /* "talib/_stream.pxi":985 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1345 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1345)) __PYX_ERR(3, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1345); + __Pyx_GIVEREF(__pyx_tuple__1345); + + /* "talib/_stream.pxi":1016 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1346 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1346)) __PYX_ERR(3, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1346); + __Pyx_GIVEREF(__pyx_tuple__1346); + + /* "talib/_stream.pxi":1018 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1347 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1347)) __PYX_ERR(3, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1347); + __Pyx_GIVEREF(__pyx_tuple__1347); + + /* "talib/_stream.pxi":1023 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1348 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1348)) __PYX_ERR(3, 1023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1348); + __Pyx_GIVEREF(__pyx_tuple__1348); + + /* "talib/_stream.pxi":1025 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1349 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1349)) __PYX_ERR(3, 1025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1349); + __Pyx_GIVEREF(__pyx_tuple__1349); + + /* "talib/_stream.pxi":1030 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1350 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1350)) __PYX_ERR(3, 1030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1350); + __Pyx_GIVEREF(__pyx_tuple__1350); + + /* "talib/_stream.pxi":1032 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1351 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1351)) __PYX_ERR(3, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1351); + __Pyx_GIVEREF(__pyx_tuple__1351); + + /* "talib/_stream.pxi":1037 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1352 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1352)) __PYX_ERR(3, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1352); + __Pyx_GIVEREF(__pyx_tuple__1352); + + /* "talib/_stream.pxi":1039 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1353 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1353)) __PYX_ERR(3, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1353); + __Pyx_GIVEREF(__pyx_tuple__1353); + + /* "talib/_stream.pxi":1045 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1354 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1354)) __PYX_ERR(3, 1045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1354); + __Pyx_GIVEREF(__pyx_tuple__1354); + + /* "talib/_stream.pxi":1047 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1355 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1355)) __PYX_ERR(3, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1355); + __Pyx_GIVEREF(__pyx_tuple__1355); + + /* "talib/_stream.pxi":1049 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1356 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1356)) __PYX_ERR(3, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1356); + __Pyx_GIVEREF(__pyx_tuple__1356); + + /* "talib/_stream.pxi":1080 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1357 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1357)) __PYX_ERR(3, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1357); + __Pyx_GIVEREF(__pyx_tuple__1357); + + /* "talib/_stream.pxi":1082 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1358 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1358)) __PYX_ERR(3, 1082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1358); + __Pyx_GIVEREF(__pyx_tuple__1358); + + /* "talib/_stream.pxi":1087 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1359 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1359)) __PYX_ERR(3, 1087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1359); + __Pyx_GIVEREF(__pyx_tuple__1359); + + /* "talib/_stream.pxi":1089 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1360 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1360)) __PYX_ERR(3, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1360); + __Pyx_GIVEREF(__pyx_tuple__1360); + + /* "talib/_stream.pxi":1094 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1361 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1361)) __PYX_ERR(3, 1094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1361); + __Pyx_GIVEREF(__pyx_tuple__1361); + + /* "talib/_stream.pxi":1096 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1362 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1362)) __PYX_ERR(3, 1096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1362); + __Pyx_GIVEREF(__pyx_tuple__1362); + + /* "talib/_stream.pxi":1101 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1363 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1363)) __PYX_ERR(3, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1363); + __Pyx_GIVEREF(__pyx_tuple__1363); + + /* "talib/_stream.pxi":1103 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1364 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1364)) __PYX_ERR(3, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1364); + __Pyx_GIVEREF(__pyx_tuple__1364); + + /* "talib/_stream.pxi":1109 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1365 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1365)) __PYX_ERR(3, 1109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1365); + __Pyx_GIVEREF(__pyx_tuple__1365); + + /* "talib/_stream.pxi":1111 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1366 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1366)) __PYX_ERR(3, 1111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1366); + __Pyx_GIVEREF(__pyx_tuple__1366); + + /* "talib/_stream.pxi":1113 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1367 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1367)) __PYX_ERR(3, 1113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1367); + __Pyx_GIVEREF(__pyx_tuple__1367); + + /* "talib/_stream.pxi":1144 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1368 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1368)) __PYX_ERR(3, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1368); + __Pyx_GIVEREF(__pyx_tuple__1368); + + /* "talib/_stream.pxi":1146 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1369 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1369)) __PYX_ERR(3, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1369); + __Pyx_GIVEREF(__pyx_tuple__1369); + + /* "talib/_stream.pxi":1151 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1370 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1370)) __PYX_ERR(3, 1151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1370); + __Pyx_GIVEREF(__pyx_tuple__1370); + + /* "talib/_stream.pxi":1153 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1371 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1371)) __PYX_ERR(3, 1153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1371); + __Pyx_GIVEREF(__pyx_tuple__1371); + + /* "talib/_stream.pxi":1158 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1372 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1372)) __PYX_ERR(3, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1372); + __Pyx_GIVEREF(__pyx_tuple__1372); + + /* "talib/_stream.pxi":1160 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1373 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1373)) __PYX_ERR(3, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1373); + __Pyx_GIVEREF(__pyx_tuple__1373); + + /* "talib/_stream.pxi":1165 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1374 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1374)) __PYX_ERR(3, 1165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1374); + __Pyx_GIVEREF(__pyx_tuple__1374); + + /* "talib/_stream.pxi":1167 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1375 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1375)) __PYX_ERR(3, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1375); + __Pyx_GIVEREF(__pyx_tuple__1375); + + /* "talib/_stream.pxi":1173 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1376 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1376)) __PYX_ERR(3, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1376); + __Pyx_GIVEREF(__pyx_tuple__1376); + + /* "talib/_stream.pxi":1175 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1377 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1377)) __PYX_ERR(3, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1377); + __Pyx_GIVEREF(__pyx_tuple__1377); + + /* "talib/_stream.pxi":1177 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1378 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1378)) __PYX_ERR(3, 1177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1378); + __Pyx_GIVEREF(__pyx_tuple__1378); + + /* "talib/_stream.pxi":1208 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1379 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1379)) __PYX_ERR(3, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1379); + __Pyx_GIVEREF(__pyx_tuple__1379); + + /* "talib/_stream.pxi":1210 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1380 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1380)) __PYX_ERR(3, 1210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1380); + __Pyx_GIVEREF(__pyx_tuple__1380); + + /* "talib/_stream.pxi":1215 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1381 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1381)) __PYX_ERR(3, 1215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1381); + __Pyx_GIVEREF(__pyx_tuple__1381); + + /* "talib/_stream.pxi":1217 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1382 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1382)) __PYX_ERR(3, 1217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1382); + __Pyx_GIVEREF(__pyx_tuple__1382); + + /* "talib/_stream.pxi":1222 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1383 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1383)) __PYX_ERR(3, 1222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1383); + __Pyx_GIVEREF(__pyx_tuple__1383); + + /* "talib/_stream.pxi":1224 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1384 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1384)) __PYX_ERR(3, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1384); + __Pyx_GIVEREF(__pyx_tuple__1384); + + /* "talib/_stream.pxi":1229 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1385 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1385)) __PYX_ERR(3, 1229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1385); + __Pyx_GIVEREF(__pyx_tuple__1385); + + /* "talib/_stream.pxi":1231 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1386 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1386)) __PYX_ERR(3, 1231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1386); + __Pyx_GIVEREF(__pyx_tuple__1386); + + /* "talib/_stream.pxi":1237 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1387 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1387)) __PYX_ERR(3, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1387); + __Pyx_GIVEREF(__pyx_tuple__1387); + + /* "talib/_stream.pxi":1239 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1388 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1388)) __PYX_ERR(3, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1388); + __Pyx_GIVEREF(__pyx_tuple__1388); + + /* "talib/_stream.pxi":1241 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1389 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1389)) __PYX_ERR(3, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1389); + __Pyx_GIVEREF(__pyx_tuple__1389); + + /* "talib/_stream.pxi":1272 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1390 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1390)) __PYX_ERR(3, 1272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1390); + __Pyx_GIVEREF(__pyx_tuple__1390); + + /* "talib/_stream.pxi":1274 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1391 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1391)) __PYX_ERR(3, 1274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1391); + __Pyx_GIVEREF(__pyx_tuple__1391); + + /* "talib/_stream.pxi":1279 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1392 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1392)) __PYX_ERR(3, 1279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1392); + __Pyx_GIVEREF(__pyx_tuple__1392); + + /* "talib/_stream.pxi":1281 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1393 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1393)) __PYX_ERR(3, 1281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1393); + __Pyx_GIVEREF(__pyx_tuple__1393); + + /* "talib/_stream.pxi":1286 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1394 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1394)) __PYX_ERR(3, 1286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1394); + __Pyx_GIVEREF(__pyx_tuple__1394); + + /* "talib/_stream.pxi":1288 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1395 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1395)) __PYX_ERR(3, 1288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1395); + __Pyx_GIVEREF(__pyx_tuple__1395); + + /* "talib/_stream.pxi":1293 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1396 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1396)) __PYX_ERR(3, 1293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1396); + __Pyx_GIVEREF(__pyx_tuple__1396); + + /* "talib/_stream.pxi":1295 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1397 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1397)) __PYX_ERR(3, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1397); + __Pyx_GIVEREF(__pyx_tuple__1397); + + /* "talib/_stream.pxi":1301 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1398 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1398)) __PYX_ERR(3, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1398); + __Pyx_GIVEREF(__pyx_tuple__1398); + + /* "talib/_stream.pxi":1303 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1399 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1399)) __PYX_ERR(3, 1303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1399); + __Pyx_GIVEREF(__pyx_tuple__1399); + + /* "talib/_stream.pxi":1305 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1400 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1400)) __PYX_ERR(3, 1305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1400); + __Pyx_GIVEREF(__pyx_tuple__1400); + + /* "talib/_stream.pxi":1338 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1401 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1401)) __PYX_ERR(3, 1338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1401); + __Pyx_GIVEREF(__pyx_tuple__1401); + + /* "talib/_stream.pxi":1340 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1402 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1402)) __PYX_ERR(3, 1340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1402); + __Pyx_GIVEREF(__pyx_tuple__1402); + + /* "talib/_stream.pxi":1345 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1403 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1403)) __PYX_ERR(3, 1345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1403); + __Pyx_GIVEREF(__pyx_tuple__1403); + + /* "talib/_stream.pxi":1347 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1404 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1404)) __PYX_ERR(3, 1347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1404); + __Pyx_GIVEREF(__pyx_tuple__1404); + + /* "talib/_stream.pxi":1352 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1405 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1405)) __PYX_ERR(3, 1352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1405); + __Pyx_GIVEREF(__pyx_tuple__1405); + + /* "talib/_stream.pxi":1354 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1406 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1406)) __PYX_ERR(3, 1354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1406); + __Pyx_GIVEREF(__pyx_tuple__1406); + + /* "talib/_stream.pxi":1359 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1407 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1407)) __PYX_ERR(3, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1407); + __Pyx_GIVEREF(__pyx_tuple__1407); + + /* "talib/_stream.pxi":1361 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1408 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1408)) __PYX_ERR(3, 1361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1408); + __Pyx_GIVEREF(__pyx_tuple__1408); + + /* "talib/_stream.pxi":1367 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1409 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1409)) __PYX_ERR(3, 1367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1409); + __Pyx_GIVEREF(__pyx_tuple__1409); + + /* "talib/_stream.pxi":1369 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1410 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1410)) __PYX_ERR(3, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1410); + __Pyx_GIVEREF(__pyx_tuple__1410); + + /* "talib/_stream.pxi":1371 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1411 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1411)) __PYX_ERR(3, 1371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1411); + __Pyx_GIVEREF(__pyx_tuple__1411); + + /* "talib/_stream.pxi":1402 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1412 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1412)) __PYX_ERR(3, 1402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1412); + __Pyx_GIVEREF(__pyx_tuple__1412); + + /* "talib/_stream.pxi":1404 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1413 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1413)) __PYX_ERR(3, 1404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1413); + __Pyx_GIVEREF(__pyx_tuple__1413); + + /* "talib/_stream.pxi":1409 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1414 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1414)) __PYX_ERR(3, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1414); + __Pyx_GIVEREF(__pyx_tuple__1414); + + /* "talib/_stream.pxi":1411 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1415 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1415)) __PYX_ERR(3, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1415); + __Pyx_GIVEREF(__pyx_tuple__1415); + + /* "talib/_stream.pxi":1416 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1416 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1416)) __PYX_ERR(3, 1416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1416); + __Pyx_GIVEREF(__pyx_tuple__1416); + + /* "talib/_stream.pxi":1418 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1417 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1417)) __PYX_ERR(3, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1417); + __Pyx_GIVEREF(__pyx_tuple__1417); + + /* "talib/_stream.pxi":1423 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1418 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1418)) __PYX_ERR(3, 1423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1418); + __Pyx_GIVEREF(__pyx_tuple__1418); + + /* "talib/_stream.pxi":1425 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1419 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1419)) __PYX_ERR(3, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1419); + __Pyx_GIVEREF(__pyx_tuple__1419); + + /* "talib/_stream.pxi":1431 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1420 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1420)) __PYX_ERR(3, 1431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1420); + __Pyx_GIVEREF(__pyx_tuple__1420); + + /* "talib/_stream.pxi":1433 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1421 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1421)) __PYX_ERR(3, 1433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1421); + __Pyx_GIVEREF(__pyx_tuple__1421); + + /* "talib/_stream.pxi":1435 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1422 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1422)) __PYX_ERR(3, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1422); + __Pyx_GIVEREF(__pyx_tuple__1422); + + /* "talib/_stream.pxi":1466 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1423 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1423)) __PYX_ERR(3, 1466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1423); + __Pyx_GIVEREF(__pyx_tuple__1423); + + /* "talib/_stream.pxi":1468 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1424 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1424)) __PYX_ERR(3, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1424); + __Pyx_GIVEREF(__pyx_tuple__1424); + + /* "talib/_stream.pxi":1473 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1425 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1425)) __PYX_ERR(3, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1425); + __Pyx_GIVEREF(__pyx_tuple__1425); + + /* "talib/_stream.pxi":1475 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1426 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1426)) __PYX_ERR(3, 1475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1426); + __Pyx_GIVEREF(__pyx_tuple__1426); + + /* "talib/_stream.pxi":1480 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1427 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1427)) __PYX_ERR(3, 1480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1427); + __Pyx_GIVEREF(__pyx_tuple__1427); + + /* "talib/_stream.pxi":1482 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1428 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1428)) __PYX_ERR(3, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1428); + __Pyx_GIVEREF(__pyx_tuple__1428); + + /* "talib/_stream.pxi":1487 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1429 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1429)) __PYX_ERR(3, 1487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1429); + __Pyx_GIVEREF(__pyx_tuple__1429); + + /* "talib/_stream.pxi":1489 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1430 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1430)) __PYX_ERR(3, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1430); + __Pyx_GIVEREF(__pyx_tuple__1430); + + /* "talib/_stream.pxi":1495 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1431 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1431)) __PYX_ERR(3, 1495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1431); + __Pyx_GIVEREF(__pyx_tuple__1431); + + /* "talib/_stream.pxi":1497 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1432 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1432)) __PYX_ERR(3, 1497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1432); + __Pyx_GIVEREF(__pyx_tuple__1432); + + /* "talib/_stream.pxi":1499 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1433 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1433)) __PYX_ERR(3, 1499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1433); + __Pyx_GIVEREF(__pyx_tuple__1433); + + /* "talib/_stream.pxi":1530 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1434 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1434)) __PYX_ERR(3, 1530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1434); + __Pyx_GIVEREF(__pyx_tuple__1434); + + /* "talib/_stream.pxi":1532 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1435 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1435)) __PYX_ERR(3, 1532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1435); + __Pyx_GIVEREF(__pyx_tuple__1435); + + /* "talib/_stream.pxi":1537 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1436 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1436)) __PYX_ERR(3, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1436); + __Pyx_GIVEREF(__pyx_tuple__1436); + + /* "talib/_stream.pxi":1539 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1437 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1437)) __PYX_ERR(3, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1437); + __Pyx_GIVEREF(__pyx_tuple__1437); + + /* "talib/_stream.pxi":1544 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1438 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1438)) __PYX_ERR(3, 1544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1438); + __Pyx_GIVEREF(__pyx_tuple__1438); + + /* "talib/_stream.pxi":1546 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1439 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1439)) __PYX_ERR(3, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1439); + __Pyx_GIVEREF(__pyx_tuple__1439); + + /* "talib/_stream.pxi":1551 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1440 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1440)) __PYX_ERR(3, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1440); + __Pyx_GIVEREF(__pyx_tuple__1440); + + /* "talib/_stream.pxi":1553 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1441 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1441)) __PYX_ERR(3, 1553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1441); + __Pyx_GIVEREF(__pyx_tuple__1441); + + /* "talib/_stream.pxi":1559 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1442 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1442)) __PYX_ERR(3, 1559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1442); + __Pyx_GIVEREF(__pyx_tuple__1442); + + /* "talib/_stream.pxi":1561 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1443 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1443)) __PYX_ERR(3, 1561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1443); + __Pyx_GIVEREF(__pyx_tuple__1443); + + /* "talib/_stream.pxi":1563 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1444 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1444)) __PYX_ERR(3, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1444); + __Pyx_GIVEREF(__pyx_tuple__1444); + + /* "talib/_stream.pxi":1594 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1445 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1445)) __PYX_ERR(3, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1445); + __Pyx_GIVEREF(__pyx_tuple__1445); + + /* "talib/_stream.pxi":1596 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1446 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1446)) __PYX_ERR(3, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1446); + __Pyx_GIVEREF(__pyx_tuple__1446); + + /* "talib/_stream.pxi":1601 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1447 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1447)) __PYX_ERR(3, 1601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1447); + __Pyx_GIVEREF(__pyx_tuple__1447); + + /* "talib/_stream.pxi":1603 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1448 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1448)) __PYX_ERR(3, 1603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1448); + __Pyx_GIVEREF(__pyx_tuple__1448); + + /* "talib/_stream.pxi":1608 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1449 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1449)) __PYX_ERR(3, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1449); + __Pyx_GIVEREF(__pyx_tuple__1449); + + /* "talib/_stream.pxi":1610 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1450 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1450)) __PYX_ERR(3, 1610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1450); + __Pyx_GIVEREF(__pyx_tuple__1450); + + /* "talib/_stream.pxi":1615 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1451 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1451)) __PYX_ERR(3, 1615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1451); + __Pyx_GIVEREF(__pyx_tuple__1451); + + /* "talib/_stream.pxi":1617 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1452 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1452)) __PYX_ERR(3, 1617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1452); + __Pyx_GIVEREF(__pyx_tuple__1452); + + /* "talib/_stream.pxi":1623 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1453 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1453)) __PYX_ERR(3, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1453); + __Pyx_GIVEREF(__pyx_tuple__1453); + + /* "talib/_stream.pxi":1625 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1454 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1454)) __PYX_ERR(3, 1625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1454); + __Pyx_GIVEREF(__pyx_tuple__1454); + + /* "talib/_stream.pxi":1627 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1455 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1455)) __PYX_ERR(3, 1627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1455); + __Pyx_GIVEREF(__pyx_tuple__1455); + + /* "talib/_stream.pxi":1658 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1456 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1456)) __PYX_ERR(3, 1658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1456); + __Pyx_GIVEREF(__pyx_tuple__1456); + + /* "talib/_stream.pxi":1660 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1457 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1457)) __PYX_ERR(3, 1660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1457); + __Pyx_GIVEREF(__pyx_tuple__1457); + + /* "talib/_stream.pxi":1665 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1458 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1458)) __PYX_ERR(3, 1665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1458); + __Pyx_GIVEREF(__pyx_tuple__1458); + + /* "talib/_stream.pxi":1667 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1459 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1459)) __PYX_ERR(3, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1459); + __Pyx_GIVEREF(__pyx_tuple__1459); + + /* "talib/_stream.pxi":1672 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1460 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1460)) __PYX_ERR(3, 1672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1460); + __Pyx_GIVEREF(__pyx_tuple__1460); + + /* "talib/_stream.pxi":1674 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1461 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1461)) __PYX_ERR(3, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1461); + __Pyx_GIVEREF(__pyx_tuple__1461); + + /* "talib/_stream.pxi":1679 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1462 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1462)) __PYX_ERR(3, 1679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1462); + __Pyx_GIVEREF(__pyx_tuple__1462); + + /* "talib/_stream.pxi":1681 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1463 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1463)) __PYX_ERR(3, 1681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1463); + __Pyx_GIVEREF(__pyx_tuple__1463); + + /* "talib/_stream.pxi":1687 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1464 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1464)) __PYX_ERR(3, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1464); + __Pyx_GIVEREF(__pyx_tuple__1464); + + /* "talib/_stream.pxi":1689 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1465 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1465)) __PYX_ERR(3, 1689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1465); + __Pyx_GIVEREF(__pyx_tuple__1465); + + /* "talib/_stream.pxi":1691 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1466 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1466)) __PYX_ERR(3, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1466); + __Pyx_GIVEREF(__pyx_tuple__1466); + + /* "talib/_stream.pxi":1722 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1467 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1467)) __PYX_ERR(3, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1467); + __Pyx_GIVEREF(__pyx_tuple__1467); + + /* "talib/_stream.pxi":1724 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1468 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1468)) __PYX_ERR(3, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1468); + __Pyx_GIVEREF(__pyx_tuple__1468); + + /* "talib/_stream.pxi":1729 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1469 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1469)) __PYX_ERR(3, 1729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1469); + __Pyx_GIVEREF(__pyx_tuple__1469); + + /* "talib/_stream.pxi":1731 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1470 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1470)) __PYX_ERR(3, 1731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1470); + __Pyx_GIVEREF(__pyx_tuple__1470); + + /* "talib/_stream.pxi":1736 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1471 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1471)) __PYX_ERR(3, 1736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1471); + __Pyx_GIVEREF(__pyx_tuple__1471); + + /* "talib/_stream.pxi":1738 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1472 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1472)) __PYX_ERR(3, 1738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1472); + __Pyx_GIVEREF(__pyx_tuple__1472); + + /* "talib/_stream.pxi":1743 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1473 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1473)) __PYX_ERR(3, 1743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1473); + __Pyx_GIVEREF(__pyx_tuple__1473); + + /* "talib/_stream.pxi":1745 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1474 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1474)) __PYX_ERR(3, 1745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1474); + __Pyx_GIVEREF(__pyx_tuple__1474); + + /* "talib/_stream.pxi":1751 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1475 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1475)) __PYX_ERR(3, 1751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1475); + __Pyx_GIVEREF(__pyx_tuple__1475); + + /* "talib/_stream.pxi":1753 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1476 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1476)) __PYX_ERR(3, 1753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1476); + __Pyx_GIVEREF(__pyx_tuple__1476); + + /* "talib/_stream.pxi":1755 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1477 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1477)) __PYX_ERR(3, 1755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1477); + __Pyx_GIVEREF(__pyx_tuple__1477); + + /* "talib/_stream.pxi":1788 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1478 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1478)) __PYX_ERR(3, 1788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1478); + __Pyx_GIVEREF(__pyx_tuple__1478); + + /* "talib/_stream.pxi":1790 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1479 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1479)) __PYX_ERR(3, 1790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1479); + __Pyx_GIVEREF(__pyx_tuple__1479); + + /* "talib/_stream.pxi":1795 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1480 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1480)) __PYX_ERR(3, 1795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1480); + __Pyx_GIVEREF(__pyx_tuple__1480); + + /* "talib/_stream.pxi":1797 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1481 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1481)) __PYX_ERR(3, 1797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1481); + __Pyx_GIVEREF(__pyx_tuple__1481); + + /* "talib/_stream.pxi":1802 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1482 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1482)) __PYX_ERR(3, 1802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1482); + __Pyx_GIVEREF(__pyx_tuple__1482); + + /* "talib/_stream.pxi":1804 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1483 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1483)) __PYX_ERR(3, 1804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1483); + __Pyx_GIVEREF(__pyx_tuple__1483); + + /* "talib/_stream.pxi":1809 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1484 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1484)) __PYX_ERR(3, 1809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1484); + __Pyx_GIVEREF(__pyx_tuple__1484); + + /* "talib/_stream.pxi":1811 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1485 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1485)) __PYX_ERR(3, 1811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1485); + __Pyx_GIVEREF(__pyx_tuple__1485); + + /* "talib/_stream.pxi":1817 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1486 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1486)) __PYX_ERR(3, 1817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1486); + __Pyx_GIVEREF(__pyx_tuple__1486); + + /* "talib/_stream.pxi":1819 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1487 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1487)) __PYX_ERR(3, 1819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1487); + __Pyx_GIVEREF(__pyx_tuple__1487); + + /* "talib/_stream.pxi":1821 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1488 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1488)) __PYX_ERR(3, 1821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1488); + __Pyx_GIVEREF(__pyx_tuple__1488); + + /* "talib/_stream.pxi":1852 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1489 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1489)) __PYX_ERR(3, 1852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1489); + __Pyx_GIVEREF(__pyx_tuple__1489); + + /* "talib/_stream.pxi":1854 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1490 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1490)) __PYX_ERR(3, 1854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1490); + __Pyx_GIVEREF(__pyx_tuple__1490); + + /* "talib/_stream.pxi":1859 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1491 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1491)) __PYX_ERR(3, 1859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1491); + __Pyx_GIVEREF(__pyx_tuple__1491); + + /* "talib/_stream.pxi":1861 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1492 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1492)) __PYX_ERR(3, 1861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1492); + __Pyx_GIVEREF(__pyx_tuple__1492); + + /* "talib/_stream.pxi":1866 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1493 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1493)) __PYX_ERR(3, 1866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1493); + __Pyx_GIVEREF(__pyx_tuple__1493); + + /* "talib/_stream.pxi":1868 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1494 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1494)) __PYX_ERR(3, 1868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1494); + __Pyx_GIVEREF(__pyx_tuple__1494); + + /* "talib/_stream.pxi":1873 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1495 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1495)) __PYX_ERR(3, 1873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1495); + __Pyx_GIVEREF(__pyx_tuple__1495); + + /* "talib/_stream.pxi":1875 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1496 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1496)) __PYX_ERR(3, 1875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1496); + __Pyx_GIVEREF(__pyx_tuple__1496); + + /* "talib/_stream.pxi":1881 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1497 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1497)) __PYX_ERR(3, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1497); + __Pyx_GIVEREF(__pyx_tuple__1497); + + /* "talib/_stream.pxi":1883 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1498 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1498)) __PYX_ERR(3, 1883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1498); + __Pyx_GIVEREF(__pyx_tuple__1498); + + /* "talib/_stream.pxi":1885 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1499 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1499)) __PYX_ERR(3, 1885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1499); + __Pyx_GIVEREF(__pyx_tuple__1499); + + /* "talib/_stream.pxi":1916 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1500 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1500)) __PYX_ERR(3, 1916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1500); + __Pyx_GIVEREF(__pyx_tuple__1500); + + /* "talib/_stream.pxi":1918 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1501 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1501)) __PYX_ERR(3, 1918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1501); + __Pyx_GIVEREF(__pyx_tuple__1501); + + /* "talib/_stream.pxi":1923 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1502 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1502)) __PYX_ERR(3, 1923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1502); + __Pyx_GIVEREF(__pyx_tuple__1502); + + /* "talib/_stream.pxi":1925 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1503 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1503)) __PYX_ERR(3, 1925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1503); + __Pyx_GIVEREF(__pyx_tuple__1503); + + /* "talib/_stream.pxi":1930 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1504 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1504)) __PYX_ERR(3, 1930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1504); + __Pyx_GIVEREF(__pyx_tuple__1504); + + /* "talib/_stream.pxi":1932 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1505 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1505)) __PYX_ERR(3, 1932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1505); + __Pyx_GIVEREF(__pyx_tuple__1505); + + /* "talib/_stream.pxi":1937 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1506 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1506)) __PYX_ERR(3, 1937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1506); + __Pyx_GIVEREF(__pyx_tuple__1506); + + /* "talib/_stream.pxi":1939 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1507 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1507)) __PYX_ERR(3, 1939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1507); + __Pyx_GIVEREF(__pyx_tuple__1507); + + /* "talib/_stream.pxi":1945 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1508 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1508)) __PYX_ERR(3, 1945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1508); + __Pyx_GIVEREF(__pyx_tuple__1508); + + /* "talib/_stream.pxi":1947 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1509 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1509)) __PYX_ERR(3, 1947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1509); + __Pyx_GIVEREF(__pyx_tuple__1509); + + /* "talib/_stream.pxi":1949 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1510 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1510)) __PYX_ERR(3, 1949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1510); + __Pyx_GIVEREF(__pyx_tuple__1510); + + /* "talib/_stream.pxi":1980 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1511 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1511)) __PYX_ERR(3, 1980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1511); + __Pyx_GIVEREF(__pyx_tuple__1511); + + /* "talib/_stream.pxi":1982 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1512 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1512)) __PYX_ERR(3, 1982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1512); + __Pyx_GIVEREF(__pyx_tuple__1512); + + /* "talib/_stream.pxi":1987 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1513 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1513)) __PYX_ERR(3, 1987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1513); + __Pyx_GIVEREF(__pyx_tuple__1513); + + /* "talib/_stream.pxi":1989 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1514 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1514)) __PYX_ERR(3, 1989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1514); + __Pyx_GIVEREF(__pyx_tuple__1514); + + /* "talib/_stream.pxi":1994 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1515 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1515)) __PYX_ERR(3, 1994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1515); + __Pyx_GIVEREF(__pyx_tuple__1515); + + /* "talib/_stream.pxi":1996 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1516 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1516)) __PYX_ERR(3, 1996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1516); + __Pyx_GIVEREF(__pyx_tuple__1516); + + /* "talib/_stream.pxi":2001 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1517 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1517)) __PYX_ERR(3, 2001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1517); + __Pyx_GIVEREF(__pyx_tuple__1517); + + /* "talib/_stream.pxi":2003 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1518 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1518)) __PYX_ERR(3, 2003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1518); + __Pyx_GIVEREF(__pyx_tuple__1518); + + /* "talib/_stream.pxi":2009 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1519 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1519)) __PYX_ERR(3, 2009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1519); + __Pyx_GIVEREF(__pyx_tuple__1519); + + /* "talib/_stream.pxi":2011 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1520 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1520)) __PYX_ERR(3, 2011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1520); + __Pyx_GIVEREF(__pyx_tuple__1520); + + /* "talib/_stream.pxi":2013 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1521 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1521)) __PYX_ERR(3, 2013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1521); + __Pyx_GIVEREF(__pyx_tuple__1521); + + /* "talib/_stream.pxi":2044 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1522 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1522)) __PYX_ERR(3, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1522); + __Pyx_GIVEREF(__pyx_tuple__1522); + + /* "talib/_stream.pxi":2046 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1523 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1523)) __PYX_ERR(3, 2046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1523); + __Pyx_GIVEREF(__pyx_tuple__1523); + + /* "talib/_stream.pxi":2051 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1524 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1524)) __PYX_ERR(3, 2051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1524); + __Pyx_GIVEREF(__pyx_tuple__1524); + + /* "talib/_stream.pxi":2053 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1525 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1525)) __PYX_ERR(3, 2053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1525); + __Pyx_GIVEREF(__pyx_tuple__1525); + + /* "talib/_stream.pxi":2058 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1526 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1526)) __PYX_ERR(3, 2058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1526); + __Pyx_GIVEREF(__pyx_tuple__1526); + + /* "talib/_stream.pxi":2060 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1527 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1527)) __PYX_ERR(3, 2060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1527); + __Pyx_GIVEREF(__pyx_tuple__1527); + + /* "talib/_stream.pxi":2065 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1528 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1528)) __PYX_ERR(3, 2065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1528); + __Pyx_GIVEREF(__pyx_tuple__1528); + + /* "talib/_stream.pxi":2067 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1529 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1529)) __PYX_ERR(3, 2067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1529); + __Pyx_GIVEREF(__pyx_tuple__1529); + + /* "talib/_stream.pxi":2073 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1530 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1530)) __PYX_ERR(3, 2073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1530); + __Pyx_GIVEREF(__pyx_tuple__1530); + + /* "talib/_stream.pxi":2075 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1531 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1531)) __PYX_ERR(3, 2075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1531); + __Pyx_GIVEREF(__pyx_tuple__1531); + + /* "talib/_stream.pxi":2077 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1532 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1532)) __PYX_ERR(3, 2077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1532); + __Pyx_GIVEREF(__pyx_tuple__1532); + + /* "talib/_stream.pxi":2110 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1533 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1533)) __PYX_ERR(3, 2110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1533); + __Pyx_GIVEREF(__pyx_tuple__1533); + + /* "talib/_stream.pxi":2112 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1534 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1534)) __PYX_ERR(3, 2112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1534); + __Pyx_GIVEREF(__pyx_tuple__1534); + + /* "talib/_stream.pxi":2117 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1535 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1535)) __PYX_ERR(3, 2117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1535); + __Pyx_GIVEREF(__pyx_tuple__1535); + + /* "talib/_stream.pxi":2119 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1536 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1536)) __PYX_ERR(3, 2119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1536); + __Pyx_GIVEREF(__pyx_tuple__1536); + + /* "talib/_stream.pxi":2124 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1537 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1537)) __PYX_ERR(3, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1537); + __Pyx_GIVEREF(__pyx_tuple__1537); + + /* "talib/_stream.pxi":2126 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1538 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1538)) __PYX_ERR(3, 2126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1538); + __Pyx_GIVEREF(__pyx_tuple__1538); + + /* "talib/_stream.pxi":2131 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1539 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1539)) __PYX_ERR(3, 2131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1539); + __Pyx_GIVEREF(__pyx_tuple__1539); + + /* "talib/_stream.pxi":2133 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1540 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1540)) __PYX_ERR(3, 2133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1540); + __Pyx_GIVEREF(__pyx_tuple__1540); + + /* "talib/_stream.pxi":2139 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1541 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1541)) __PYX_ERR(3, 2139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1541); + __Pyx_GIVEREF(__pyx_tuple__1541); + + /* "talib/_stream.pxi":2141 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1542 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1542)) __PYX_ERR(3, 2141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1542); + __Pyx_GIVEREF(__pyx_tuple__1542); + + /* "talib/_stream.pxi":2143 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1543 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1543)) __PYX_ERR(3, 2143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1543); + __Pyx_GIVEREF(__pyx_tuple__1543); + + /* "talib/_stream.pxi":2176 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1544 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1544)) __PYX_ERR(3, 2176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1544); + __Pyx_GIVEREF(__pyx_tuple__1544); + + /* "talib/_stream.pxi":2178 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1545 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1545)) __PYX_ERR(3, 2178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1545); + __Pyx_GIVEREF(__pyx_tuple__1545); + + /* "talib/_stream.pxi":2183 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1546 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1546)) __PYX_ERR(3, 2183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1546); + __Pyx_GIVEREF(__pyx_tuple__1546); + + /* "talib/_stream.pxi":2185 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1547 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1547)) __PYX_ERR(3, 2185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1547); + __Pyx_GIVEREF(__pyx_tuple__1547); + + /* "talib/_stream.pxi":2190 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1548 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1548)) __PYX_ERR(3, 2190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1548); + __Pyx_GIVEREF(__pyx_tuple__1548); + + /* "talib/_stream.pxi":2192 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1549 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1549)) __PYX_ERR(3, 2192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1549); + __Pyx_GIVEREF(__pyx_tuple__1549); + + /* "talib/_stream.pxi":2197 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1550 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1550)) __PYX_ERR(3, 2197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1550); + __Pyx_GIVEREF(__pyx_tuple__1550); + + /* "talib/_stream.pxi":2199 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1551 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1551)) __PYX_ERR(3, 2199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1551); + __Pyx_GIVEREF(__pyx_tuple__1551); + + /* "talib/_stream.pxi":2205 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1552 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1552)) __PYX_ERR(3, 2205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1552); + __Pyx_GIVEREF(__pyx_tuple__1552); + + /* "talib/_stream.pxi":2207 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1553 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1553)) __PYX_ERR(3, 2207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1553); + __Pyx_GIVEREF(__pyx_tuple__1553); + + /* "talib/_stream.pxi":2209 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1554 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1554)) __PYX_ERR(3, 2209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1554); + __Pyx_GIVEREF(__pyx_tuple__1554); + + /* "talib/_stream.pxi":2240 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1555 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1555)) __PYX_ERR(3, 2240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1555); + __Pyx_GIVEREF(__pyx_tuple__1555); + + /* "talib/_stream.pxi":2242 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1556 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1556)) __PYX_ERR(3, 2242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1556); + __Pyx_GIVEREF(__pyx_tuple__1556); + + /* "talib/_stream.pxi":2247 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1557 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1557)) __PYX_ERR(3, 2247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1557); + __Pyx_GIVEREF(__pyx_tuple__1557); + + /* "talib/_stream.pxi":2249 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1558 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1558)) __PYX_ERR(3, 2249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1558); + __Pyx_GIVEREF(__pyx_tuple__1558); + + /* "talib/_stream.pxi":2254 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1559 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1559)) __PYX_ERR(3, 2254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1559); + __Pyx_GIVEREF(__pyx_tuple__1559); + + /* "talib/_stream.pxi":2256 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1560 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1560)) __PYX_ERR(3, 2256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1560); + __Pyx_GIVEREF(__pyx_tuple__1560); + + /* "talib/_stream.pxi":2261 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1561 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1561)) __PYX_ERR(3, 2261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1561); + __Pyx_GIVEREF(__pyx_tuple__1561); + + /* "talib/_stream.pxi":2263 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1562 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1562)) __PYX_ERR(3, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1562); + __Pyx_GIVEREF(__pyx_tuple__1562); + + /* "talib/_stream.pxi":2269 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1563 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1563)) __PYX_ERR(3, 2269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1563); + __Pyx_GIVEREF(__pyx_tuple__1563); + + /* "talib/_stream.pxi":2271 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1564 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1564)) __PYX_ERR(3, 2271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1564); + __Pyx_GIVEREF(__pyx_tuple__1564); + + /* "talib/_stream.pxi":2273 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1565 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1565)) __PYX_ERR(3, 2273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1565); + __Pyx_GIVEREF(__pyx_tuple__1565); + + /* "talib/_stream.pxi":2304 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1566 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1566)) __PYX_ERR(3, 2304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1566); + __Pyx_GIVEREF(__pyx_tuple__1566); + + /* "talib/_stream.pxi":2306 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1567 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1567)) __PYX_ERR(3, 2306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1567); + __Pyx_GIVEREF(__pyx_tuple__1567); + + /* "talib/_stream.pxi":2311 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1568 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1568)) __PYX_ERR(3, 2311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1568); + __Pyx_GIVEREF(__pyx_tuple__1568); + + /* "talib/_stream.pxi":2313 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1569 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1569)) __PYX_ERR(3, 2313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1569); + __Pyx_GIVEREF(__pyx_tuple__1569); + + /* "talib/_stream.pxi":2318 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1570 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1570)) __PYX_ERR(3, 2318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1570); + __Pyx_GIVEREF(__pyx_tuple__1570); + + /* "talib/_stream.pxi":2320 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1571 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1571)) __PYX_ERR(3, 2320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1571); + __Pyx_GIVEREF(__pyx_tuple__1571); + + /* "talib/_stream.pxi":2325 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1572 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1572)) __PYX_ERR(3, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1572); + __Pyx_GIVEREF(__pyx_tuple__1572); + + /* "talib/_stream.pxi":2327 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1573 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1573)) __PYX_ERR(3, 2327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1573); + __Pyx_GIVEREF(__pyx_tuple__1573); + + /* "talib/_stream.pxi":2333 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1574 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1574)) __PYX_ERR(3, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1574); + __Pyx_GIVEREF(__pyx_tuple__1574); + + /* "talib/_stream.pxi":2335 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1575 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1575)) __PYX_ERR(3, 2335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1575); + __Pyx_GIVEREF(__pyx_tuple__1575); + + /* "talib/_stream.pxi":2337 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1576 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1576)) __PYX_ERR(3, 2337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1576); + __Pyx_GIVEREF(__pyx_tuple__1576); + + /* "talib/_stream.pxi":2368 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1577 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1577)) __PYX_ERR(3, 2368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1577); + __Pyx_GIVEREF(__pyx_tuple__1577); + + /* "talib/_stream.pxi":2370 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1578 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1578)) __PYX_ERR(3, 2370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1578); + __Pyx_GIVEREF(__pyx_tuple__1578); + + /* "talib/_stream.pxi":2375 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1579 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1579)) __PYX_ERR(3, 2375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1579); + __Pyx_GIVEREF(__pyx_tuple__1579); + + /* "talib/_stream.pxi":2377 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1580 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1580)) __PYX_ERR(3, 2377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1580); + __Pyx_GIVEREF(__pyx_tuple__1580); + + /* "talib/_stream.pxi":2382 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1581 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1581)) __PYX_ERR(3, 2382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1581); + __Pyx_GIVEREF(__pyx_tuple__1581); + + /* "talib/_stream.pxi":2384 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1582 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1582)) __PYX_ERR(3, 2384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1582); + __Pyx_GIVEREF(__pyx_tuple__1582); + + /* "talib/_stream.pxi":2389 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1583 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1583)) __PYX_ERR(3, 2389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1583); + __Pyx_GIVEREF(__pyx_tuple__1583); + + /* "talib/_stream.pxi":2391 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1584 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1584)) __PYX_ERR(3, 2391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1584); + __Pyx_GIVEREF(__pyx_tuple__1584); + + /* "talib/_stream.pxi":2397 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1585 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1585)) __PYX_ERR(3, 2397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1585); + __Pyx_GIVEREF(__pyx_tuple__1585); + + /* "talib/_stream.pxi":2399 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1586 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1586)) __PYX_ERR(3, 2399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1586); + __Pyx_GIVEREF(__pyx_tuple__1586); + + /* "talib/_stream.pxi":2401 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1587 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1587)) __PYX_ERR(3, 2401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1587); + __Pyx_GIVEREF(__pyx_tuple__1587); + + /* "talib/_stream.pxi":2432 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1588 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1588)) __PYX_ERR(3, 2432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1588); + __Pyx_GIVEREF(__pyx_tuple__1588); + + /* "talib/_stream.pxi":2434 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1589 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1589)) __PYX_ERR(3, 2434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1589); + __Pyx_GIVEREF(__pyx_tuple__1589); + + /* "talib/_stream.pxi":2439 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1590 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1590)) __PYX_ERR(3, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1590); + __Pyx_GIVEREF(__pyx_tuple__1590); + + /* "talib/_stream.pxi":2441 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1591 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1591)) __PYX_ERR(3, 2441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1591); + __Pyx_GIVEREF(__pyx_tuple__1591); + + /* "talib/_stream.pxi":2446 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1592 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1592)) __PYX_ERR(3, 2446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1592); + __Pyx_GIVEREF(__pyx_tuple__1592); + + /* "talib/_stream.pxi":2448 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1593 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1593)) __PYX_ERR(3, 2448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1593); + __Pyx_GIVEREF(__pyx_tuple__1593); + + /* "talib/_stream.pxi":2453 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1594 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1594)) __PYX_ERR(3, 2453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1594); + __Pyx_GIVEREF(__pyx_tuple__1594); + + /* "talib/_stream.pxi":2455 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1595 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1595)) __PYX_ERR(3, 2455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1595); + __Pyx_GIVEREF(__pyx_tuple__1595); + + /* "talib/_stream.pxi":2461 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1596 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1596)) __PYX_ERR(3, 2461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1596); + __Pyx_GIVEREF(__pyx_tuple__1596); + + /* "talib/_stream.pxi":2463 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1597 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1597)) __PYX_ERR(3, 2463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1597); + __Pyx_GIVEREF(__pyx_tuple__1597); + + /* "talib/_stream.pxi":2465 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1598 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1598)) __PYX_ERR(3, 2465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1598); + __Pyx_GIVEREF(__pyx_tuple__1598); + + /* "talib/_stream.pxi":2496 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1599 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1599)) __PYX_ERR(3, 2496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1599); + __Pyx_GIVEREF(__pyx_tuple__1599); + + /* "talib/_stream.pxi":2498 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1600 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1600)) __PYX_ERR(3, 2498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1600); + __Pyx_GIVEREF(__pyx_tuple__1600); + + /* "talib/_stream.pxi":2503 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1601 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1601)) __PYX_ERR(3, 2503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1601); + __Pyx_GIVEREF(__pyx_tuple__1601); + + /* "talib/_stream.pxi":2505 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1602 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1602)) __PYX_ERR(3, 2505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1602); + __Pyx_GIVEREF(__pyx_tuple__1602); + + /* "talib/_stream.pxi":2510 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1603 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1603)) __PYX_ERR(3, 2510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1603); + __Pyx_GIVEREF(__pyx_tuple__1603); + + /* "talib/_stream.pxi":2512 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1604 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1604)) __PYX_ERR(3, 2512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1604); + __Pyx_GIVEREF(__pyx_tuple__1604); + + /* "talib/_stream.pxi":2517 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1605 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1605)) __PYX_ERR(3, 2517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1605); + __Pyx_GIVEREF(__pyx_tuple__1605); + + /* "talib/_stream.pxi":2519 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1606 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1606)) __PYX_ERR(3, 2519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1606); + __Pyx_GIVEREF(__pyx_tuple__1606); + + /* "talib/_stream.pxi":2525 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1607 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1607)) __PYX_ERR(3, 2525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1607); + __Pyx_GIVEREF(__pyx_tuple__1607); + + /* "talib/_stream.pxi":2527 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1608 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1608)) __PYX_ERR(3, 2527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1608); + __Pyx_GIVEREF(__pyx_tuple__1608); + + /* "talib/_stream.pxi":2529 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1609 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1609)) __PYX_ERR(3, 2529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1609); + __Pyx_GIVEREF(__pyx_tuple__1609); + + /* "talib/_stream.pxi":2560 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1610 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1610)) __PYX_ERR(3, 2560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1610); + __Pyx_GIVEREF(__pyx_tuple__1610); + + /* "talib/_stream.pxi":2562 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1611 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1611)) __PYX_ERR(3, 2562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1611); + __Pyx_GIVEREF(__pyx_tuple__1611); + + /* "talib/_stream.pxi":2567 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1612 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1612)) __PYX_ERR(3, 2567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1612); + __Pyx_GIVEREF(__pyx_tuple__1612); + + /* "talib/_stream.pxi":2569 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1613 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1613)) __PYX_ERR(3, 2569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1613); + __Pyx_GIVEREF(__pyx_tuple__1613); + + /* "talib/_stream.pxi":2574 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1614 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1614)) __PYX_ERR(3, 2574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1614); + __Pyx_GIVEREF(__pyx_tuple__1614); + + /* "talib/_stream.pxi":2576 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1615 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1615)) __PYX_ERR(3, 2576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1615); + __Pyx_GIVEREF(__pyx_tuple__1615); + + /* "talib/_stream.pxi":2581 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1616 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1616)) __PYX_ERR(3, 2581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1616); + __Pyx_GIVEREF(__pyx_tuple__1616); + + /* "talib/_stream.pxi":2583 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1617 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1617)) __PYX_ERR(3, 2583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1617); + __Pyx_GIVEREF(__pyx_tuple__1617); + + /* "talib/_stream.pxi":2589 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1618 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1618)) __PYX_ERR(3, 2589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1618); + __Pyx_GIVEREF(__pyx_tuple__1618); + + /* "talib/_stream.pxi":2591 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1619 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1619)) __PYX_ERR(3, 2591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1619); + __Pyx_GIVEREF(__pyx_tuple__1619); + + /* "talib/_stream.pxi":2593 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1620 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1620)) __PYX_ERR(3, 2593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1620); + __Pyx_GIVEREF(__pyx_tuple__1620); + + /* "talib/_stream.pxi":2624 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1621 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1621)) __PYX_ERR(3, 2624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1621); + __Pyx_GIVEREF(__pyx_tuple__1621); + + /* "talib/_stream.pxi":2626 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1622 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1622)) __PYX_ERR(3, 2626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1622); + __Pyx_GIVEREF(__pyx_tuple__1622); + + /* "talib/_stream.pxi":2631 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1623 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1623)) __PYX_ERR(3, 2631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1623); + __Pyx_GIVEREF(__pyx_tuple__1623); + + /* "talib/_stream.pxi":2633 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1624 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1624)) __PYX_ERR(3, 2633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1624); + __Pyx_GIVEREF(__pyx_tuple__1624); + + /* "talib/_stream.pxi":2638 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1625 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1625)) __PYX_ERR(3, 2638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1625); + __Pyx_GIVEREF(__pyx_tuple__1625); + + /* "talib/_stream.pxi":2640 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1626 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1626)) __PYX_ERR(3, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1626); + __Pyx_GIVEREF(__pyx_tuple__1626); + + /* "talib/_stream.pxi":2645 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1627 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1627)) __PYX_ERR(3, 2645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1627); + __Pyx_GIVEREF(__pyx_tuple__1627); + + /* "talib/_stream.pxi":2647 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1628 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1628)) __PYX_ERR(3, 2647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1628); + __Pyx_GIVEREF(__pyx_tuple__1628); + + /* "talib/_stream.pxi":2653 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1629 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1629)) __PYX_ERR(3, 2653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1629); + __Pyx_GIVEREF(__pyx_tuple__1629); + + /* "talib/_stream.pxi":2655 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1630 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1630)) __PYX_ERR(3, 2655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1630); + __Pyx_GIVEREF(__pyx_tuple__1630); + + /* "talib/_stream.pxi":2657 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1631 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1631)) __PYX_ERR(3, 2657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1631); + __Pyx_GIVEREF(__pyx_tuple__1631); + + /* "talib/_stream.pxi":2688 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1632 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1632)) __PYX_ERR(3, 2688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1632); + __Pyx_GIVEREF(__pyx_tuple__1632); + + /* "talib/_stream.pxi":2690 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1633 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1633)) __PYX_ERR(3, 2690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1633); + __Pyx_GIVEREF(__pyx_tuple__1633); + + /* "talib/_stream.pxi":2695 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1634 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1634)) __PYX_ERR(3, 2695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1634); + __Pyx_GIVEREF(__pyx_tuple__1634); + + /* "talib/_stream.pxi":2697 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1635 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1635)) __PYX_ERR(3, 2697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1635); + __Pyx_GIVEREF(__pyx_tuple__1635); + + /* "talib/_stream.pxi":2702 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1636 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1636)) __PYX_ERR(3, 2702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1636); + __Pyx_GIVEREF(__pyx_tuple__1636); + + /* "talib/_stream.pxi":2704 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1637 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1637)) __PYX_ERR(3, 2704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1637); + __Pyx_GIVEREF(__pyx_tuple__1637); + + /* "talib/_stream.pxi":2709 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1638 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1638)) __PYX_ERR(3, 2709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1638); + __Pyx_GIVEREF(__pyx_tuple__1638); + + /* "talib/_stream.pxi":2711 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1639 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1639)) __PYX_ERR(3, 2711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1639); + __Pyx_GIVEREF(__pyx_tuple__1639); + + /* "talib/_stream.pxi":2717 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1640 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1640)) __PYX_ERR(3, 2717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1640); + __Pyx_GIVEREF(__pyx_tuple__1640); + + /* "talib/_stream.pxi":2719 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1641 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1641)) __PYX_ERR(3, 2719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1641); + __Pyx_GIVEREF(__pyx_tuple__1641); + + /* "talib/_stream.pxi":2721 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1642 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1642)) __PYX_ERR(3, 2721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1642); + __Pyx_GIVEREF(__pyx_tuple__1642); + + /* "talib/_stream.pxi":2752 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1643 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1643)) __PYX_ERR(3, 2752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1643); + __Pyx_GIVEREF(__pyx_tuple__1643); + + /* "talib/_stream.pxi":2754 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1644 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1644)) __PYX_ERR(3, 2754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1644); + __Pyx_GIVEREF(__pyx_tuple__1644); + + /* "talib/_stream.pxi":2759 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1645 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1645)) __PYX_ERR(3, 2759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1645); + __Pyx_GIVEREF(__pyx_tuple__1645); + + /* "talib/_stream.pxi":2761 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1646 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1646)) __PYX_ERR(3, 2761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1646); + __Pyx_GIVEREF(__pyx_tuple__1646); + + /* "talib/_stream.pxi":2766 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1647 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1647)) __PYX_ERR(3, 2766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1647); + __Pyx_GIVEREF(__pyx_tuple__1647); + + /* "talib/_stream.pxi":2768 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1648 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1648)) __PYX_ERR(3, 2768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1648); + __Pyx_GIVEREF(__pyx_tuple__1648); + + /* "talib/_stream.pxi":2773 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1649 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1649)) __PYX_ERR(3, 2773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1649); + __Pyx_GIVEREF(__pyx_tuple__1649); + + /* "talib/_stream.pxi":2775 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1650 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1650)) __PYX_ERR(3, 2775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1650); + __Pyx_GIVEREF(__pyx_tuple__1650); + + /* "talib/_stream.pxi":2781 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1651 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1651)) __PYX_ERR(3, 2781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1651); + __Pyx_GIVEREF(__pyx_tuple__1651); + + /* "talib/_stream.pxi":2783 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1652 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1652)) __PYX_ERR(3, 2783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1652); + __Pyx_GIVEREF(__pyx_tuple__1652); + + /* "talib/_stream.pxi":2785 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1653 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1653)) __PYX_ERR(3, 2785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1653); + __Pyx_GIVEREF(__pyx_tuple__1653); + + /* "talib/_stream.pxi":2816 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1654 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1654)) __PYX_ERR(3, 2816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1654); + __Pyx_GIVEREF(__pyx_tuple__1654); + + /* "talib/_stream.pxi":2818 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1655 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1655)) __PYX_ERR(3, 2818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1655); + __Pyx_GIVEREF(__pyx_tuple__1655); + + /* "talib/_stream.pxi":2823 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1656 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1656)) __PYX_ERR(3, 2823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1656); + __Pyx_GIVEREF(__pyx_tuple__1656); + + /* "talib/_stream.pxi":2825 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1657 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1657)) __PYX_ERR(3, 2825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1657); + __Pyx_GIVEREF(__pyx_tuple__1657); + + /* "talib/_stream.pxi":2830 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1658 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1658)) __PYX_ERR(3, 2830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1658); + __Pyx_GIVEREF(__pyx_tuple__1658); + + /* "talib/_stream.pxi":2832 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1659 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1659)) __PYX_ERR(3, 2832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1659); + __Pyx_GIVEREF(__pyx_tuple__1659); + + /* "talib/_stream.pxi":2837 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1660 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1660)) __PYX_ERR(3, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1660); + __Pyx_GIVEREF(__pyx_tuple__1660); + + /* "talib/_stream.pxi":2839 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1661 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1661)) __PYX_ERR(3, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1661); + __Pyx_GIVEREF(__pyx_tuple__1661); + + /* "talib/_stream.pxi":2845 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1662 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1662)) __PYX_ERR(3, 2845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1662); + __Pyx_GIVEREF(__pyx_tuple__1662); + + /* "talib/_stream.pxi":2847 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1663 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1663)) __PYX_ERR(3, 2847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1663); + __Pyx_GIVEREF(__pyx_tuple__1663); + + /* "talib/_stream.pxi":2849 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1664 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1664)) __PYX_ERR(3, 2849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1664); + __Pyx_GIVEREF(__pyx_tuple__1664); + + /* "talib/_stream.pxi":2880 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1665 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1665)) __PYX_ERR(3, 2880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1665); + __Pyx_GIVEREF(__pyx_tuple__1665); + + /* "talib/_stream.pxi":2882 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1666 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1666)) __PYX_ERR(3, 2882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1666); + __Pyx_GIVEREF(__pyx_tuple__1666); + + /* "talib/_stream.pxi":2887 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1667 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1667)) __PYX_ERR(3, 2887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1667); + __Pyx_GIVEREF(__pyx_tuple__1667); + + /* "talib/_stream.pxi":2889 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1668 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1668)) __PYX_ERR(3, 2889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1668); + __Pyx_GIVEREF(__pyx_tuple__1668); + + /* "talib/_stream.pxi":2894 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1669 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1669)) __PYX_ERR(3, 2894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1669); + __Pyx_GIVEREF(__pyx_tuple__1669); + + /* "talib/_stream.pxi":2896 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1670 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1670)) __PYX_ERR(3, 2896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1670); + __Pyx_GIVEREF(__pyx_tuple__1670); + + /* "talib/_stream.pxi":2901 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1671 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1671)) __PYX_ERR(3, 2901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1671); + __Pyx_GIVEREF(__pyx_tuple__1671); + + /* "talib/_stream.pxi":2903 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1672 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1672)) __PYX_ERR(3, 2903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1672); + __Pyx_GIVEREF(__pyx_tuple__1672); + + /* "talib/_stream.pxi":2909 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1673 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1673)) __PYX_ERR(3, 2909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1673); + __Pyx_GIVEREF(__pyx_tuple__1673); + + /* "talib/_stream.pxi":2911 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1674 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1674)) __PYX_ERR(3, 2911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1674); + __Pyx_GIVEREF(__pyx_tuple__1674); + + /* "talib/_stream.pxi":2913 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1675 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1675)) __PYX_ERR(3, 2913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1675); + __Pyx_GIVEREF(__pyx_tuple__1675); + + /* "talib/_stream.pxi":2944 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1676 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1676)) __PYX_ERR(3, 2944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1676); + __Pyx_GIVEREF(__pyx_tuple__1676); + + /* "talib/_stream.pxi":2946 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1677 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1677)) __PYX_ERR(3, 2946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1677); + __Pyx_GIVEREF(__pyx_tuple__1677); + + /* "talib/_stream.pxi":2951 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1678 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1678)) __PYX_ERR(3, 2951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1678); + __Pyx_GIVEREF(__pyx_tuple__1678); + + /* "talib/_stream.pxi":2953 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1679 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1679)) __PYX_ERR(3, 2953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1679); + __Pyx_GIVEREF(__pyx_tuple__1679); + + /* "talib/_stream.pxi":2958 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1680 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1680)) __PYX_ERR(3, 2958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1680); + __Pyx_GIVEREF(__pyx_tuple__1680); + + /* "talib/_stream.pxi":2960 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1681 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1681)) __PYX_ERR(3, 2960, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1681); + __Pyx_GIVEREF(__pyx_tuple__1681); + + /* "talib/_stream.pxi":2965 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1682 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1682)) __PYX_ERR(3, 2965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1682); + __Pyx_GIVEREF(__pyx_tuple__1682); + + /* "talib/_stream.pxi":2967 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1683 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1683)) __PYX_ERR(3, 2967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1683); + __Pyx_GIVEREF(__pyx_tuple__1683); + + /* "talib/_stream.pxi":2973 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1684 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1684)) __PYX_ERR(3, 2973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1684); + __Pyx_GIVEREF(__pyx_tuple__1684); + + /* "talib/_stream.pxi":2975 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1685 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1685)) __PYX_ERR(3, 2975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1685); + __Pyx_GIVEREF(__pyx_tuple__1685); + + /* "talib/_stream.pxi":2977 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1686 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1686)) __PYX_ERR(3, 2977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1686); + __Pyx_GIVEREF(__pyx_tuple__1686); + + /* "talib/_stream.pxi":3008 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1687 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1687)) __PYX_ERR(3, 3008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1687); + __Pyx_GIVEREF(__pyx_tuple__1687); + + /* "talib/_stream.pxi":3010 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1688 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1688)) __PYX_ERR(3, 3010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1688); + __Pyx_GIVEREF(__pyx_tuple__1688); + + /* "talib/_stream.pxi":3015 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1689 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1689)) __PYX_ERR(3, 3015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1689); + __Pyx_GIVEREF(__pyx_tuple__1689); + + /* "talib/_stream.pxi":3017 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1690 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1690)) __PYX_ERR(3, 3017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1690); + __Pyx_GIVEREF(__pyx_tuple__1690); + + /* "talib/_stream.pxi":3022 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1691 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1691)) __PYX_ERR(3, 3022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1691); + __Pyx_GIVEREF(__pyx_tuple__1691); + + /* "talib/_stream.pxi":3024 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1692 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1692)) __PYX_ERR(3, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1692); + __Pyx_GIVEREF(__pyx_tuple__1692); + + /* "talib/_stream.pxi":3029 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1693 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1693)) __PYX_ERR(3, 3029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1693); + __Pyx_GIVEREF(__pyx_tuple__1693); + + /* "talib/_stream.pxi":3031 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1694 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1694)) __PYX_ERR(3, 3031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1694); + __Pyx_GIVEREF(__pyx_tuple__1694); + + /* "talib/_stream.pxi":3037 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1695 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1695)) __PYX_ERR(3, 3037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1695); + __Pyx_GIVEREF(__pyx_tuple__1695); + + /* "talib/_stream.pxi":3039 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1696 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1696)) __PYX_ERR(3, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1696); + __Pyx_GIVEREF(__pyx_tuple__1696); + + /* "talib/_stream.pxi":3041 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1697 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1697)) __PYX_ERR(3, 3041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1697); + __Pyx_GIVEREF(__pyx_tuple__1697); + + /* "talib/_stream.pxi":3072 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1698 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1698)) __PYX_ERR(3, 3072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1698); + __Pyx_GIVEREF(__pyx_tuple__1698); + + /* "talib/_stream.pxi":3074 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1699 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1699)) __PYX_ERR(3, 3074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1699); + __Pyx_GIVEREF(__pyx_tuple__1699); + + /* "talib/_stream.pxi":3079 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1700 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1700)) __PYX_ERR(3, 3079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1700); + __Pyx_GIVEREF(__pyx_tuple__1700); + + /* "talib/_stream.pxi":3081 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1701 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1701)) __PYX_ERR(3, 3081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1701); + __Pyx_GIVEREF(__pyx_tuple__1701); + + /* "talib/_stream.pxi":3086 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1702 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1702)) __PYX_ERR(3, 3086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1702); + __Pyx_GIVEREF(__pyx_tuple__1702); + + /* "talib/_stream.pxi":3088 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1703 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1703)) __PYX_ERR(3, 3088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1703); + __Pyx_GIVEREF(__pyx_tuple__1703); + + /* "talib/_stream.pxi":3093 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1704 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1704)) __PYX_ERR(3, 3093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1704); + __Pyx_GIVEREF(__pyx_tuple__1704); + + /* "talib/_stream.pxi":3095 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1705 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1705)) __PYX_ERR(3, 3095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1705); + __Pyx_GIVEREF(__pyx_tuple__1705); + + /* "talib/_stream.pxi":3101 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1706 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1706)) __PYX_ERR(3, 3101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1706); + __Pyx_GIVEREF(__pyx_tuple__1706); + + /* "talib/_stream.pxi":3103 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1707 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1707)) __PYX_ERR(3, 3103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1707); + __Pyx_GIVEREF(__pyx_tuple__1707); + + /* "talib/_stream.pxi":3105 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1708 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1708)) __PYX_ERR(3, 3105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1708); + __Pyx_GIVEREF(__pyx_tuple__1708); + + /* "talib/_stream.pxi":3136 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1709 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1709)) __PYX_ERR(3, 3136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1709); + __Pyx_GIVEREF(__pyx_tuple__1709); + + /* "talib/_stream.pxi":3138 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1710 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1710)) __PYX_ERR(3, 3138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1710); + __Pyx_GIVEREF(__pyx_tuple__1710); + + /* "talib/_stream.pxi":3143 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1711 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1711)) __PYX_ERR(3, 3143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1711); + __Pyx_GIVEREF(__pyx_tuple__1711); + + /* "talib/_stream.pxi":3145 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1712 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1712)) __PYX_ERR(3, 3145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1712); + __Pyx_GIVEREF(__pyx_tuple__1712); + + /* "talib/_stream.pxi":3150 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1713 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1713)) __PYX_ERR(3, 3150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1713); + __Pyx_GIVEREF(__pyx_tuple__1713); + + /* "talib/_stream.pxi":3152 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1714 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1714)) __PYX_ERR(3, 3152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1714); + __Pyx_GIVEREF(__pyx_tuple__1714); + + /* "talib/_stream.pxi":3157 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1715 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1715)) __PYX_ERR(3, 3157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1715); + __Pyx_GIVEREF(__pyx_tuple__1715); + + /* "talib/_stream.pxi":3159 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1716 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1716)) __PYX_ERR(3, 3159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1716); + __Pyx_GIVEREF(__pyx_tuple__1716); + + /* "talib/_stream.pxi":3165 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1717 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1717)) __PYX_ERR(3, 3165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1717); + __Pyx_GIVEREF(__pyx_tuple__1717); + + /* "talib/_stream.pxi":3167 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1718 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1718)) __PYX_ERR(3, 3167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1718); + __Pyx_GIVEREF(__pyx_tuple__1718); + + /* "talib/_stream.pxi":3169 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1719 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1719)) __PYX_ERR(3, 3169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1719); + __Pyx_GIVEREF(__pyx_tuple__1719); + + /* "talib/_stream.pxi":3200 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1720 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1720)) __PYX_ERR(3, 3200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1720); + __Pyx_GIVEREF(__pyx_tuple__1720); + + /* "talib/_stream.pxi":3202 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1721 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1721)) __PYX_ERR(3, 3202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1721); + __Pyx_GIVEREF(__pyx_tuple__1721); + + /* "talib/_stream.pxi":3207 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1722 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1722)) __PYX_ERR(3, 3207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1722); + __Pyx_GIVEREF(__pyx_tuple__1722); + + /* "talib/_stream.pxi":3209 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1723 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1723)) __PYX_ERR(3, 3209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1723); + __Pyx_GIVEREF(__pyx_tuple__1723); + + /* "talib/_stream.pxi":3214 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1724 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1724)) __PYX_ERR(3, 3214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1724); + __Pyx_GIVEREF(__pyx_tuple__1724); + + /* "talib/_stream.pxi":3216 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1725 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1725)) __PYX_ERR(3, 3216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1725); + __Pyx_GIVEREF(__pyx_tuple__1725); + + /* "talib/_stream.pxi":3221 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1726 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1726)) __PYX_ERR(3, 3221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1726); + __Pyx_GIVEREF(__pyx_tuple__1726); + + /* "talib/_stream.pxi":3223 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1727 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1727)) __PYX_ERR(3, 3223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1727); + __Pyx_GIVEREF(__pyx_tuple__1727); + + /* "talib/_stream.pxi":3229 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1728 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1728)) __PYX_ERR(3, 3229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1728); + __Pyx_GIVEREF(__pyx_tuple__1728); + + /* "talib/_stream.pxi":3231 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1729 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1729)) __PYX_ERR(3, 3231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1729); + __Pyx_GIVEREF(__pyx_tuple__1729); + + /* "talib/_stream.pxi":3233 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1730 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1730)) __PYX_ERR(3, 3233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1730); + __Pyx_GIVEREF(__pyx_tuple__1730); + + /* "talib/_stream.pxi":3264 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1731 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1731)) __PYX_ERR(3, 3264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1731); + __Pyx_GIVEREF(__pyx_tuple__1731); + + /* "talib/_stream.pxi":3266 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1732 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1732)) __PYX_ERR(3, 3266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1732); + __Pyx_GIVEREF(__pyx_tuple__1732); + + /* "talib/_stream.pxi":3271 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1733 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1733)) __PYX_ERR(3, 3271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1733); + __Pyx_GIVEREF(__pyx_tuple__1733); + + /* "talib/_stream.pxi":3273 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1734 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1734)) __PYX_ERR(3, 3273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1734); + __Pyx_GIVEREF(__pyx_tuple__1734); + + /* "talib/_stream.pxi":3278 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1735 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1735)) __PYX_ERR(3, 3278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1735); + __Pyx_GIVEREF(__pyx_tuple__1735); + + /* "talib/_stream.pxi":3280 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1736 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1736)) __PYX_ERR(3, 3280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1736); + __Pyx_GIVEREF(__pyx_tuple__1736); + + /* "talib/_stream.pxi":3285 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1737 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1737)) __PYX_ERR(3, 3285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1737); + __Pyx_GIVEREF(__pyx_tuple__1737); + + /* "talib/_stream.pxi":3287 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1738 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1738)) __PYX_ERR(3, 3287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1738); + __Pyx_GIVEREF(__pyx_tuple__1738); + + /* "talib/_stream.pxi":3293 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1739 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1739)) __PYX_ERR(3, 3293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1739); + __Pyx_GIVEREF(__pyx_tuple__1739); + + /* "talib/_stream.pxi":3295 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1740 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1740)) __PYX_ERR(3, 3295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1740); + __Pyx_GIVEREF(__pyx_tuple__1740); + + /* "talib/_stream.pxi":3297 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1741 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1741)) __PYX_ERR(3, 3297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1741); + __Pyx_GIVEREF(__pyx_tuple__1741); + + /* "talib/_stream.pxi":3328 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1742 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1742)) __PYX_ERR(3, 3328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1742); + __Pyx_GIVEREF(__pyx_tuple__1742); + + /* "talib/_stream.pxi":3330 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1743 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1743)) __PYX_ERR(3, 3330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1743); + __Pyx_GIVEREF(__pyx_tuple__1743); + + /* "talib/_stream.pxi":3335 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1744 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1744)) __PYX_ERR(3, 3335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1744); + __Pyx_GIVEREF(__pyx_tuple__1744); + + /* "talib/_stream.pxi":3337 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1745 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1745)) __PYX_ERR(3, 3337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1745); + __Pyx_GIVEREF(__pyx_tuple__1745); + + /* "talib/_stream.pxi":3342 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1746 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1746)) __PYX_ERR(3, 3342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1746); + __Pyx_GIVEREF(__pyx_tuple__1746); + + /* "talib/_stream.pxi":3344 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1747 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1747)) __PYX_ERR(3, 3344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1747); + __Pyx_GIVEREF(__pyx_tuple__1747); + + /* "talib/_stream.pxi":3349 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1748 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1748)) __PYX_ERR(3, 3349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1748); + __Pyx_GIVEREF(__pyx_tuple__1748); + + /* "talib/_stream.pxi":3351 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1749 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1749)) __PYX_ERR(3, 3351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1749); + __Pyx_GIVEREF(__pyx_tuple__1749); + + /* "talib/_stream.pxi":3357 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1750 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1750)) __PYX_ERR(3, 3357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1750); + __Pyx_GIVEREF(__pyx_tuple__1750); + + /* "talib/_stream.pxi":3359 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1751 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1751)) __PYX_ERR(3, 3359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1751); + __Pyx_GIVEREF(__pyx_tuple__1751); + + /* "talib/_stream.pxi":3361 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1752 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1752)) __PYX_ERR(3, 3361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1752); + __Pyx_GIVEREF(__pyx_tuple__1752); + + /* "talib/_stream.pxi":3392 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1753 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1753)) __PYX_ERR(3, 3392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1753); + __Pyx_GIVEREF(__pyx_tuple__1753); + + /* "talib/_stream.pxi":3394 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1754 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1754)) __PYX_ERR(3, 3394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1754); + __Pyx_GIVEREF(__pyx_tuple__1754); + + /* "talib/_stream.pxi":3399 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1755 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1755)) __PYX_ERR(3, 3399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1755); + __Pyx_GIVEREF(__pyx_tuple__1755); + + /* "talib/_stream.pxi":3401 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1756 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1756)) __PYX_ERR(3, 3401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1756); + __Pyx_GIVEREF(__pyx_tuple__1756); + + /* "talib/_stream.pxi":3406 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1757 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1757)) __PYX_ERR(3, 3406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1757); + __Pyx_GIVEREF(__pyx_tuple__1757); + + /* "talib/_stream.pxi":3408 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1758 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1758)) __PYX_ERR(3, 3408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1758); + __Pyx_GIVEREF(__pyx_tuple__1758); + + /* "talib/_stream.pxi":3413 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1759 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1759)) __PYX_ERR(3, 3413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1759); + __Pyx_GIVEREF(__pyx_tuple__1759); + + /* "talib/_stream.pxi":3415 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1760 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1760)) __PYX_ERR(3, 3415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1760); + __Pyx_GIVEREF(__pyx_tuple__1760); + + /* "talib/_stream.pxi":3421 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1761 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1761)) __PYX_ERR(3, 3421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1761); + __Pyx_GIVEREF(__pyx_tuple__1761); + + /* "talib/_stream.pxi":3423 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1762 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1762)) __PYX_ERR(3, 3423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1762); + __Pyx_GIVEREF(__pyx_tuple__1762); + + /* "talib/_stream.pxi":3425 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1763 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1763)) __PYX_ERR(3, 3425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1763); + __Pyx_GIVEREF(__pyx_tuple__1763); + + /* "talib/_stream.pxi":3456 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1764 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1764)) __PYX_ERR(3, 3456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1764); + __Pyx_GIVEREF(__pyx_tuple__1764); + + /* "talib/_stream.pxi":3458 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1765 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1765)) __PYX_ERR(3, 3458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1765); + __Pyx_GIVEREF(__pyx_tuple__1765); + + /* "talib/_stream.pxi":3463 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1766 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1766)) __PYX_ERR(3, 3463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1766); + __Pyx_GIVEREF(__pyx_tuple__1766); + + /* "talib/_stream.pxi":3465 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1767 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1767)) __PYX_ERR(3, 3465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1767); + __Pyx_GIVEREF(__pyx_tuple__1767); + + /* "talib/_stream.pxi":3470 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1768 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1768)) __PYX_ERR(3, 3470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1768); + __Pyx_GIVEREF(__pyx_tuple__1768); + + /* "talib/_stream.pxi":3472 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1769 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1769)) __PYX_ERR(3, 3472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1769); + __Pyx_GIVEREF(__pyx_tuple__1769); + + /* "talib/_stream.pxi":3477 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1770 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1770)) __PYX_ERR(3, 3477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1770); + __Pyx_GIVEREF(__pyx_tuple__1770); + + /* "talib/_stream.pxi":3479 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1771 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1771)) __PYX_ERR(3, 3479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1771); + __Pyx_GIVEREF(__pyx_tuple__1771); + + /* "talib/_stream.pxi":3485 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1772 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1772)) __PYX_ERR(3, 3485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1772); + __Pyx_GIVEREF(__pyx_tuple__1772); + + /* "talib/_stream.pxi":3487 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1773 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1773)) __PYX_ERR(3, 3487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1773); + __Pyx_GIVEREF(__pyx_tuple__1773); + + /* "talib/_stream.pxi":3489 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1774 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1774)) __PYX_ERR(3, 3489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1774); + __Pyx_GIVEREF(__pyx_tuple__1774); + + /* "talib/_stream.pxi":3522 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1775 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1775)) __PYX_ERR(3, 3522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1775); + __Pyx_GIVEREF(__pyx_tuple__1775); + + /* "talib/_stream.pxi":3524 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1776 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1776)) __PYX_ERR(3, 3524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1776); + __Pyx_GIVEREF(__pyx_tuple__1776); + + /* "talib/_stream.pxi":3529 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1777 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1777)) __PYX_ERR(3, 3529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1777); + __Pyx_GIVEREF(__pyx_tuple__1777); + + /* "talib/_stream.pxi":3531 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1778 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1778)) __PYX_ERR(3, 3531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1778); + __Pyx_GIVEREF(__pyx_tuple__1778); + + /* "talib/_stream.pxi":3536 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1779 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1779)) __PYX_ERR(3, 3536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1779); + __Pyx_GIVEREF(__pyx_tuple__1779); + + /* "talib/_stream.pxi":3538 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1780 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1780)) __PYX_ERR(3, 3538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1780); + __Pyx_GIVEREF(__pyx_tuple__1780); + + /* "talib/_stream.pxi":3543 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1781 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1781)) __PYX_ERR(3, 3543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1781); + __Pyx_GIVEREF(__pyx_tuple__1781); + + /* "talib/_stream.pxi":3545 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1782 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1782)) __PYX_ERR(3, 3545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1782); + __Pyx_GIVEREF(__pyx_tuple__1782); + + /* "talib/_stream.pxi":3551 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1783 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1783)) __PYX_ERR(3, 3551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1783); + __Pyx_GIVEREF(__pyx_tuple__1783); + + /* "talib/_stream.pxi":3553 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1784 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1784)) __PYX_ERR(3, 3553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1784); + __Pyx_GIVEREF(__pyx_tuple__1784); + + /* "talib/_stream.pxi":3555 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1785 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1785)) __PYX_ERR(3, 3555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1785); + __Pyx_GIVEREF(__pyx_tuple__1785); + + /* "talib/_stream.pxi":3588 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1786 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1786)) __PYX_ERR(3, 3588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1786); + __Pyx_GIVEREF(__pyx_tuple__1786); + + /* "talib/_stream.pxi":3590 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1787 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1787)) __PYX_ERR(3, 3590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1787); + __Pyx_GIVEREF(__pyx_tuple__1787); + + /* "talib/_stream.pxi":3595 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1788 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1788)) __PYX_ERR(3, 3595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1788); + __Pyx_GIVEREF(__pyx_tuple__1788); + + /* "talib/_stream.pxi":3597 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1789 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1789)) __PYX_ERR(3, 3597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1789); + __Pyx_GIVEREF(__pyx_tuple__1789); + + /* "talib/_stream.pxi":3602 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1790 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1790)) __PYX_ERR(3, 3602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1790); + __Pyx_GIVEREF(__pyx_tuple__1790); + + /* "talib/_stream.pxi":3604 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1791 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1791)) __PYX_ERR(3, 3604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1791); + __Pyx_GIVEREF(__pyx_tuple__1791); + + /* "talib/_stream.pxi":3609 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1792 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1792)) __PYX_ERR(3, 3609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1792); + __Pyx_GIVEREF(__pyx_tuple__1792); + + /* "talib/_stream.pxi":3611 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1793 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1793)) __PYX_ERR(3, 3611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1793); + __Pyx_GIVEREF(__pyx_tuple__1793); + + /* "talib/_stream.pxi":3617 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1794 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1794)) __PYX_ERR(3, 3617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1794); + __Pyx_GIVEREF(__pyx_tuple__1794); + + /* "talib/_stream.pxi":3619 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1795 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1795)) __PYX_ERR(3, 3619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1795); + __Pyx_GIVEREF(__pyx_tuple__1795); + + /* "talib/_stream.pxi":3621 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1796 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1796)) __PYX_ERR(3, 3621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1796); + __Pyx_GIVEREF(__pyx_tuple__1796); + + /* "talib/_stream.pxi":3654 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1797 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1797)) __PYX_ERR(3, 3654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1797); + __Pyx_GIVEREF(__pyx_tuple__1797); + + /* "talib/_stream.pxi":3656 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1798 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1798)) __PYX_ERR(3, 3656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1798); + __Pyx_GIVEREF(__pyx_tuple__1798); + + /* "talib/_stream.pxi":3661 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1799 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1799)) __PYX_ERR(3, 3661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1799); + __Pyx_GIVEREF(__pyx_tuple__1799); + + /* "talib/_stream.pxi":3663 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1800 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1800)) __PYX_ERR(3, 3663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1800); + __Pyx_GIVEREF(__pyx_tuple__1800); + + /* "talib/_stream.pxi":3668 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1801 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1801)) __PYX_ERR(3, 3668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1801); + __Pyx_GIVEREF(__pyx_tuple__1801); + + /* "talib/_stream.pxi":3670 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1802 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1802)) __PYX_ERR(3, 3670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1802); + __Pyx_GIVEREF(__pyx_tuple__1802); + + /* "talib/_stream.pxi":3675 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1803 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1803)) __PYX_ERR(3, 3675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1803); + __Pyx_GIVEREF(__pyx_tuple__1803); + + /* "talib/_stream.pxi":3677 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1804 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1804)) __PYX_ERR(3, 3677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1804); + __Pyx_GIVEREF(__pyx_tuple__1804); + + /* "talib/_stream.pxi":3683 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1805 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1805)) __PYX_ERR(3, 3683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1805); + __Pyx_GIVEREF(__pyx_tuple__1805); + + /* "talib/_stream.pxi":3685 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1806 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1806)) __PYX_ERR(3, 3685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1806); + __Pyx_GIVEREF(__pyx_tuple__1806); + + /* "talib/_stream.pxi":3687 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1807 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1807)) __PYX_ERR(3, 3687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1807); + __Pyx_GIVEREF(__pyx_tuple__1807); + + /* "talib/_stream.pxi":3718 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1808 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1808)) __PYX_ERR(3, 3718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1808); + __Pyx_GIVEREF(__pyx_tuple__1808); + + /* "talib/_stream.pxi":3720 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1809 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1809)) __PYX_ERR(3, 3720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1809); + __Pyx_GIVEREF(__pyx_tuple__1809); + + /* "talib/_stream.pxi":3725 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1810 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1810)) __PYX_ERR(3, 3725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1810); + __Pyx_GIVEREF(__pyx_tuple__1810); + + /* "talib/_stream.pxi":3727 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1811 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1811)) __PYX_ERR(3, 3727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1811); + __Pyx_GIVEREF(__pyx_tuple__1811); + + /* "talib/_stream.pxi":3732 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1812 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1812)) __PYX_ERR(3, 3732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1812); + __Pyx_GIVEREF(__pyx_tuple__1812); + + /* "talib/_stream.pxi":3734 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1813 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1813)) __PYX_ERR(3, 3734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1813); + __Pyx_GIVEREF(__pyx_tuple__1813); + + /* "talib/_stream.pxi":3739 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1814 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1814)) __PYX_ERR(3, 3739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1814); + __Pyx_GIVEREF(__pyx_tuple__1814); + + /* "talib/_stream.pxi":3741 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1815 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1815)) __PYX_ERR(3, 3741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1815); + __Pyx_GIVEREF(__pyx_tuple__1815); + + /* "talib/_stream.pxi":3747 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1816 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1816)) __PYX_ERR(3, 3747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1816); + __Pyx_GIVEREF(__pyx_tuple__1816); + + /* "talib/_stream.pxi":3749 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1817 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1817)) __PYX_ERR(3, 3749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1817); + __Pyx_GIVEREF(__pyx_tuple__1817); + + /* "talib/_stream.pxi":3751 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1818 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1818)) __PYX_ERR(3, 3751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1818); + __Pyx_GIVEREF(__pyx_tuple__1818); + + /* "talib/_stream.pxi":3782 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1819 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1819)) __PYX_ERR(3, 3782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1819); + __Pyx_GIVEREF(__pyx_tuple__1819); + + /* "talib/_stream.pxi":3784 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1820 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1820)) __PYX_ERR(3, 3784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1820); + __Pyx_GIVEREF(__pyx_tuple__1820); + + /* "talib/_stream.pxi":3789 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1821 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1821)) __PYX_ERR(3, 3789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1821); + __Pyx_GIVEREF(__pyx_tuple__1821); + + /* "talib/_stream.pxi":3791 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1822 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1822)) __PYX_ERR(3, 3791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1822); + __Pyx_GIVEREF(__pyx_tuple__1822); + + /* "talib/_stream.pxi":3796 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1823 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1823)) __PYX_ERR(3, 3796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1823); + __Pyx_GIVEREF(__pyx_tuple__1823); + + /* "talib/_stream.pxi":3798 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1824 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1824)) __PYX_ERR(3, 3798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1824); + __Pyx_GIVEREF(__pyx_tuple__1824); + + /* "talib/_stream.pxi":3803 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1825 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1825)) __PYX_ERR(3, 3803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1825); + __Pyx_GIVEREF(__pyx_tuple__1825); + + /* "talib/_stream.pxi":3805 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1826 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1826)) __PYX_ERR(3, 3805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1826); + __Pyx_GIVEREF(__pyx_tuple__1826); + + /* "talib/_stream.pxi":3811 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1827 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1827)) __PYX_ERR(3, 3811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1827); + __Pyx_GIVEREF(__pyx_tuple__1827); + + /* "talib/_stream.pxi":3813 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1828 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1828)) __PYX_ERR(3, 3813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1828); + __Pyx_GIVEREF(__pyx_tuple__1828); + + /* "talib/_stream.pxi":3815 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1829 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1829)) __PYX_ERR(3, 3815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1829); + __Pyx_GIVEREF(__pyx_tuple__1829); + + /* "talib/_stream.pxi":3846 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1830 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1830)) __PYX_ERR(3, 3846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1830); + __Pyx_GIVEREF(__pyx_tuple__1830); + + /* "talib/_stream.pxi":3848 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1831 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1831)) __PYX_ERR(3, 3848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1831); + __Pyx_GIVEREF(__pyx_tuple__1831); + + /* "talib/_stream.pxi":3853 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1832 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1832)) __PYX_ERR(3, 3853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1832); + __Pyx_GIVEREF(__pyx_tuple__1832); + + /* "talib/_stream.pxi":3855 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1833 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1833)) __PYX_ERR(3, 3855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1833); + __Pyx_GIVEREF(__pyx_tuple__1833); + + /* "talib/_stream.pxi":3860 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1834 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1834)) __PYX_ERR(3, 3860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1834); + __Pyx_GIVEREF(__pyx_tuple__1834); + + /* "talib/_stream.pxi":3862 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1835 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1835)) __PYX_ERR(3, 3862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1835); + __Pyx_GIVEREF(__pyx_tuple__1835); + + /* "talib/_stream.pxi":3867 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1836 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1836)) __PYX_ERR(3, 3867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1836); + __Pyx_GIVEREF(__pyx_tuple__1836); + + /* "talib/_stream.pxi":3869 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1837 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1837)) __PYX_ERR(3, 3869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1837); + __Pyx_GIVEREF(__pyx_tuple__1837); + + /* "talib/_stream.pxi":3875 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1838 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1838)) __PYX_ERR(3, 3875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1838); + __Pyx_GIVEREF(__pyx_tuple__1838); + + /* "talib/_stream.pxi":3877 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1839 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1839)) __PYX_ERR(3, 3877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1839); + __Pyx_GIVEREF(__pyx_tuple__1839); + + /* "talib/_stream.pxi":3879 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1840 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1840)) __PYX_ERR(3, 3879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1840); + __Pyx_GIVEREF(__pyx_tuple__1840); + + /* "talib/_stream.pxi":3910 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1841 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1841)) __PYX_ERR(3, 3910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1841); + __Pyx_GIVEREF(__pyx_tuple__1841); + + /* "talib/_stream.pxi":3912 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1842 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1842)) __PYX_ERR(3, 3912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1842); + __Pyx_GIVEREF(__pyx_tuple__1842); + + /* "talib/_stream.pxi":3917 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1843 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1843)) __PYX_ERR(3, 3917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1843); + __Pyx_GIVEREF(__pyx_tuple__1843); + + /* "talib/_stream.pxi":3919 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1844 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1844)) __PYX_ERR(3, 3919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1844); + __Pyx_GIVEREF(__pyx_tuple__1844); + + /* "talib/_stream.pxi":3924 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1845 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1845)) __PYX_ERR(3, 3924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1845); + __Pyx_GIVEREF(__pyx_tuple__1845); + + /* "talib/_stream.pxi":3926 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1846 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1846)) __PYX_ERR(3, 3926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1846); + __Pyx_GIVEREF(__pyx_tuple__1846); + + /* "talib/_stream.pxi":3931 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1847 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1847)) __PYX_ERR(3, 3931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1847); + __Pyx_GIVEREF(__pyx_tuple__1847); + + /* "talib/_stream.pxi":3933 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1848 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1848)) __PYX_ERR(3, 3933, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1848); + __Pyx_GIVEREF(__pyx_tuple__1848); + + /* "talib/_stream.pxi":3939 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1849 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1849)) __PYX_ERR(3, 3939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1849); + __Pyx_GIVEREF(__pyx_tuple__1849); + + /* "talib/_stream.pxi":3941 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1850 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1850)) __PYX_ERR(3, 3941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1850); + __Pyx_GIVEREF(__pyx_tuple__1850); + + /* "talib/_stream.pxi":3943 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1851 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1851)) __PYX_ERR(3, 3943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1851); + __Pyx_GIVEREF(__pyx_tuple__1851); + + /* "talib/_stream.pxi":3974 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1852 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1852)) __PYX_ERR(3, 3974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1852); + __Pyx_GIVEREF(__pyx_tuple__1852); + + /* "talib/_stream.pxi":3976 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1853 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1853)) __PYX_ERR(3, 3976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1853); + __Pyx_GIVEREF(__pyx_tuple__1853); + + /* "talib/_stream.pxi":3981 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1854 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1854)) __PYX_ERR(3, 3981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1854); + __Pyx_GIVEREF(__pyx_tuple__1854); + + /* "talib/_stream.pxi":3983 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1855 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1855)) __PYX_ERR(3, 3983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1855); + __Pyx_GIVEREF(__pyx_tuple__1855); + + /* "talib/_stream.pxi":3988 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1856 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1856)) __PYX_ERR(3, 3988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1856); + __Pyx_GIVEREF(__pyx_tuple__1856); + + /* "talib/_stream.pxi":3990 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1857 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1857)) __PYX_ERR(3, 3990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1857); + __Pyx_GIVEREF(__pyx_tuple__1857); + + /* "talib/_stream.pxi":3995 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1858 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1858)) __PYX_ERR(3, 3995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1858); + __Pyx_GIVEREF(__pyx_tuple__1858); + + /* "talib/_stream.pxi":3997 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1859 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1859)) __PYX_ERR(3, 3997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1859); + __Pyx_GIVEREF(__pyx_tuple__1859); + + /* "talib/_stream.pxi":4003 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1860 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1860)) __PYX_ERR(3, 4003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1860); + __Pyx_GIVEREF(__pyx_tuple__1860); + + /* "talib/_stream.pxi":4005 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1861 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1861)) __PYX_ERR(3, 4005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1861); + __Pyx_GIVEREF(__pyx_tuple__1861); + + /* "talib/_stream.pxi":4007 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1862 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1862)) __PYX_ERR(3, 4007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1862); + __Pyx_GIVEREF(__pyx_tuple__1862); + + /* "talib/_stream.pxi":4038 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1863 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1863)) __PYX_ERR(3, 4038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1863); + __Pyx_GIVEREF(__pyx_tuple__1863); + + /* "talib/_stream.pxi":4040 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1864 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1864)) __PYX_ERR(3, 4040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1864); + __Pyx_GIVEREF(__pyx_tuple__1864); + + /* "talib/_stream.pxi":4045 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1865 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1865)) __PYX_ERR(3, 4045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1865); + __Pyx_GIVEREF(__pyx_tuple__1865); + + /* "talib/_stream.pxi":4047 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1866 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1866)) __PYX_ERR(3, 4047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1866); + __Pyx_GIVEREF(__pyx_tuple__1866); + + /* "talib/_stream.pxi":4052 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1867 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1867)) __PYX_ERR(3, 4052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1867); + __Pyx_GIVEREF(__pyx_tuple__1867); + + /* "talib/_stream.pxi":4054 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1868 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1868)) __PYX_ERR(3, 4054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1868); + __Pyx_GIVEREF(__pyx_tuple__1868); + + /* "talib/_stream.pxi":4059 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1869 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1869)) __PYX_ERR(3, 4059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1869); + __Pyx_GIVEREF(__pyx_tuple__1869); + + /* "talib/_stream.pxi":4061 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1870 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1870)) __PYX_ERR(3, 4061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1870); + __Pyx_GIVEREF(__pyx_tuple__1870); + + /* "talib/_stream.pxi":4067 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1871 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1871)) __PYX_ERR(3, 4067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1871); + __Pyx_GIVEREF(__pyx_tuple__1871); + + /* "talib/_stream.pxi":4069 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1872 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1872)) __PYX_ERR(3, 4069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1872); + __Pyx_GIVEREF(__pyx_tuple__1872); + + /* "talib/_stream.pxi":4071 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1873 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1873)) __PYX_ERR(3, 4071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1873); + __Pyx_GIVEREF(__pyx_tuple__1873); + + /* "talib/_stream.pxi":4102 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1874 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1874)) __PYX_ERR(3, 4102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1874); + __Pyx_GIVEREF(__pyx_tuple__1874); + + /* "talib/_stream.pxi":4104 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1875 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1875)) __PYX_ERR(3, 4104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1875); + __Pyx_GIVEREF(__pyx_tuple__1875); + + /* "talib/_stream.pxi":4109 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1876 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1876)) __PYX_ERR(3, 4109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1876); + __Pyx_GIVEREF(__pyx_tuple__1876); + + /* "talib/_stream.pxi":4111 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1877 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1877)) __PYX_ERR(3, 4111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1877); + __Pyx_GIVEREF(__pyx_tuple__1877); + + /* "talib/_stream.pxi":4116 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1878 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1878)) __PYX_ERR(3, 4116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1878); + __Pyx_GIVEREF(__pyx_tuple__1878); + + /* "talib/_stream.pxi":4118 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1879 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1879)) __PYX_ERR(3, 4118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1879); + __Pyx_GIVEREF(__pyx_tuple__1879); + + /* "talib/_stream.pxi":4123 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1880 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1880)) __PYX_ERR(3, 4123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1880); + __Pyx_GIVEREF(__pyx_tuple__1880); + + /* "talib/_stream.pxi":4125 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1881 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1881)) __PYX_ERR(3, 4125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1881); + __Pyx_GIVEREF(__pyx_tuple__1881); + + /* "talib/_stream.pxi":4131 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1882 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1882)) __PYX_ERR(3, 4131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1882); + __Pyx_GIVEREF(__pyx_tuple__1882); + + /* "talib/_stream.pxi":4133 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1883 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1883)) __PYX_ERR(3, 4133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1883); + __Pyx_GIVEREF(__pyx_tuple__1883); + + /* "talib/_stream.pxi":4135 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1884 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1884)) __PYX_ERR(3, 4135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1884); + __Pyx_GIVEREF(__pyx_tuple__1884); + + /* "talib/_stream.pxi":4166 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1885 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1885)) __PYX_ERR(3, 4166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1885); + __Pyx_GIVEREF(__pyx_tuple__1885); + + /* "talib/_stream.pxi":4168 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1886 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1886)) __PYX_ERR(3, 4168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1886); + __Pyx_GIVEREF(__pyx_tuple__1886); + + /* "talib/_stream.pxi":4173 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1887 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1887)) __PYX_ERR(3, 4173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1887); + __Pyx_GIVEREF(__pyx_tuple__1887); + + /* "talib/_stream.pxi":4175 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1888 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1888)) __PYX_ERR(3, 4175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1888); + __Pyx_GIVEREF(__pyx_tuple__1888); + + /* "talib/_stream.pxi":4180 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1889 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1889)) __PYX_ERR(3, 4180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1889); + __Pyx_GIVEREF(__pyx_tuple__1889); + + /* "talib/_stream.pxi":4182 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1890 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1890)) __PYX_ERR(3, 4182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1890); + __Pyx_GIVEREF(__pyx_tuple__1890); + + /* "talib/_stream.pxi":4187 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1891 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1891)) __PYX_ERR(3, 4187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1891); + __Pyx_GIVEREF(__pyx_tuple__1891); + + /* "talib/_stream.pxi":4189 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1892 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1892)) __PYX_ERR(3, 4189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1892); + __Pyx_GIVEREF(__pyx_tuple__1892); + + /* "talib/_stream.pxi":4195 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1893 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1893)) __PYX_ERR(3, 4195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1893); + __Pyx_GIVEREF(__pyx_tuple__1893); + + /* "talib/_stream.pxi":4197 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1894 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1894)) __PYX_ERR(3, 4197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1894); + __Pyx_GIVEREF(__pyx_tuple__1894); + + /* "talib/_stream.pxi":4199 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1895 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1895)) __PYX_ERR(3, 4199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1895); + __Pyx_GIVEREF(__pyx_tuple__1895); + + /* "talib/_stream.pxi":4230 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1896 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1896)) __PYX_ERR(3, 4230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1896); + __Pyx_GIVEREF(__pyx_tuple__1896); + + /* "talib/_stream.pxi":4232 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1897 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1897)) __PYX_ERR(3, 4232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1897); + __Pyx_GIVEREF(__pyx_tuple__1897); + + /* "talib/_stream.pxi":4237 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1898 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1898)) __PYX_ERR(3, 4237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1898); + __Pyx_GIVEREF(__pyx_tuple__1898); + + /* "talib/_stream.pxi":4239 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1899 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1899)) __PYX_ERR(3, 4239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1899); + __Pyx_GIVEREF(__pyx_tuple__1899); + + /* "talib/_stream.pxi":4244 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1900 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1900)) __PYX_ERR(3, 4244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1900); + __Pyx_GIVEREF(__pyx_tuple__1900); + + /* "talib/_stream.pxi":4246 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1901 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1901)) __PYX_ERR(3, 4246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1901); + __Pyx_GIVEREF(__pyx_tuple__1901); + + /* "talib/_stream.pxi":4251 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1902 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1902)) __PYX_ERR(3, 4251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1902); + __Pyx_GIVEREF(__pyx_tuple__1902); + + /* "talib/_stream.pxi":4253 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1903 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1903)) __PYX_ERR(3, 4253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1903); + __Pyx_GIVEREF(__pyx_tuple__1903); + + /* "talib/_stream.pxi":4259 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1904 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1904)) __PYX_ERR(3, 4259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1904); + __Pyx_GIVEREF(__pyx_tuple__1904); + + /* "talib/_stream.pxi":4261 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1905 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1905)) __PYX_ERR(3, 4261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1905); + __Pyx_GIVEREF(__pyx_tuple__1905); + + /* "talib/_stream.pxi":4263 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1906 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1906)) __PYX_ERR(3, 4263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1906); + __Pyx_GIVEREF(__pyx_tuple__1906); + + /* "talib/_stream.pxi":4294 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1907 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1907)) __PYX_ERR(3, 4294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1907); + __Pyx_GIVEREF(__pyx_tuple__1907); + + /* "talib/_stream.pxi":4296 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1908 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1908)) __PYX_ERR(3, 4296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1908); + __Pyx_GIVEREF(__pyx_tuple__1908); + + /* "talib/_stream.pxi":4301 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1909 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1909)) __PYX_ERR(3, 4301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1909); + __Pyx_GIVEREF(__pyx_tuple__1909); + + /* "talib/_stream.pxi":4303 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1910 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1910)) __PYX_ERR(3, 4303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1910); + __Pyx_GIVEREF(__pyx_tuple__1910); + + /* "talib/_stream.pxi":4308 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1911 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1911)) __PYX_ERR(3, 4308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1911); + __Pyx_GIVEREF(__pyx_tuple__1911); + + /* "talib/_stream.pxi":4310 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1912 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1912)) __PYX_ERR(3, 4310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1912); + __Pyx_GIVEREF(__pyx_tuple__1912); + + /* "talib/_stream.pxi":4315 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1913 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1913)) __PYX_ERR(3, 4315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1913); + __Pyx_GIVEREF(__pyx_tuple__1913); + + /* "talib/_stream.pxi":4317 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1914 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1914)) __PYX_ERR(3, 4317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1914); + __Pyx_GIVEREF(__pyx_tuple__1914); + + /* "talib/_stream.pxi":4323 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1915 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1915)) __PYX_ERR(3, 4323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1915); + __Pyx_GIVEREF(__pyx_tuple__1915); + + /* "talib/_stream.pxi":4325 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1916 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1916)) __PYX_ERR(3, 4325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1916); + __Pyx_GIVEREF(__pyx_tuple__1916); + + /* "talib/_stream.pxi":4327 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1917 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1917)) __PYX_ERR(3, 4327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1917); + __Pyx_GIVEREF(__pyx_tuple__1917); + + /* "talib/_stream.pxi":4358 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1918 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1918)) __PYX_ERR(3, 4358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1918); + __Pyx_GIVEREF(__pyx_tuple__1918); + + /* "talib/_stream.pxi":4360 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1919 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1919)) __PYX_ERR(3, 4360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1919); + __Pyx_GIVEREF(__pyx_tuple__1919); + + /* "talib/_stream.pxi":4365 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1920 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1920)) __PYX_ERR(3, 4365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1920); + __Pyx_GIVEREF(__pyx_tuple__1920); + + /* "talib/_stream.pxi":4367 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1921 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1921)) __PYX_ERR(3, 4367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1921); + __Pyx_GIVEREF(__pyx_tuple__1921); + + /* "talib/_stream.pxi":4372 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1922 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1922)) __PYX_ERR(3, 4372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1922); + __Pyx_GIVEREF(__pyx_tuple__1922); + + /* "talib/_stream.pxi":4374 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1923 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1923)) __PYX_ERR(3, 4374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1923); + __Pyx_GIVEREF(__pyx_tuple__1923); + + /* "talib/_stream.pxi":4379 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1924 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1924)) __PYX_ERR(3, 4379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1924); + __Pyx_GIVEREF(__pyx_tuple__1924); + + /* "talib/_stream.pxi":4381 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1925 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1925)) __PYX_ERR(3, 4381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1925); + __Pyx_GIVEREF(__pyx_tuple__1925); + + /* "talib/_stream.pxi":4387 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1926 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1926)) __PYX_ERR(3, 4387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1926); + __Pyx_GIVEREF(__pyx_tuple__1926); + + /* "talib/_stream.pxi":4389 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1927 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1927)) __PYX_ERR(3, 4389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1927); + __Pyx_GIVEREF(__pyx_tuple__1927); + + /* "talib/_stream.pxi":4391 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1928 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1928)) __PYX_ERR(3, 4391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1928); + __Pyx_GIVEREF(__pyx_tuple__1928); + + /* "talib/_stream.pxi":4422 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1929 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1929)) __PYX_ERR(3, 4422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1929); + __Pyx_GIVEREF(__pyx_tuple__1929); + + /* "talib/_stream.pxi":4424 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1930 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1930)) __PYX_ERR(3, 4424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1930); + __Pyx_GIVEREF(__pyx_tuple__1930); + + /* "talib/_stream.pxi":4429 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1931 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1931)) __PYX_ERR(3, 4429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1931); + __Pyx_GIVEREF(__pyx_tuple__1931); + + /* "talib/_stream.pxi":4431 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1932 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1932)) __PYX_ERR(3, 4431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1932); + __Pyx_GIVEREF(__pyx_tuple__1932); + + /* "talib/_stream.pxi":4436 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1933 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1933)) __PYX_ERR(3, 4436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1933); + __Pyx_GIVEREF(__pyx_tuple__1933); + + /* "talib/_stream.pxi":4438 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1934 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1934)) __PYX_ERR(3, 4438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1934); + __Pyx_GIVEREF(__pyx_tuple__1934); + + /* "talib/_stream.pxi":4443 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1935 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1935)) __PYX_ERR(3, 4443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1935); + __Pyx_GIVEREF(__pyx_tuple__1935); + + /* "talib/_stream.pxi":4445 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1936 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1936)) __PYX_ERR(3, 4445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1936); + __Pyx_GIVEREF(__pyx_tuple__1936); + + /* "talib/_stream.pxi":4451 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1937 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1937)) __PYX_ERR(3, 4451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1937); + __Pyx_GIVEREF(__pyx_tuple__1937); + + /* "talib/_stream.pxi":4453 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1938 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1938)) __PYX_ERR(3, 4453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1938); + __Pyx_GIVEREF(__pyx_tuple__1938); + + /* "talib/_stream.pxi":4455 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1939 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1939)) __PYX_ERR(3, 4455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1939); + __Pyx_GIVEREF(__pyx_tuple__1939); + + /* "talib/_stream.pxi":4486 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1940 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1940)) __PYX_ERR(3, 4486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1940); + __Pyx_GIVEREF(__pyx_tuple__1940); + + /* "talib/_stream.pxi":4488 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1941 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1941)) __PYX_ERR(3, 4488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1941); + __Pyx_GIVEREF(__pyx_tuple__1941); + + /* "talib/_stream.pxi":4493 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1942 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1942)) __PYX_ERR(3, 4493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1942); + __Pyx_GIVEREF(__pyx_tuple__1942); + + /* "talib/_stream.pxi":4495 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1943 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1943)) __PYX_ERR(3, 4495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1943); + __Pyx_GIVEREF(__pyx_tuple__1943); + + /* "talib/_stream.pxi":4500 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1944 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1944)) __PYX_ERR(3, 4500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1944); + __Pyx_GIVEREF(__pyx_tuple__1944); + + /* "talib/_stream.pxi":4502 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1945 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1945)) __PYX_ERR(3, 4502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1945); + __Pyx_GIVEREF(__pyx_tuple__1945); + + /* "talib/_stream.pxi":4507 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1946 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1946)) __PYX_ERR(3, 4507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1946); + __Pyx_GIVEREF(__pyx_tuple__1946); + + /* "talib/_stream.pxi":4509 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1947 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1947)) __PYX_ERR(3, 4509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1947); + __Pyx_GIVEREF(__pyx_tuple__1947); + + /* "talib/_stream.pxi":4515 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1948 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1948)) __PYX_ERR(3, 4515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1948); + __Pyx_GIVEREF(__pyx_tuple__1948); + + /* "talib/_stream.pxi":4517 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1949 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1949)) __PYX_ERR(3, 4517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1949); + __Pyx_GIVEREF(__pyx_tuple__1949); + + /* "talib/_stream.pxi":4519 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1950 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1950)) __PYX_ERR(3, 4519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1950); + __Pyx_GIVEREF(__pyx_tuple__1950); + + /* "talib/_stream.pxi":4550 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1951 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1951)) __PYX_ERR(3, 4550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1951); + __Pyx_GIVEREF(__pyx_tuple__1951); + + /* "talib/_stream.pxi":4552 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1952 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1952)) __PYX_ERR(3, 4552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1952); + __Pyx_GIVEREF(__pyx_tuple__1952); + + /* "talib/_stream.pxi":4557 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1953 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1953)) __PYX_ERR(3, 4557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1953); + __Pyx_GIVEREF(__pyx_tuple__1953); + + /* "talib/_stream.pxi":4559 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1954 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1954)) __PYX_ERR(3, 4559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1954); + __Pyx_GIVEREF(__pyx_tuple__1954); + + /* "talib/_stream.pxi":4564 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1955 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1955)) __PYX_ERR(3, 4564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1955); + __Pyx_GIVEREF(__pyx_tuple__1955); + + /* "talib/_stream.pxi":4566 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1956 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1956)) __PYX_ERR(3, 4566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1956); + __Pyx_GIVEREF(__pyx_tuple__1956); + + /* "talib/_stream.pxi":4571 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1957 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1957)) __PYX_ERR(3, 4571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1957); + __Pyx_GIVEREF(__pyx_tuple__1957); + + /* "talib/_stream.pxi":4573 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1958 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1958)) __PYX_ERR(3, 4573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1958); + __Pyx_GIVEREF(__pyx_tuple__1958); + + /* "talib/_stream.pxi":4579 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1959 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1959)) __PYX_ERR(3, 4579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1959); + __Pyx_GIVEREF(__pyx_tuple__1959); + + /* "talib/_stream.pxi":4581 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1960 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1960)) __PYX_ERR(3, 4581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1960); + __Pyx_GIVEREF(__pyx_tuple__1960); + + /* "talib/_stream.pxi":4583 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1961 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1961)) __PYX_ERR(3, 4583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1961); + __Pyx_GIVEREF(__pyx_tuple__1961); + + /* "talib/_stream.pxi":4614 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1962 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1962)) __PYX_ERR(3, 4614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1962); + __Pyx_GIVEREF(__pyx_tuple__1962); + + /* "talib/_stream.pxi":4616 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1963 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1963)) __PYX_ERR(3, 4616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1963); + __Pyx_GIVEREF(__pyx_tuple__1963); + + /* "talib/_stream.pxi":4621 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1964 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1964)) __PYX_ERR(3, 4621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1964); + __Pyx_GIVEREF(__pyx_tuple__1964); + + /* "talib/_stream.pxi":4623 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1965 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1965)) __PYX_ERR(3, 4623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1965); + __Pyx_GIVEREF(__pyx_tuple__1965); + + /* "talib/_stream.pxi":4628 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1966 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1966)) __PYX_ERR(3, 4628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1966); + __Pyx_GIVEREF(__pyx_tuple__1966); + + /* "talib/_stream.pxi":4630 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1967 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1967)) __PYX_ERR(3, 4630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1967); + __Pyx_GIVEREF(__pyx_tuple__1967); + + /* "talib/_stream.pxi":4635 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1968 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1968)) __PYX_ERR(3, 4635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1968); + __Pyx_GIVEREF(__pyx_tuple__1968); + + /* "talib/_stream.pxi":4637 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1969 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1969)) __PYX_ERR(3, 4637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1969); + __Pyx_GIVEREF(__pyx_tuple__1969); + + /* "talib/_stream.pxi":4643 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1970 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1970)) __PYX_ERR(3, 4643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1970); + __Pyx_GIVEREF(__pyx_tuple__1970); + + /* "talib/_stream.pxi":4645 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1971 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1971)) __PYX_ERR(3, 4645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1971); + __Pyx_GIVEREF(__pyx_tuple__1971); + + /* "talib/_stream.pxi":4647 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1972 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1972)) __PYX_ERR(3, 4647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1972); + __Pyx_GIVEREF(__pyx_tuple__1972); + + /* "talib/_stream.pxi":4678 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1973 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1973)) __PYX_ERR(3, 4678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1973); + __Pyx_GIVEREF(__pyx_tuple__1973); + + /* "talib/_stream.pxi":4680 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1974 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1974)) __PYX_ERR(3, 4680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1974); + __Pyx_GIVEREF(__pyx_tuple__1974); + + /* "talib/_stream.pxi":4685 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1975 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1975)) __PYX_ERR(3, 4685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1975); + __Pyx_GIVEREF(__pyx_tuple__1975); + + /* "talib/_stream.pxi":4687 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1976 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1976)) __PYX_ERR(3, 4687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1976); + __Pyx_GIVEREF(__pyx_tuple__1976); + + /* "talib/_stream.pxi":4692 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1977 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1977)) __PYX_ERR(3, 4692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1977); + __Pyx_GIVEREF(__pyx_tuple__1977); + + /* "talib/_stream.pxi":4694 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1978 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1978)) __PYX_ERR(3, 4694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1978); + __Pyx_GIVEREF(__pyx_tuple__1978); + + /* "talib/_stream.pxi":4699 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1979 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1979)) __PYX_ERR(3, 4699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1979); + __Pyx_GIVEREF(__pyx_tuple__1979); + + /* "talib/_stream.pxi":4701 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1980 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1980)) __PYX_ERR(3, 4701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1980); + __Pyx_GIVEREF(__pyx_tuple__1980); + + /* "talib/_stream.pxi":4707 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1981 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1981)) __PYX_ERR(3, 4707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1981); + __Pyx_GIVEREF(__pyx_tuple__1981); + + /* "talib/_stream.pxi":4709 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1982 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1982)) __PYX_ERR(3, 4709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1982); + __Pyx_GIVEREF(__pyx_tuple__1982); + + /* "talib/_stream.pxi":4711 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1983 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1983)) __PYX_ERR(3, 4711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1983); + __Pyx_GIVEREF(__pyx_tuple__1983); + + /* "talib/_stream.pxi":4742 + * int outinteger + * if PyArray_TYPE(open) != np.NPY_DOUBLE: + * raise Exception("open is not double") # <<<<<<<<<<<<<< + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") + */ + __pyx_tuple__1984 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__1984)) __PYX_ERR(3, 4742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1984); + __Pyx_GIVEREF(__pyx_tuple__1984); + + /* "talib/_stream.pxi":4744 + * raise Exception("open is not double") + * if open.ndim != 1: + * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): + * open = PyArray_GETCONTIGUOUS(open) + */ + __pyx_tuple__1985 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1985)) __PYX_ERR(3, 4744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1985); + __Pyx_GIVEREF(__pyx_tuple__1985); + + /* "talib/_stream.pxi":4749 + * open_data = open.data + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__1986 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1986)) __PYX_ERR(3, 4749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1986); + __Pyx_GIVEREF(__pyx_tuple__1986); + + /* "talib/_stream.pxi":4751 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__1987 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1987)) __PYX_ERR(3, 4751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1987); + __Pyx_GIVEREF(__pyx_tuple__1987); + + /* "talib/_stream.pxi":4756 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__1988 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1988)) __PYX_ERR(3, 4756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1988); + __Pyx_GIVEREF(__pyx_tuple__1988); + + /* "talib/_stream.pxi":4758 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__1989 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1989)) __PYX_ERR(3, 4758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1989); + __Pyx_GIVEREF(__pyx_tuple__1989); + + /* "talib/_stream.pxi":4763 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__1990 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1990)) __PYX_ERR(3, 4763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1990); + __Pyx_GIVEREF(__pyx_tuple__1990); + + /* "talib/_stream.pxi":4765 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__1991 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1991)) __PYX_ERR(3, 4765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1991); + __Pyx_GIVEREF(__pyx_tuple__1991); + + /* "talib/_stream.pxi":4771 + * length = open.shape[0] + * if length != high.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != low.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1992 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1992)) __PYX_ERR(3, 4771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1992); + __Pyx_GIVEREF(__pyx_tuple__1992); + + /* "talib/_stream.pxi":4773 + * raise Exception("input lengths are different") + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__1993 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1993)) __PYX_ERR(3, 4773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1993); + __Pyx_GIVEREF(__pyx_tuple__1993); + + /* "talib/_stream.pxi":4775 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outinteger = 0 + * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) + */ + __pyx_tuple__1994 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1994)) __PYX_ERR(3, 4775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1994); + __Pyx_GIVEREF(__pyx_tuple__1994); + + /* "talib/_stream.pxi":4803 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1995 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1995)) __PYX_ERR(3, 4803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1995); + __Pyx_GIVEREF(__pyx_tuple__1995); + + /* "talib/_stream.pxi":4805 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1996 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1996)) __PYX_ERR(3, 4805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1996); + __Pyx_GIVEREF(__pyx_tuple__1996); + + /* "talib/_stream.pxi":4839 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__1997 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1997)) __PYX_ERR(3, 4839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1997); + __Pyx_GIVEREF(__pyx_tuple__1997); + + /* "talib/_stream.pxi":4841 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__1998 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1998)) __PYX_ERR(3, 4841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1998); + __Pyx_GIVEREF(__pyx_tuple__1998); + + /* "talib/_stream.pxi":4877 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__1999 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1999)) __PYX_ERR(3, 4877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__1999); + __Pyx_GIVEREF(__pyx_tuple__1999); + + /* "talib/_stream.pxi":4879 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__2000 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2000)) __PYX_ERR(3, 4879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2000); + __Pyx_GIVEREF(__pyx_tuple__2000); + + /* "talib/_stream.pxi":4884 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__2001 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__2001)) __PYX_ERR(3, 4884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2001); + __Pyx_GIVEREF(__pyx_tuple__2001); + + /* "talib/_stream.pxi":4886 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__2002 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2002)) __PYX_ERR(3, 4886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2002); + __Pyx_GIVEREF(__pyx_tuple__2002); + + /* "talib/_stream.pxi":4892 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2003 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2003)) __PYX_ERR(3, 4892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2003); + __Pyx_GIVEREF(__pyx_tuple__2003); + + /* "talib/_stream.pxi":4920 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2004 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2004)) __PYX_ERR(3, 4920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2004); + __Pyx_GIVEREF(__pyx_tuple__2004); + + /* "talib/_stream.pxi":4922 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2005 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2005)) __PYX_ERR(3, 4922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2005); + __Pyx_GIVEREF(__pyx_tuple__2005); + + /* "talib/_stream.pxi":4954 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2006 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2006)) __PYX_ERR(3, 4954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2006); + __Pyx_GIVEREF(__pyx_tuple__2006); + + /* "talib/_stream.pxi":4956 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2007 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2007)) __PYX_ERR(3, 4956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2007); + __Pyx_GIVEREF(__pyx_tuple__2007); + + /* "talib/_stream.pxi":4990 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2008 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2008)) __PYX_ERR(3, 4990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2008); + __Pyx_GIVEREF(__pyx_tuple__2008); + + /* "talib/_stream.pxi":4992 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2009 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2009)) __PYX_ERR(3, 4992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2009); + __Pyx_GIVEREF(__pyx_tuple__2009); + + /* "talib/_stream.pxi":5026 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__2010 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__2010)) __PYX_ERR(3, 5026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2010); + __Pyx_GIVEREF(__pyx_tuple__2010); + + /* "talib/_stream.pxi":5028 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__2011 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2011)) __PYX_ERR(3, 5028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2011); + __Pyx_GIVEREF(__pyx_tuple__2011); + + /* "talib/_stream.pxi":5033 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__2012 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__2012)) __PYX_ERR(3, 5033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2012); + __Pyx_GIVEREF(__pyx_tuple__2012); + + /* "talib/_stream.pxi":5035 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__2013 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2013)) __PYX_ERR(3, 5035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2013); + __Pyx_GIVEREF(__pyx_tuple__2013); + + /* "talib/_stream.pxi":5041 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2014 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2014)) __PYX_ERR(3, 5041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2014); + __Pyx_GIVEREF(__pyx_tuple__2014); + + /* "talib/_stream.pxi":5073 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2015 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2015)) __PYX_ERR(3, 5073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2015); + __Pyx_GIVEREF(__pyx_tuple__2015); + + /* "talib/_stream.pxi":5075 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2016 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2016)) __PYX_ERR(3, 5075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2016); + __Pyx_GIVEREF(__pyx_tuple__2016); + + /* "talib/_stream.pxi":5080 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2017 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2017)) __PYX_ERR(3, 5080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2017); + __Pyx_GIVEREF(__pyx_tuple__2017); + + /* "talib/_stream.pxi":5082 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2018 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2018)) __PYX_ERR(3, 5082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2018); + __Pyx_GIVEREF(__pyx_tuple__2018); + + /* "talib/_stream.pxi":5087 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2019 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2019)) __PYX_ERR(3, 5087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2019); + __Pyx_GIVEREF(__pyx_tuple__2019); + + /* "talib/_stream.pxi":5089 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2020 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2020)) __PYX_ERR(3, 5089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2020); + __Pyx_GIVEREF(__pyx_tuple__2020); + + /* "talib/_stream.pxi":5095 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2021 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2021)) __PYX_ERR(3, 5095, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2021); + __Pyx_GIVEREF(__pyx_tuple__2021); + + /* "talib/_stream.pxi":5097 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2022 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2022)) __PYX_ERR(3, 5097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2022); + __Pyx_GIVEREF(__pyx_tuple__2022); + + /* "talib/_stream.pxi":5127 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2023 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2023)) __PYX_ERR(3, 5127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2023); + __Pyx_GIVEREF(__pyx_tuple__2023); + + /* "talib/_stream.pxi":5129 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2024 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2024)) __PYX_ERR(3, 5129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2024); + __Pyx_GIVEREF(__pyx_tuple__2024); + + /* "talib/_stream.pxi":5161 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2025 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2025)) __PYX_ERR(3, 5161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2025); + __Pyx_GIVEREF(__pyx_tuple__2025); + + /* "talib/_stream.pxi":5163 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2026 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2026)) __PYX_ERR(3, 5163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2026); + __Pyx_GIVEREF(__pyx_tuple__2026); + + /* "talib/_stream.pxi":5195 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2027 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2027)) __PYX_ERR(3, 5195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2027); + __Pyx_GIVEREF(__pyx_tuple__2027); + + /* "talib/_stream.pxi":5197 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2028 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2028)) __PYX_ERR(3, 5197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2028); + __Pyx_GIVEREF(__pyx_tuple__2028); + + /* "talib/_stream.pxi":5229 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2029 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2029)) __PYX_ERR(3, 5229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2029); + __Pyx_GIVEREF(__pyx_tuple__2029); + + /* "talib/_stream.pxi":5231 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2030 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2030)) __PYX_ERR(3, 5231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2030); + __Pyx_GIVEREF(__pyx_tuple__2030); + + /* "talib/_stream.pxi":5263 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2031 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2031)) __PYX_ERR(3, 5263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2031); + __Pyx_GIVEREF(__pyx_tuple__2031); + + /* "talib/_stream.pxi":5265 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2032 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2032)) __PYX_ERR(3, 5265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2032); + __Pyx_GIVEREF(__pyx_tuple__2032); + + /* "talib/_stream.pxi":5299 + * double outquadrature + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2033 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2033)) __PYX_ERR(3, 5299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2033); + __Pyx_GIVEREF(__pyx_tuple__2033); + + /* "talib/_stream.pxi":5301 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2034 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2034)) __PYX_ERR(3, 5301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2034); + __Pyx_GIVEREF(__pyx_tuple__2034); + + /* "talib/_stream.pxi":5336 + * double outleadsine + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2035 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2035)) __PYX_ERR(3, 5336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2035); + __Pyx_GIVEREF(__pyx_tuple__2035); + + /* "talib/_stream.pxi":5338 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2036 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2036)) __PYX_ERR(3, 5338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2036); + __Pyx_GIVEREF(__pyx_tuple__2036); + + /* "talib/_stream.pxi":5371 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2037 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2037)) __PYX_ERR(3, 5371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2037); + __Pyx_GIVEREF(__pyx_tuple__2037); + + /* "talib/_stream.pxi":5373 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2038 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2038)) __PYX_ERR(3, 5373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2038); + __Pyx_GIVEREF(__pyx_tuple__2038); + + /* "talib/_stream.pxi":5405 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2039 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2039)) __PYX_ERR(3, 5405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2039); + __Pyx_GIVEREF(__pyx_tuple__2039); + + /* "talib/_stream.pxi":5407 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2040 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2040)) __PYX_ERR(3, 5407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2040); + __Pyx_GIVEREF(__pyx_tuple__2040); + + /* "talib/_stream.pxi":5441 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2041 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2041)) __PYX_ERR(3, 5441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2041); + __Pyx_GIVEREF(__pyx_tuple__2041); + + /* "talib/_stream.pxi":5443 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2042 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2042)) __PYX_ERR(3, 5443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2042); + __Pyx_GIVEREF(__pyx_tuple__2042); + + /* "talib/_stream.pxi":5477 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2043 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2043)) __PYX_ERR(3, 5477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2043); + __Pyx_GIVEREF(__pyx_tuple__2043); + + /* "talib/_stream.pxi":5479 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2044 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2044)) __PYX_ERR(3, 5479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2044); + __Pyx_GIVEREF(__pyx_tuple__2044); + + /* "talib/_stream.pxi":5513 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2045 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2045)) __PYX_ERR(3, 5513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2045); + __Pyx_GIVEREF(__pyx_tuple__2045); + + /* "talib/_stream.pxi":5515 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2046 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2046)) __PYX_ERR(3, 5515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2046); + __Pyx_GIVEREF(__pyx_tuple__2046); + + /* "talib/_stream.pxi":5549 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2047 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2047)) __PYX_ERR(3, 5549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2047); + __Pyx_GIVEREF(__pyx_tuple__2047); + + /* "talib/_stream.pxi":5551 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2048 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2048)) __PYX_ERR(3, 5551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2048); + __Pyx_GIVEREF(__pyx_tuple__2048); + + /* "talib/_stream.pxi":5585 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2049 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2049)) __PYX_ERR(3, 5585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2049); + __Pyx_GIVEREF(__pyx_tuple__2049); + + /* "talib/_stream.pxi":5587 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2050 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2050)) __PYX_ERR(3, 5587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2050); + __Pyx_GIVEREF(__pyx_tuple__2050); + + /* "talib/_stream.pxi":5619 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2051 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2051)) __PYX_ERR(3, 5619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2051); + __Pyx_GIVEREF(__pyx_tuple__2051); + + /* "talib/_stream.pxi":5621 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2052 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2052)) __PYX_ERR(3, 5621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2052); + __Pyx_GIVEREF(__pyx_tuple__2052); + + /* "talib/_stream.pxi":5653 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2053 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2053)) __PYX_ERR(3, 5653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2053); + __Pyx_GIVEREF(__pyx_tuple__2053); + + /* "talib/_stream.pxi":5655 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2054 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2054)) __PYX_ERR(3, 5655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2054); + __Pyx_GIVEREF(__pyx_tuple__2054); + + /* "talib/_stream.pxi":5690 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2055 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2055)) __PYX_ERR(3, 5690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2055); + __Pyx_GIVEREF(__pyx_tuple__2055); + + /* "talib/_stream.pxi":5692 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2056 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2056)) __PYX_ERR(3, 5692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2056); + __Pyx_GIVEREF(__pyx_tuple__2056); + + /* "talib/_stream.pxi":5732 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2057 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2057)) __PYX_ERR(3, 5732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2057); + __Pyx_GIVEREF(__pyx_tuple__2057); + + /* "talib/_stream.pxi":5734 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2058 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2058)) __PYX_ERR(3, 5734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2058); + __Pyx_GIVEREF(__pyx_tuple__2058); + + /* "talib/_stream.pxi":5779 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2059 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2059)) __PYX_ERR(3, 5779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2059); + __Pyx_GIVEREF(__pyx_tuple__2059); + + /* "talib/_stream.pxi":5781 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2060 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2060)) __PYX_ERR(3, 5781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2060); + __Pyx_GIVEREF(__pyx_tuple__2060); + + /* "talib/_stream.pxi":5821 + * double outmacdhist + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2061 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2061)) __PYX_ERR(3, 5821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2061); + __Pyx_GIVEREF(__pyx_tuple__2061); + + /* "talib/_stream.pxi":5823 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2062 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2062)) __PYX_ERR(3, 5823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2062); + __Pyx_GIVEREF(__pyx_tuple__2062); + + /* "talib/_stream.pxi":5862 + * double outfama + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2063 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2063)) __PYX_ERR(3, 5862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2063); + __Pyx_GIVEREF(__pyx_tuple__2063); + + /* "talib/_stream.pxi":5864 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2064 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2064)) __PYX_ERR(3, 5864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2064); + __Pyx_GIVEREF(__pyx_tuple__2064); + + /* "talib/_stream.pxi":5903 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2065 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2065)) __PYX_ERR(3, 5903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2065); + __Pyx_GIVEREF(__pyx_tuple__2065); + + /* "talib/_stream.pxi":5905 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2066 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2066)) __PYX_ERR(3, 5905, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2066); + __Pyx_GIVEREF(__pyx_tuple__2066); + + /* "talib/_stream.pxi":5910 + * real_data = real.data + * if PyArray_TYPE(periods) != np.NPY_DOUBLE: + * raise Exception("periods is not double") # <<<<<<<<<<<<<< + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") + */ + __pyx_tuple__2067 = PyTuple_Pack(1, __pyx_kp_s_periods_is_not_double); if (unlikely(!__pyx_tuple__2067)) __PYX_ERR(3, 5910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2067); + __Pyx_GIVEREF(__pyx_tuple__2067); + + /* "talib/_stream.pxi":5912 + * raise Exception("periods is not double") + * if periods.ndim != 1: + * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): + * periods = PyArray_GETCONTIGUOUS(periods) + */ + __pyx_tuple__2068 = PyTuple_Pack(1, __pyx_kp_s_periods_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2068)) __PYX_ERR(3, 5912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2068); + __Pyx_GIVEREF(__pyx_tuple__2068); + + /* "talib/_stream.pxi":5918 + * length = real.shape[0] + * if length != periods.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2069 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2069)) __PYX_ERR(3, 5918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2069); + __Pyx_GIVEREF(__pyx_tuple__2069); + + /* "talib/_stream.pxi":5948 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2070 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2070)) __PYX_ERR(3, 5948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2070); + __Pyx_GIVEREF(__pyx_tuple__2070); + + /* "talib/_stream.pxi":5950 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2071 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2071)) __PYX_ERR(3, 5950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2071); + __Pyx_GIVEREF(__pyx_tuple__2071); + + /* "talib/_stream.pxi":5984 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2072 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2072)) __PYX_ERR(3, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2072); + __Pyx_GIVEREF(__pyx_tuple__2072); + + /* "talib/_stream.pxi":5986 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2073 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2073)) __PYX_ERR(3, 5986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2073); + __Pyx_GIVEREF(__pyx_tuple__2073); + + /* "talib/_stream.pxi":6019 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2074 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2074)) __PYX_ERR(3, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2074); + __Pyx_GIVEREF(__pyx_tuple__2074); + + /* "talib/_stream.pxi":6021 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2075 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2075)) __PYX_ERR(3, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2075); + __Pyx_GIVEREF(__pyx_tuple__2075); + + /* "talib/_stream.pxi":6026 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2076 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2076)) __PYX_ERR(3, 6026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2076); + __Pyx_GIVEREF(__pyx_tuple__2076); + + /* "talib/_stream.pxi":6028 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2077 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2077)) __PYX_ERR(3, 6028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2077); + __Pyx_GIVEREF(__pyx_tuple__2077); + + /* "talib/_stream.pxi":6034 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2078 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2078)) __PYX_ERR(3, 6034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2078); + __Pyx_GIVEREF(__pyx_tuple__2078); + + /* "talib/_stream.pxi":6067 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2079 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2079)) __PYX_ERR(3, 6067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2079); + __Pyx_GIVEREF(__pyx_tuple__2079); + + /* "talib/_stream.pxi":6069 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2080 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2080)) __PYX_ERR(3, 6069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2080); + __Pyx_GIVEREF(__pyx_tuple__2080); + + /* "talib/_stream.pxi":6074 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2081 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2081)) __PYX_ERR(3, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2081); + __Pyx_GIVEREF(__pyx_tuple__2081); + + /* "talib/_stream.pxi":6076 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2082 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2082)) __PYX_ERR(3, 6076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2082); + __Pyx_GIVEREF(__pyx_tuple__2082); + + /* "talib/_stream.pxi":6081 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2083 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2083)) __PYX_ERR(3, 6081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2083); + __Pyx_GIVEREF(__pyx_tuple__2083); + + /* "talib/_stream.pxi":6083 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2084 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2084)) __PYX_ERR(3, 6083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2084); + __Pyx_GIVEREF(__pyx_tuple__2084); + + /* "talib/_stream.pxi":6088 + * close_data = close.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__2085 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__2085)) __PYX_ERR(3, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2085); + __Pyx_GIVEREF(__pyx_tuple__2085); + + /* "talib/_stream.pxi":6090 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__2086 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2086)) __PYX_ERR(3, 6090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2086); + __Pyx_GIVEREF(__pyx_tuple__2086); + + /* "talib/_stream.pxi":6096 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2087 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2087)) __PYX_ERR(3, 6096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2087); + __Pyx_GIVEREF(__pyx_tuple__2087); + + /* "talib/_stream.pxi":6098 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != volume.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2088 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2088)) __PYX_ERR(3, 6098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2088); + __Pyx_GIVEREF(__pyx_tuple__2088); + + /* "talib/_stream.pxi":6100 + * raise Exception("input lengths are different") + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2089 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2089)) __PYX_ERR(3, 6100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2089); + __Pyx_GIVEREF(__pyx_tuple__2089); + + /* "talib/_stream.pxi":6130 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2090 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2090)) __PYX_ERR(3, 6130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2090); + __Pyx_GIVEREF(__pyx_tuple__2090); + + /* "talib/_stream.pxi":6132 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2091 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2091)) __PYX_ERR(3, 6132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2091); + __Pyx_GIVEREF(__pyx_tuple__2091); + + /* "talib/_stream.pxi":6167 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2092 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2092)) __PYX_ERR(3, 6167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2092); + __Pyx_GIVEREF(__pyx_tuple__2092); + + /* "talib/_stream.pxi":6169 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2093 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2093)) __PYX_ERR(3, 6169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2093); + __Pyx_GIVEREF(__pyx_tuple__2093); + + /* "talib/_stream.pxi":6174 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2094 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2094)) __PYX_ERR(3, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2094); + __Pyx_GIVEREF(__pyx_tuple__2094); + + /* "talib/_stream.pxi":6176 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2095 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2095)) __PYX_ERR(3, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2095); + __Pyx_GIVEREF(__pyx_tuple__2095); + + /* "talib/_stream.pxi":6182 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2096 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2096)) __PYX_ERR(3, 6182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2096); + __Pyx_GIVEREF(__pyx_tuple__2096); + + /* "talib/_stream.pxi":6212 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2097 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2097)) __PYX_ERR(3, 6212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2097); + __Pyx_GIVEREF(__pyx_tuple__2097); + + /* "talib/_stream.pxi":6214 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2098 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2098)) __PYX_ERR(3, 6214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2098); + __Pyx_GIVEREF(__pyx_tuple__2098); + + /* "talib/_stream.pxi":6248 + * int outinteger + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2099 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2099)) __PYX_ERR(3, 6248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2099); + __Pyx_GIVEREF(__pyx_tuple__2099); + + /* "talib/_stream.pxi":6250 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2100 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2100)) __PYX_ERR(3, 6250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2100); + __Pyx_GIVEREF(__pyx_tuple__2100); + + /* "talib/_stream.pxi":6286 + * double outmax + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2101 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2101)) __PYX_ERR(3, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2101); + __Pyx_GIVEREF(__pyx_tuple__2101); + + /* "talib/_stream.pxi":6288 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2102 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2102)) __PYX_ERR(3, 6288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2102); + __Pyx_GIVEREF(__pyx_tuple__2102); + + /* "talib/_stream.pxi":6325 + * int outmaxidx + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2103 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2103)) __PYX_ERR(3, 6325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2103); + __Pyx_GIVEREF(__pyx_tuple__2103); + + /* "talib/_stream.pxi":6327 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2104 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2104)) __PYX_ERR(3, 6327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2104); + __Pyx_GIVEREF(__pyx_tuple__2104); + + /* "talib/_stream.pxi":6364 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2105 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2105)) __PYX_ERR(3, 6364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2105); + __Pyx_GIVEREF(__pyx_tuple__2105); + + /* "talib/_stream.pxi":6366 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2106 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2106)) __PYX_ERR(3, 6366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2106); + __Pyx_GIVEREF(__pyx_tuple__2106); + + /* "talib/_stream.pxi":6371 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2107 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2107)) __PYX_ERR(3, 6371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2107); + __Pyx_GIVEREF(__pyx_tuple__2107); + + /* "talib/_stream.pxi":6373 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2108 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2108)) __PYX_ERR(3, 6373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2108); + __Pyx_GIVEREF(__pyx_tuple__2108); + + /* "talib/_stream.pxi":6378 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2109 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2109)) __PYX_ERR(3, 6378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2109); + __Pyx_GIVEREF(__pyx_tuple__2109); + + /* "talib/_stream.pxi":6380 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2110 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2110)) __PYX_ERR(3, 6380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2110); + __Pyx_GIVEREF(__pyx_tuple__2110); + + /* "talib/_stream.pxi":6386 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2111 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2111)) __PYX_ERR(3, 6386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2111); + __Pyx_GIVEREF(__pyx_tuple__2111); + + /* "talib/_stream.pxi":6388 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2112 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2112)) __PYX_ERR(3, 6388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2112); + __Pyx_GIVEREF(__pyx_tuple__2112); + + /* "talib/_stream.pxi":6419 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2113 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2113)) __PYX_ERR(3, 6419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2113); + __Pyx_GIVEREF(__pyx_tuple__2113); + + /* "talib/_stream.pxi":6421 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2114 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2114)) __PYX_ERR(3, 6421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2114); + __Pyx_GIVEREF(__pyx_tuple__2114); + + /* "talib/_stream.pxi":6426 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2115 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2115)) __PYX_ERR(3, 6426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2115); + __Pyx_GIVEREF(__pyx_tuple__2115); + + /* "talib/_stream.pxi":6428 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2116 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2116)) __PYX_ERR(3, 6428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2116); + __Pyx_GIVEREF(__pyx_tuple__2116); + + /* "talib/_stream.pxi":6434 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2117 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2117)) __PYX_ERR(3, 6434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2117); + __Pyx_GIVEREF(__pyx_tuple__2117); + + /* "talib/_stream.pxi":6464 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2118 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2118)) __PYX_ERR(3, 6464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2118); + __Pyx_GIVEREF(__pyx_tuple__2118); + + /* "talib/_stream.pxi":6466 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2119 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2119)) __PYX_ERR(3, 6466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2119); + __Pyx_GIVEREF(__pyx_tuple__2119); + + /* "talib/_stream.pxi":6500 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__2120 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__2120)) __PYX_ERR(3, 6500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2120); + __Pyx_GIVEREF(__pyx_tuple__2120); + + /* "talib/_stream.pxi":6502 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__2121 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2121)) __PYX_ERR(3, 6502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2121); + __Pyx_GIVEREF(__pyx_tuple__2121); + + /* "talib/_stream.pxi":6507 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__2122 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__2122)) __PYX_ERR(3, 6507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2122); + __Pyx_GIVEREF(__pyx_tuple__2122); + + /* "talib/_stream.pxi":6509 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__2123 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2123)) __PYX_ERR(3, 6509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2123); + __Pyx_GIVEREF(__pyx_tuple__2123); + + /* "talib/_stream.pxi":6515 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2124 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2124)) __PYX_ERR(3, 6515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2124); + __Pyx_GIVEREF(__pyx_tuple__2124); + + /* "talib/_stream.pxi":6547 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2125 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2125)) __PYX_ERR(3, 6547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2125); + __Pyx_GIVEREF(__pyx_tuple__2125); + + /* "talib/_stream.pxi":6549 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2126 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2126)) __PYX_ERR(3, 6549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2126); + __Pyx_GIVEREF(__pyx_tuple__2126); + + /* "talib/_stream.pxi":6554 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2127 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2127)) __PYX_ERR(3, 6554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2127); + __Pyx_GIVEREF(__pyx_tuple__2127); + + /* "talib/_stream.pxi":6556 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2128 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2128)) __PYX_ERR(3, 6556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2128); + __Pyx_GIVEREF(__pyx_tuple__2128); + + /* "talib/_stream.pxi":6561 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2129 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2129)) __PYX_ERR(3, 6561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2129); + __Pyx_GIVEREF(__pyx_tuple__2129); + + /* "talib/_stream.pxi":6563 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2130 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2130)) __PYX_ERR(3, 6563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2130); + __Pyx_GIVEREF(__pyx_tuple__2130); + + /* "talib/_stream.pxi":6569 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2131 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2131)) __PYX_ERR(3, 6569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2131); + __Pyx_GIVEREF(__pyx_tuple__2131); + + /* "talib/_stream.pxi":6571 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2132 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2132)) __PYX_ERR(3, 6571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2132); + __Pyx_GIVEREF(__pyx_tuple__2132); + + /* "talib/_stream.pxi":6601 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2133 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2133)) __PYX_ERR(3, 6601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2133); + __Pyx_GIVEREF(__pyx_tuple__2133); + + /* "talib/_stream.pxi":6603 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2134 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2134)) __PYX_ERR(3, 6603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2134); + __Pyx_GIVEREF(__pyx_tuple__2134); + + /* "talib/_stream.pxi":6608 + * real_data = real.data + * if PyArray_TYPE(volume) != np.NPY_DOUBLE: + * raise Exception("volume is not double") # <<<<<<<<<<<<<< + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") + */ + __pyx_tuple__2135 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__2135)) __PYX_ERR(3, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2135); + __Pyx_GIVEREF(__pyx_tuple__2135); + + /* "talib/_stream.pxi":6610 + * raise Exception("volume is not double") + * if volume.ndim != 1: + * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): + * volume = PyArray_GETCONTIGUOUS(volume) + */ + __pyx_tuple__2136 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2136)) __PYX_ERR(3, 6610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2136); + __Pyx_GIVEREF(__pyx_tuple__2136); + + /* "talib/_stream.pxi":6616 + * length = real.shape[0] + * if length != volume.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2137 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2137)) __PYX_ERR(3, 6616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2137); + __Pyx_GIVEREF(__pyx_tuple__2137); + + /* "talib/_stream.pxi":6648 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2138 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2138)) __PYX_ERR(3, 6648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2138); + __Pyx_GIVEREF(__pyx_tuple__2138); + + /* "talib/_stream.pxi":6650 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2139 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2139)) __PYX_ERR(3, 6650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2139); + __Pyx_GIVEREF(__pyx_tuple__2139); + + /* "talib/_stream.pxi":6655 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2140 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2140)) __PYX_ERR(3, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2140); + __Pyx_GIVEREF(__pyx_tuple__2140); + + /* "talib/_stream.pxi":6657 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2141 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2141)) __PYX_ERR(3, 6657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2141); + __Pyx_GIVEREF(__pyx_tuple__2141); + + /* "talib/_stream.pxi":6662 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2142 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2142)) __PYX_ERR(3, 6662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2142); + __Pyx_GIVEREF(__pyx_tuple__2142); + + /* "talib/_stream.pxi":6664 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2143 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2143)) __PYX_ERR(3, 6664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2143); + __Pyx_GIVEREF(__pyx_tuple__2143); + + /* "talib/_stream.pxi":6670 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2144 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2144)) __PYX_ERR(3, 6670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2144); + __Pyx_GIVEREF(__pyx_tuple__2144); + + /* "talib/_stream.pxi":6672 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2145 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2145)) __PYX_ERR(3, 6672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2145); + __Pyx_GIVEREF(__pyx_tuple__2145); + + /* "talib/_stream.pxi":6703 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2146 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2146)) __PYX_ERR(3, 6703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2146); + __Pyx_GIVEREF(__pyx_tuple__2146); + + /* "talib/_stream.pxi":6705 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2147 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2147)) __PYX_ERR(3, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2147); + __Pyx_GIVEREF(__pyx_tuple__2147); + + /* "talib/_stream.pxi":6710 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2148 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2148)) __PYX_ERR(3, 6710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2148); + __Pyx_GIVEREF(__pyx_tuple__2148); + + /* "talib/_stream.pxi":6712 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2149 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2149)) __PYX_ERR(3, 6712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2149); + __Pyx_GIVEREF(__pyx_tuple__2149); + + /* "talib/_stream.pxi":6718 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2150 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2150)) __PYX_ERR(3, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2150); + __Pyx_GIVEREF(__pyx_tuple__2150); + + /* "talib/_stream.pxi":6750 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2151 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2151)) __PYX_ERR(3, 6750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2151); + __Pyx_GIVEREF(__pyx_tuple__2151); + + /* "talib/_stream.pxi":6752 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2152 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2152)) __PYX_ERR(3, 6752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2152); + __Pyx_GIVEREF(__pyx_tuple__2152); + + /* "talib/_stream.pxi":6786 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2153 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2153)) __PYX_ERR(3, 6786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2153); + __Pyx_GIVEREF(__pyx_tuple__2153); + + /* "talib/_stream.pxi":6788 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2154 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2154)) __PYX_ERR(3, 6788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2154); + __Pyx_GIVEREF(__pyx_tuple__2154); + + /* "talib/_stream.pxi":6822 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2155 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2155)) __PYX_ERR(3, 6822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2155); + __Pyx_GIVEREF(__pyx_tuple__2155); + + /* "talib/_stream.pxi":6824 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2156 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2156)) __PYX_ERR(3, 6824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2156); + __Pyx_GIVEREF(__pyx_tuple__2156); + + /* "talib/_stream.pxi":6858 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2157 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2157)) __PYX_ERR(3, 6858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2157); + __Pyx_GIVEREF(__pyx_tuple__2157); + + /* "talib/_stream.pxi":6860 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2158 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2158)) __PYX_ERR(3, 6860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2158); + __Pyx_GIVEREF(__pyx_tuple__2158); + + /* "talib/_stream.pxi":6894 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2159 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2159)) __PYX_ERR(3, 6894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2159); + __Pyx_GIVEREF(__pyx_tuple__2159); + + /* "talib/_stream.pxi":6896 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2160 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2160)) __PYX_ERR(3, 6896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2160); + __Pyx_GIVEREF(__pyx_tuple__2160); + + /* "talib/_stream.pxi":6930 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2161 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2161)) __PYX_ERR(3, 6930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2161); + __Pyx_GIVEREF(__pyx_tuple__2161); + + /* "talib/_stream.pxi":6932 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2162 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2162)) __PYX_ERR(3, 6932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2162); + __Pyx_GIVEREF(__pyx_tuple__2162); + + /* "talib/_stream.pxi":6968 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2163 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2163)) __PYX_ERR(3, 6968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2163); + __Pyx_GIVEREF(__pyx_tuple__2163); + + /* "talib/_stream.pxi":6970 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2164 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2164)) __PYX_ERR(3, 6970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2164); + __Pyx_GIVEREF(__pyx_tuple__2164); + + /* "talib/_stream.pxi":6975 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2165 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2165)) __PYX_ERR(3, 6975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2165); + __Pyx_GIVEREF(__pyx_tuple__2165); + + /* "talib/_stream.pxi":6977 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2166 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2166)) __PYX_ERR(3, 6977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2166); + __Pyx_GIVEREF(__pyx_tuple__2166); + + /* "talib/_stream.pxi":6983 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2167 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2167)) __PYX_ERR(3, 6983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2167); + __Pyx_GIVEREF(__pyx_tuple__2167); + + /* "talib/_stream.pxi":7021 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2168 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2168)) __PYX_ERR(3, 7021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2168); + __Pyx_GIVEREF(__pyx_tuple__2168); + + /* "talib/_stream.pxi":7023 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2169 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2169)) __PYX_ERR(3, 7023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2169); + __Pyx_GIVEREF(__pyx_tuple__2169); + + /* "talib/_stream.pxi":7028 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2170 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2170)) __PYX_ERR(3, 7028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2170); + __Pyx_GIVEREF(__pyx_tuple__2170); + + /* "talib/_stream.pxi":7030 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2171 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2171)) __PYX_ERR(3, 7030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2171); + __Pyx_GIVEREF(__pyx_tuple__2171); + + /* "talib/_stream.pxi":7036 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2172 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2172)) __PYX_ERR(3, 7036, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2172); + __Pyx_GIVEREF(__pyx_tuple__2172); + + /* "talib/_stream.pxi":7064 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2173 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2173)) __PYX_ERR(3, 7064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2173); + __Pyx_GIVEREF(__pyx_tuple__2173); + + /* "talib/_stream.pxi":7066 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2174 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2174)) __PYX_ERR(3, 7066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2174); + __Pyx_GIVEREF(__pyx_tuple__2174); + + /* "talib/_stream.pxi":7098 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2175 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2175)) __PYX_ERR(3, 7098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2175); + __Pyx_GIVEREF(__pyx_tuple__2175); + + /* "talib/_stream.pxi":7100 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2176 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2176)) __PYX_ERR(3, 7100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2176); + __Pyx_GIVEREF(__pyx_tuple__2176); + + /* "talib/_stream.pxi":7134 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2177 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2177)) __PYX_ERR(3, 7134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2177); + __Pyx_GIVEREF(__pyx_tuple__2177); + + /* "talib/_stream.pxi":7136 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2178 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2178)) __PYX_ERR(3, 7136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2178); + __Pyx_GIVEREF(__pyx_tuple__2178); + + /* "talib/_stream.pxi":7168 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2179 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2179)) __PYX_ERR(3, 7168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2179); + __Pyx_GIVEREF(__pyx_tuple__2179); + + /* "talib/_stream.pxi":7170 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2180 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2180)) __PYX_ERR(3, 7170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2180); + __Pyx_GIVEREF(__pyx_tuple__2180); + + /* "talib/_stream.pxi":7205 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2181 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2181)) __PYX_ERR(3, 7205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2181); + __Pyx_GIVEREF(__pyx_tuple__2181); + + /* "talib/_stream.pxi":7207 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2182 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2182)) __PYX_ERR(3, 7207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2182); + __Pyx_GIVEREF(__pyx_tuple__2182); + + /* "talib/_stream.pxi":7249 + * double outslowd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2183 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2183)) __PYX_ERR(3, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2183); + __Pyx_GIVEREF(__pyx_tuple__2183); + + /* "talib/_stream.pxi":7251 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2184 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2184)) __PYX_ERR(3, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2184); + __Pyx_GIVEREF(__pyx_tuple__2184); + + /* "talib/_stream.pxi":7256 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2185 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2185)) __PYX_ERR(3, 7256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2185); + __Pyx_GIVEREF(__pyx_tuple__2185); + + /* "talib/_stream.pxi":7258 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2186 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2186)) __PYX_ERR(3, 7258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2186); + __Pyx_GIVEREF(__pyx_tuple__2186); + + /* "talib/_stream.pxi":7263 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2187 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2187)) __PYX_ERR(3, 7263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2187); + __Pyx_GIVEREF(__pyx_tuple__2187); + + /* "talib/_stream.pxi":7265 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2188 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2188)) __PYX_ERR(3, 7265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2188); + __Pyx_GIVEREF(__pyx_tuple__2188); + + /* "talib/_stream.pxi":7271 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2189 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2189)) __PYX_ERR(3, 7271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2189); + __Pyx_GIVEREF(__pyx_tuple__2189); + + /* "talib/_stream.pxi":7273 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outslowk = NaN + * outslowd = NaN + */ + __pyx_tuple__2190 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2190)) __PYX_ERR(3, 7273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2190); + __Pyx_GIVEREF(__pyx_tuple__2190); + + /* "talib/_stream.pxi":7310 + * double outfastd + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2191 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2191)) __PYX_ERR(3, 7310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2191); + __Pyx_GIVEREF(__pyx_tuple__2191); + + /* "talib/_stream.pxi":7312 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2192 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2192)) __PYX_ERR(3, 7312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2192); + __Pyx_GIVEREF(__pyx_tuple__2192); + + /* "talib/_stream.pxi":7317 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2193 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2193)) __PYX_ERR(3, 7317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2193); + __Pyx_GIVEREF(__pyx_tuple__2193); + + /* "talib/_stream.pxi":7319 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2194 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2194)) __PYX_ERR(3, 7319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2194); + __Pyx_GIVEREF(__pyx_tuple__2194); + + /* "talib/_stream.pxi":7324 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2195 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2195)) __PYX_ERR(3, 7324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2195); + __Pyx_GIVEREF(__pyx_tuple__2195); + + /* "talib/_stream.pxi":7326 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2196 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2196)) __PYX_ERR(3, 7326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2196); + __Pyx_GIVEREF(__pyx_tuple__2196); + + /* "talib/_stream.pxi":7332 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2197 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2197)) __PYX_ERR(3, 7332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2197); + __Pyx_GIVEREF(__pyx_tuple__2197); + + /* "talib/_stream.pxi":7334 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outfastk = NaN + * outfastd = NaN + */ + __pyx_tuple__2198 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2198)) __PYX_ERR(3, 7334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2198); + __Pyx_GIVEREF(__pyx_tuple__2198); + + /* "talib/_stream.pxi":7370 + * double outfastd + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2199 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2199)) __PYX_ERR(3, 7370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2199); + __Pyx_GIVEREF(__pyx_tuple__2199); + + /* "talib/_stream.pxi":7372 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2200 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2200)) __PYX_ERR(3, 7372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2200); + __Pyx_GIVEREF(__pyx_tuple__2200); + + /* "talib/_stream.pxi":7407 + * double outreal + * if PyArray_TYPE(real0) != np.NPY_DOUBLE: + * raise Exception("real0 is not double") # <<<<<<<<<<<<<< + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") + */ + __pyx_tuple__2201 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__2201)) __PYX_ERR(3, 7407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2201); + __Pyx_GIVEREF(__pyx_tuple__2201); + + /* "talib/_stream.pxi":7409 + * raise Exception("real0 is not double") + * if real0.ndim != 1: + * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): + * real0 = PyArray_GETCONTIGUOUS(real0) + */ + __pyx_tuple__2202 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2202)) __PYX_ERR(3, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2202); + __Pyx_GIVEREF(__pyx_tuple__2202); + + /* "talib/_stream.pxi":7414 + * real0_data = real0.data + * if PyArray_TYPE(real1) != np.NPY_DOUBLE: + * raise Exception("real1 is not double") # <<<<<<<<<<<<<< + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") + */ + __pyx_tuple__2203 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__2203)) __PYX_ERR(3, 7414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2203); + __Pyx_GIVEREF(__pyx_tuple__2203); + + /* "talib/_stream.pxi":7416 + * raise Exception("real1 is not double") + * if real1.ndim != 1: + * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): + * real1 = PyArray_GETCONTIGUOUS(real1) + */ + __pyx_tuple__2204 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2204)) __PYX_ERR(3, 7416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2204); + __Pyx_GIVEREF(__pyx_tuple__2204); + + /* "talib/_stream.pxi":7422 + * length = real0.shape[0] + * if length != real1.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2205 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2205)) __PYX_ERR(3, 7422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2205); + __Pyx_GIVEREF(__pyx_tuple__2205); + + /* "talib/_stream.pxi":7452 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2206 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2206)) __PYX_ERR(3, 7452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2206); + __Pyx_GIVEREF(__pyx_tuple__2206); + + /* "talib/_stream.pxi":7454 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2207 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2207)) __PYX_ERR(3, 7454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2207); + __Pyx_GIVEREF(__pyx_tuple__2207); + + /* "talib/_stream.pxi":7489 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2208 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2208)) __PYX_ERR(3, 7489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2208); + __Pyx_GIVEREF(__pyx_tuple__2208); + + /* "talib/_stream.pxi":7491 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2209 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2209)) __PYX_ERR(3, 7491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2209); + __Pyx_GIVEREF(__pyx_tuple__2209); + + /* "talib/_stream.pxi":7523 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2210 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2210)) __PYX_ERR(3, 7523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2210); + __Pyx_GIVEREF(__pyx_tuple__2210); + + /* "talib/_stream.pxi":7525 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2211 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2211)) __PYX_ERR(3, 7525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2211); + __Pyx_GIVEREF(__pyx_tuple__2211); + + /* "talib/_stream.pxi":7557 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2212 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2212)) __PYX_ERR(3, 7557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2212); + __Pyx_GIVEREF(__pyx_tuple__2212); + + /* "talib/_stream.pxi":7559 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2213 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2213)) __PYX_ERR(3, 7559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2213); + __Pyx_GIVEREF(__pyx_tuple__2213); + + /* "talib/_stream.pxi":7593 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2214 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2214)) __PYX_ERR(3, 7593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2214); + __Pyx_GIVEREF(__pyx_tuple__2214); + + /* "talib/_stream.pxi":7595 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2215 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2215)) __PYX_ERR(3, 7595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2215); + __Pyx_GIVEREF(__pyx_tuple__2215); + + /* "talib/_stream.pxi":7629 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2216 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2216)) __PYX_ERR(3, 7629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2216); + __Pyx_GIVEREF(__pyx_tuple__2216); + + /* "talib/_stream.pxi":7631 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2217 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2217)) __PYX_ERR(3, 7631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2217); + __Pyx_GIVEREF(__pyx_tuple__2217); + + /* "talib/_stream.pxi":7636 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2218 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2218)) __PYX_ERR(3, 7636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2218); + __Pyx_GIVEREF(__pyx_tuple__2218); + + /* "talib/_stream.pxi":7638 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2219 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2219)) __PYX_ERR(3, 7638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2219); + __Pyx_GIVEREF(__pyx_tuple__2219); + + /* "talib/_stream.pxi":7643 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2220 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2220)) __PYX_ERR(3, 7643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2220); + __Pyx_GIVEREF(__pyx_tuple__2220); + + /* "talib/_stream.pxi":7645 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2221 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2221)) __PYX_ERR(3, 7645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2221); + __Pyx_GIVEREF(__pyx_tuple__2221); + + /* "talib/_stream.pxi":7651 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2222 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2222)) __PYX_ERR(3, 7651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2222); + __Pyx_GIVEREF(__pyx_tuple__2222); + + /* "talib/_stream.pxi":7653 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2223 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2223)) __PYX_ERR(3, 7653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2223); + __Pyx_GIVEREF(__pyx_tuple__2223); + + /* "talib/_stream.pxi":7683 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2224 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2224)) __PYX_ERR(3, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2224); + __Pyx_GIVEREF(__pyx_tuple__2224); + + /* "talib/_stream.pxi":7685 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2225 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2225)) __PYX_ERR(3, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2225); + __Pyx_GIVEREF(__pyx_tuple__2225); + + /* "talib/_stream.pxi":7719 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2226 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2226)) __PYX_ERR(3, 7719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2226); + __Pyx_GIVEREF(__pyx_tuple__2226); + + /* "talib/_stream.pxi":7721 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2227 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2227)) __PYX_ERR(3, 7721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2227); + __Pyx_GIVEREF(__pyx_tuple__2227); + + /* "talib/_stream.pxi":7755 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2228 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2228)) __PYX_ERR(3, 7755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2228); + __Pyx_GIVEREF(__pyx_tuple__2228); + + /* "talib/_stream.pxi":7757 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2229 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2229)) __PYX_ERR(3, 7757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2229); + __Pyx_GIVEREF(__pyx_tuple__2229); + + /* "talib/_stream.pxi":7791 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2230 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2230)) __PYX_ERR(3, 7791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2230); + __Pyx_GIVEREF(__pyx_tuple__2230); + + /* "talib/_stream.pxi":7793 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2231 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2231)) __PYX_ERR(3, 7793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2231); + __Pyx_GIVEREF(__pyx_tuple__2231); + + /* "talib/_stream.pxi":7798 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2232 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2232)) __PYX_ERR(3, 7798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2232); + __Pyx_GIVEREF(__pyx_tuple__2232); + + /* "talib/_stream.pxi":7800 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2233 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2233)) __PYX_ERR(3, 7800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2233); + __Pyx_GIVEREF(__pyx_tuple__2233); + + /* "talib/_stream.pxi":7805 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2234 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2234)) __PYX_ERR(3, 7805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2234); + __Pyx_GIVEREF(__pyx_tuple__2234); + + /* "talib/_stream.pxi":7807 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2235 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2235)) __PYX_ERR(3, 7807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2235); + __Pyx_GIVEREF(__pyx_tuple__2235); + + /* "talib/_stream.pxi":7813 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2236 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2236)) __PYX_ERR(3, 7813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2236); + __Pyx_GIVEREF(__pyx_tuple__2236); + + /* "talib/_stream.pxi":7815 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2237 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2237)) __PYX_ERR(3, 7815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2237); + __Pyx_GIVEREF(__pyx_tuple__2237); + + /* "talib/_stream.pxi":7849 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2238 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2238)) __PYX_ERR(3, 7849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2238); + __Pyx_GIVEREF(__pyx_tuple__2238); + + /* "talib/_stream.pxi":7851 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2239 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2239)) __PYX_ERR(3, 7851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2239); + __Pyx_GIVEREF(__pyx_tuple__2239); + + /* "talib/_stream.pxi":7856 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2240 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2240)) __PYX_ERR(3, 7856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2240); + __Pyx_GIVEREF(__pyx_tuple__2240); + + /* "talib/_stream.pxi":7858 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2241 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2241)) __PYX_ERR(3, 7858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2241); + __Pyx_GIVEREF(__pyx_tuple__2241); + + /* "talib/_stream.pxi":7863 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2242 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2242)) __PYX_ERR(3, 7863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2242); + __Pyx_GIVEREF(__pyx_tuple__2242); + + /* "talib/_stream.pxi":7865 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2243 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2243)) __PYX_ERR(3, 7865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2243); + __Pyx_GIVEREF(__pyx_tuple__2243); + + /* "talib/_stream.pxi":7871 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2244 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2244)) __PYX_ERR(3, 7871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2244); + __Pyx_GIVEREF(__pyx_tuple__2244); + + /* "talib/_stream.pxi":7873 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2245 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2245)) __PYX_ERR(3, 7873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2245); + __Pyx_GIVEREF(__pyx_tuple__2245); + + /* "talib/_stream.pxi":7904 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2246 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2246)) __PYX_ERR(3, 7904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2246); + __Pyx_GIVEREF(__pyx_tuple__2246); + + /* "talib/_stream.pxi":7906 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2247 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2247)) __PYX_ERR(3, 7906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2247); + __Pyx_GIVEREF(__pyx_tuple__2247); + + /* "talib/_stream.pxi":7940 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2248 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2248)) __PYX_ERR(3, 7940, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2248); + __Pyx_GIVEREF(__pyx_tuple__2248); + + /* "talib/_stream.pxi":7942 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2249 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2249)) __PYX_ERR(3, 7942, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2249); + __Pyx_GIVEREF(__pyx_tuple__2249); + + /* "talib/_stream.pxi":7947 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2250 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2250)) __PYX_ERR(3, 7947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2250); + __Pyx_GIVEREF(__pyx_tuple__2250); + + /* "talib/_stream.pxi":7949 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2251 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2251)) __PYX_ERR(3, 7949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2251); + __Pyx_GIVEREF(__pyx_tuple__2251); + + /* "talib/_stream.pxi":7954 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2252 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2252)) __PYX_ERR(3, 7954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2252); + __Pyx_GIVEREF(__pyx_tuple__2252); + + /* "talib/_stream.pxi":7956 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2253 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2253)) __PYX_ERR(3, 7956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2253); + __Pyx_GIVEREF(__pyx_tuple__2253); + + /* "talib/_stream.pxi":7962 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2254 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2254)) __PYX_ERR(3, 7962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2254); + __Pyx_GIVEREF(__pyx_tuple__2254); + + /* "talib/_stream.pxi":7964 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2255 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2255)) __PYX_ERR(3, 7964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2255); + __Pyx_GIVEREF(__pyx_tuple__2255); + + /* "talib/_stream.pxi":7996 + * double outreal + * if PyArray_TYPE(high) != np.NPY_DOUBLE: + * raise Exception("high is not double") # <<<<<<<<<<<<<< + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") + */ + __pyx_tuple__2256 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__2256)) __PYX_ERR(3, 7996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2256); + __Pyx_GIVEREF(__pyx_tuple__2256); + + /* "talib/_stream.pxi":7998 + * raise Exception("high is not double") + * if high.ndim != 1: + * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): + * high = PyArray_GETCONTIGUOUS(high) + */ + __pyx_tuple__2257 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2257)) __PYX_ERR(3, 7998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2257); + __Pyx_GIVEREF(__pyx_tuple__2257); + + /* "talib/_stream.pxi":8003 + * high_data = high.data + * if PyArray_TYPE(low) != np.NPY_DOUBLE: + * raise Exception("low is not double") # <<<<<<<<<<<<<< + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") + */ + __pyx_tuple__2258 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__2258)) __PYX_ERR(3, 8003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2258); + __Pyx_GIVEREF(__pyx_tuple__2258); + + /* "talib/_stream.pxi":8005 + * raise Exception("low is not double") + * if low.ndim != 1: + * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): + * low = PyArray_GETCONTIGUOUS(low) + */ + __pyx_tuple__2259 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2259)) __PYX_ERR(3, 8005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2259); + __Pyx_GIVEREF(__pyx_tuple__2259); + + /* "talib/_stream.pxi":8010 + * low_data = low.data + * if PyArray_TYPE(close) != np.NPY_DOUBLE: + * raise Exception("close is not double") # <<<<<<<<<<<<<< + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") + */ + __pyx_tuple__2260 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__2260)) __PYX_ERR(3, 8010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2260); + __Pyx_GIVEREF(__pyx_tuple__2260); + + /* "talib/_stream.pxi":8012 + * raise Exception("close is not double") + * if close.ndim != 1: + * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): + * close = PyArray_GETCONTIGUOUS(close) + */ + __pyx_tuple__2261 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2261)) __PYX_ERR(3, 8012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2261); + __Pyx_GIVEREF(__pyx_tuple__2261); + + /* "talib/_stream.pxi":8018 + * length = high.shape[0] + * if length != low.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * if length != close.shape[0]: + * raise Exception("input lengths are different") + */ + __pyx_tuple__2262 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2262)) __PYX_ERR(3, 8018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2262); + __Pyx_GIVEREF(__pyx_tuple__2262); + + /* "talib/_stream.pxi":8020 + * raise Exception("input lengths are different") + * if length != close.shape[0]: + * raise Exception("input lengths are different") # <<<<<<<<<<<<<< + * outreal = NaN + * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) + */ + __pyx_tuple__2263 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__2263)) __PYX_ERR(3, 8020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2263); + __Pyx_GIVEREF(__pyx_tuple__2263); + + /* "talib/_stream.pxi":8050 + * double outreal + * if PyArray_TYPE(real) != np.NPY_DOUBLE: + * raise Exception("real is not double") # <<<<<<<<<<<<<< + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") + */ + __pyx_tuple__2264 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__2264)) __PYX_ERR(3, 8050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2264); + __Pyx_GIVEREF(__pyx_tuple__2264); + + /* "talib/_stream.pxi":8052 + * raise Exception("real is not double") + * if real.ndim != 1: + * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< + * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + * real = PyArray_GETCONTIGUOUS(real) + */ + __pyx_tuple__2265 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2265)) __PYX_ERR(3, 8052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2265); + __Pyx_GIVEREF(__pyx_tuple__2265); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__2266 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2266)) __PYX_ERR(4, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2266); + __Pyx_GIVEREF(__pyx_tuple__2266); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__2267 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2267)) __PYX_ERR(4, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2267); + __Pyx_GIVEREF(__pyx_tuple__2267); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__2268 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__2268)) __PYX_ERR(4, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2268); + __Pyx_GIVEREF(__pyx_tuple__2268); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_tuple__2269 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__2269)) __PYX_ERR(4, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2269); + __Pyx_GIVEREF(__pyx_tuple__2269); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__2270 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__2270)) __PYX_ERR(4, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2270); + __Pyx_GIVEREF(__pyx_tuple__2270); + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__2271 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__2271)) __PYX_ERR(4, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2271); + __Pyx_GIVEREF(__pyx_tuple__2271); + + /* "talib/_common.pxi":33 + * function_name, ret_code, ta_errors[ret_code])) + * + * def _ta_initialize(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() + */ + __pyx_tuple__2272 = PyTuple_Pack(1, __pyx_n_s_ret_code); if (unlikely(!__pyx_tuple__2272)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2272); + __Pyx_GIVEREF(__pyx_tuple__2272); + __pyx_codeobj__2273 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_ta_initialize, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2273)) __PYX_ERR(0, 33, __pyx_L1_error) + + /* "talib/_common.pxi":38 + * _ta_check_success('TA_Initialize', ret_code) + * + * def _ta_shutdown(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() + */ + __pyx_tuple__2274 = PyTuple_Pack(1, __pyx_n_s_ret_code); if (unlikely(!__pyx_tuple__2274)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2274); + __Pyx_GIVEREF(__pyx_tuple__2274); + __pyx_codeobj__2275 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_ta_shutdown, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2275)) __PYX_ERR(0, 38, __pyx_L1_error) + + /* "talib/_common.pxi":44 + * + * class MA_Type(object): + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__2276 = PyTuple_Pack(1, __pyx_int_9); if (unlikely(!__pyx_tuple__2276)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2276); + __Pyx_GIVEREF(__pyx_tuple__2276); + + /* "talib/_common.pxi":46 + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + * def __init__(self): # <<<<<<<<<<<<<< + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', + */ + __pyx_tuple__2277 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2277)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2277); + __Pyx_GIVEREF(__pyx_tuple__2277); + __pyx_codeobj__2278 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_init, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2278)) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "talib/_common.pxi":59 + * } + * + * def __getitem__(self, type_): # <<<<<<<<<<<<<< + * return self._lookup[type_] + * + */ + __pyx_tuple__2279 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_type); if (unlikely(!__pyx_tuple__2279)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2279); + __Pyx_GIVEREF(__pyx_tuple__2279); + __pyx_codeobj__2280 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_getitem, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2280)) __PYX_ERR(0, 59, __pyx_L1_error) + + /* "talib/_common.pxi":73 + * _ta_func_unst_ids[name] = i + * + * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + __pyx_tuple__2281 = PyTuple_Pack(4, __pyx_n_s_name, __pyx_n_s_period, __pyx_n_s_ret_code, __pyx_n_s_id); if (unlikely(!__pyx_tuple__2281)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2281); + __Pyx_GIVEREF(__pyx_tuple__2281); + __pyx_codeobj__2282 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_ta_set_unstable_period, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2282)) __PYX_ERR(0, 73, __pyx_L1_error) + + /* "talib/_common.pxi":79 + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + * + * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + __pyx_tuple__2283 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_period, __pyx_n_s_id); if (unlikely(!__pyx_tuple__2283)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2283); + __Pyx_GIVEREF(__pyx_tuple__2283); + __pyx_codeobj__2284 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l, __pyx_n_s_ta_get_unstable_period, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2284)) __PYX_ERR(0, 79, __pyx_L1_error) + + /* "talib/_func.pxi":24 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + __pyx_tuple__2285 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2285)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2285); + __Pyx_GIVEREF(__pyx_tuple__2285); + __pyx_codeobj__2286 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ACOS, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2286)) __PYX_ERR(2, 24, __pyx_L1_error) + + /* "talib/_func.pxi":73 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + __pyx_tuple__2287 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2287)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2287); + __Pyx_GIVEREF(__pyx_tuple__2287); + __pyx_codeobj__2288 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_AD, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2288)) __PYX_ERR(2, 73, __pyx_L1_error) + + /* "talib/_func.pxi":161 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + __pyx_tuple__2289 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2289)) __PYX_ERR(2, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2289); + __Pyx_GIVEREF(__pyx_tuple__2289); + __pyx_codeobj__2290 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ADD, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2290)) __PYX_ERR(2, 161, __pyx_L1_error) + + /* "talib/_func.pxi":224 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + __pyx_tuple__2291 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2291)) __PYX_ERR(2, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2291); + __Pyx_GIVEREF(__pyx_tuple__2291); + __pyx_codeobj__2292 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ADOSC, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2292)) __PYX_ERR(2, 224, __pyx_L1_error) + + /* "talib/_func.pxi":315 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2293 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2293)) __PYX_ERR(2, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2293); + __Pyx_GIVEREF(__pyx_tuple__2293); + __pyx_codeobj__2294 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ADX, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2294)) __PYX_ERR(2, 315, __pyx_L1_error) + + /* "talib/_func.pxi":392 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2295 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2295)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2295); + __Pyx_GIVEREF(__pyx_tuple__2295); + __pyx_codeobj__2296 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ADXR, 392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2296)) __PYX_ERR(2, 392, __pyx_L1_error) + + /* "talib/_func.pxi":469 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_tuple__2297 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2297)) __PYX_ERR(2, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2297); + __Pyx_GIVEREF(__pyx_tuple__2297); + __pyx_codeobj__2298 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_APO, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2298)) __PYX_ERR(2, 469, __pyx_L1_error) + + /* "talib/_func.pxi":522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2299 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outaroondown, __pyx_n_s_outaroondown_data, __pyx_n_s_outaroonup, __pyx_n_s_outaroonup_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2299)) __PYX_ERR(2, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2299); + __Pyx_GIVEREF(__pyx_tuple__2299); + __pyx_codeobj__2300 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_AROON, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2300)) __PYX_ERR(2, 522, __pyx_L1_error) + + /* "talib/_func.pxi":593 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2301 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2301)) __PYX_ERR(2, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2301); + __Pyx_GIVEREF(__pyx_tuple__2301); + __pyx_codeobj__2302 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_AROONOSC, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2302)) __PYX_ERR(2, 593, __pyx_L1_error) + + /* "talib/_func.pxi":657 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + __pyx_tuple__2303 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2303)) __PYX_ERR(2, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2303); + __Pyx_GIVEREF(__pyx_tuple__2303); + __pyx_codeobj__2304 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ASIN, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2304)) __PYX_ERR(2, 657, __pyx_L1_error) + + /* "talib/_func.pxi":706 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + __pyx_tuple__2305 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2305)) __PYX_ERR(2, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2305); + __Pyx_GIVEREF(__pyx_tuple__2305); + __pyx_codeobj__2306 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ATAN, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2306)) __PYX_ERR(2, 706, __pyx_L1_error) + + /* "talib/_func.pxi":755 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2307 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2307)) __PYX_ERR(2, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2307); + __Pyx_GIVEREF(__pyx_tuple__2307); + __pyx_codeobj__2308 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ATR, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2308)) __PYX_ERR(2, 755, __pyx_L1_error) + + /* "talib/_func.pxi":832 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + __pyx_tuple__2309 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2309)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2309); + __Pyx_GIVEREF(__pyx_tuple__2309); + __pyx_codeobj__2310 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_AVGPRICE, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2310)) __PYX_ERR(2, 832, __pyx_L1_error) + + /* "talib/_func.pxi":920 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + __pyx_tuple__2311 = PyTuple_Pack(21, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdevup, __pyx_n_s_nbdevdn, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outrealupperband, __pyx_n_s_outrealupperband_data, __pyx_n_s_outrealmiddleband, __pyx_n_s_outrealmiddleband_data, __pyx_n_s_outreallowerband, __pyx_n_s_outreallowerband_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2311)) __PYX_ERR(2, 920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2311); + __Pyx_GIVEREF(__pyx_tuple__2311); + __pyx_codeobj__2312 = (PyObject*)__Pyx_PyCode_New(5, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_BBANDS, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2312)) __PYX_ERR(2, 920, __pyx_L1_error) + + /* "talib/_func.pxi":988 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + __pyx_tuple__2313 = PyTuple_Pack(16, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2313)) __PYX_ERR(2, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2313); + __Pyx_GIVEREF(__pyx_tuple__2313); + __pyx_codeobj__2314 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_BETA, 988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2314)) __PYX_ERR(2, 988, __pyx_L1_error) + + /* "talib/_func.pxi":1053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + __pyx_tuple__2315 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2315)) __PYX_ERR(2, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2315); + __Pyx_GIVEREF(__pyx_tuple__2315); + __pyx_codeobj__2316 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_BOP, 1053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2316)) __PYX_ERR(2, 1053, __pyx_L1_error) + + /* "talib/_func.pxi":1141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2317 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2317)) __PYX_ERR(2, 1141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2317); + __Pyx_GIVEREF(__pyx_tuple__2317); + __pyx_codeobj__2318 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CCI, 1141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2318)) __PYX_ERR(2, 1141, __pyx_L1_error) + + /* "talib/_func.pxi":1218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + __pyx_tuple__2319 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2319)) __PYX_ERR(2, 1218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2319); + __Pyx_GIVEREF(__pyx_tuple__2319); + __pyx_codeobj__2320 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL2CROWS, 1218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2320)) __PYX_ERR(2, 1218, __pyx_L1_error) + + /* "talib/_func.pxi":1306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + __pyx_tuple__2321 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2321)) __PYX_ERR(2, 1306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2321); + __Pyx_GIVEREF(__pyx_tuple__2321); + __pyx_codeobj__2322 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3BLACKCROWS, 1306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2322)) __PYX_ERR(2, 1306, __pyx_L1_error) + + /* "talib/_func.pxi":1394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + __pyx_tuple__2323 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2323)) __PYX_ERR(2, 1394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2323); + __Pyx_GIVEREF(__pyx_tuple__2323); + __pyx_codeobj__2324 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3INSIDE, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2324)) __PYX_ERR(2, 1394, __pyx_L1_error) + + /* "talib/_func.pxi":1482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + __pyx_tuple__2325 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2325)) __PYX_ERR(2, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2325); + __Pyx_GIVEREF(__pyx_tuple__2325); + __pyx_codeobj__2326 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3LINESTRIKE, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2326)) __PYX_ERR(2, 1482, __pyx_L1_error) + + /* "talib/_func.pxi":1570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + __pyx_tuple__2327 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2327)) __PYX_ERR(2, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2327); + __Pyx_GIVEREF(__pyx_tuple__2327); + __pyx_codeobj__2328 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3OUTSIDE, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2328)) __PYX_ERR(2, 1570, __pyx_L1_error) + + /* "talib/_func.pxi":1658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + __pyx_tuple__2329 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2329)) __PYX_ERR(2, 1658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2329); + __Pyx_GIVEREF(__pyx_tuple__2329); + __pyx_codeobj__2330 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3STARSINSOUTH, 1658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2330)) __PYX_ERR(2, 1658, __pyx_L1_error) + + /* "talib/_func.pxi":1746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + __pyx_tuple__2331 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2331)) __PYX_ERR(2, 1746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2331); + __Pyx_GIVEREF(__pyx_tuple__2331); + __pyx_codeobj__2332 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDL3WHITESOLDIERS, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2332)) __PYX_ERR(2, 1746, __pyx_L1_error) + + /* "talib/_func.pxi":1834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2333 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2333)) __PYX_ERR(2, 1834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2333); + __Pyx_GIVEREF(__pyx_tuple__2333); + __pyx_codeobj__2334 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLABANDONEDBABY, 1834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2334)) __PYX_ERR(2, 1834, __pyx_L1_error) + + /* "talib/_func.pxi":1924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + __pyx_tuple__2335 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2335)) __PYX_ERR(2, 1924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2335); + __Pyx_GIVEREF(__pyx_tuple__2335); + __pyx_codeobj__2336 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLADVANCEBLOCK, 1924, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2336)) __PYX_ERR(2, 1924, __pyx_L1_error) + + /* "talib/_func.pxi":2012 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + __pyx_tuple__2337 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2337)) __PYX_ERR(2, 2012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2337); + __Pyx_GIVEREF(__pyx_tuple__2337); + __pyx_codeobj__2338 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLBELTHOLD, 2012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2338)) __PYX_ERR(2, 2012, __pyx_L1_error) + + /* "talib/_func.pxi":2100 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + __pyx_tuple__2339 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2339)) __PYX_ERR(2, 2100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2339); + __Pyx_GIVEREF(__pyx_tuple__2339); + __pyx_codeobj__2340 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLBREAKAWAY, 2100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2340)) __PYX_ERR(2, 2100, __pyx_L1_error) + + /* "talib/_func.pxi":2188 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + __pyx_tuple__2341 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2341)) __PYX_ERR(2, 2188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2341); + __Pyx_GIVEREF(__pyx_tuple__2341); + __pyx_codeobj__2342 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLCLOSINGMARUBOZU, 2188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2342)) __PYX_ERR(2, 2188, __pyx_L1_error) + + /* "talib/_func.pxi":2276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + __pyx_tuple__2343 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2343)) __PYX_ERR(2, 2276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2343); + __Pyx_GIVEREF(__pyx_tuple__2343); + __pyx_codeobj__2344 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLCONCEALBABYSWALL, 2276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2344)) __PYX_ERR(2, 2276, __pyx_L1_error) + + /* "talib/_func.pxi":2364 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + __pyx_tuple__2345 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2345)) __PYX_ERR(2, 2364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2345); + __Pyx_GIVEREF(__pyx_tuple__2345); + __pyx_codeobj__2346 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLCOUNTERATTACK, 2364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2346)) __PYX_ERR(2, 2364, __pyx_L1_error) + + /* "talib/_func.pxi":2452 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2347 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2347)) __PYX_ERR(2, 2452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2347); + __Pyx_GIVEREF(__pyx_tuple__2347); + __pyx_codeobj__2348 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLDARKCLOUDCOVER, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2348)) __PYX_ERR(2, 2452, __pyx_L1_error) + + /* "talib/_func.pxi":2542 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + __pyx_tuple__2349 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2349)) __PYX_ERR(2, 2542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2349); + __Pyx_GIVEREF(__pyx_tuple__2349); + __pyx_codeobj__2350 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLDOJI, 2542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2350)) __PYX_ERR(2, 2542, __pyx_L1_error) + + /* "talib/_func.pxi":2630 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + __pyx_tuple__2351 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2351)) __PYX_ERR(2, 2630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2351); + __Pyx_GIVEREF(__pyx_tuple__2351); + __pyx_codeobj__2352 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLDOJISTAR, 2630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2352)) __PYX_ERR(2, 2630, __pyx_L1_error) + + /* "talib/_func.pxi":2718 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + __pyx_tuple__2353 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2353)) __PYX_ERR(2, 2718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2353); + __Pyx_GIVEREF(__pyx_tuple__2353); + __pyx_codeobj__2354 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLDRAGONFLYDOJI, 2718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2354)) __PYX_ERR(2, 2718, __pyx_L1_error) + + /* "talib/_func.pxi":2806 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + __pyx_tuple__2355 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2355)) __PYX_ERR(2, 2806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2355); + __Pyx_GIVEREF(__pyx_tuple__2355); + __pyx_codeobj__2356 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLENGULFING, 2806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2356)) __PYX_ERR(2, 2806, __pyx_L1_error) + + /* "talib/_func.pxi":2894 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2357 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2357)) __PYX_ERR(2, 2894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2357); + __Pyx_GIVEREF(__pyx_tuple__2357); + __pyx_codeobj__2358 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLEVENINGDOJISTAR, 2894, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2358)) __PYX_ERR(2, 2894, __pyx_L1_error) + + /* "talib/_func.pxi":2984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2359 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2359)) __PYX_ERR(2, 2984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2359); + __Pyx_GIVEREF(__pyx_tuple__2359); + __pyx_codeobj__2360 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLEVENINGSTAR, 2984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2360)) __PYX_ERR(2, 2984, __pyx_L1_error) + + /* "talib/_func.pxi":3074 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + __pyx_tuple__2361 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2361)) __PYX_ERR(2, 3074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2361); + __Pyx_GIVEREF(__pyx_tuple__2361); + __pyx_codeobj__2362 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLGAPSIDESIDEWHITE, 3074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2362)) __PYX_ERR(2, 3074, __pyx_L1_error) + + /* "talib/_func.pxi":3162 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + __pyx_tuple__2363 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2363)) __PYX_ERR(2, 3162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2363); + __Pyx_GIVEREF(__pyx_tuple__2363); + __pyx_codeobj__2364 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLGRAVESTONEDOJI, 3162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2364)) __PYX_ERR(2, 3162, __pyx_L1_error) + + /* "talib/_func.pxi":3250 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + __pyx_tuple__2365 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2365)) __PYX_ERR(2, 3250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2365); + __Pyx_GIVEREF(__pyx_tuple__2365); + __pyx_codeobj__2366 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHAMMER, 3250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2366)) __PYX_ERR(2, 3250, __pyx_L1_error) + + /* "talib/_func.pxi":3338 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + __pyx_tuple__2367 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2367)) __PYX_ERR(2, 3338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2367); + __Pyx_GIVEREF(__pyx_tuple__2367); + __pyx_codeobj__2368 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHANGINGMAN, 3338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2368)) __PYX_ERR(2, 3338, __pyx_L1_error) + + /* "talib/_func.pxi":3426 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + __pyx_tuple__2369 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2369)) __PYX_ERR(2, 3426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2369); + __Pyx_GIVEREF(__pyx_tuple__2369); + __pyx_codeobj__2370 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHARAMI, 3426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2370)) __PYX_ERR(2, 3426, __pyx_L1_error) + + /* "talib/_func.pxi":3514 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + __pyx_tuple__2371 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2371)) __PYX_ERR(2, 3514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2371); + __Pyx_GIVEREF(__pyx_tuple__2371); + __pyx_codeobj__2372 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHARAMICROSS, 3514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2372)) __PYX_ERR(2, 3514, __pyx_L1_error) + + /* "talib/_func.pxi":3602 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + __pyx_tuple__2373 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2373)) __PYX_ERR(2, 3602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2373); + __Pyx_GIVEREF(__pyx_tuple__2373); + __pyx_codeobj__2374 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHIGHWAVE, 3602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2374)) __PYX_ERR(2, 3602, __pyx_L1_error) + + /* "talib/_func.pxi":3690 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + __pyx_tuple__2375 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2375)) __PYX_ERR(2, 3690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2375); + __Pyx_GIVEREF(__pyx_tuple__2375); + __pyx_codeobj__2376 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHIKKAKE, 3690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2376)) __PYX_ERR(2, 3690, __pyx_L1_error) + + /* "talib/_func.pxi":3778 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + __pyx_tuple__2377 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2377)) __PYX_ERR(2, 3778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2377); + __Pyx_GIVEREF(__pyx_tuple__2377); + __pyx_codeobj__2378 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHIKKAKEMOD, 3778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2378)) __PYX_ERR(2, 3778, __pyx_L1_error) + + /* "talib/_func.pxi":3866 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + __pyx_tuple__2379 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2379)) __PYX_ERR(2, 3866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2379); + __Pyx_GIVEREF(__pyx_tuple__2379); + __pyx_codeobj__2380 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLHOMINGPIGEON, 3866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2380)) __PYX_ERR(2, 3866, __pyx_L1_error) + + /* "talib/_func.pxi":3954 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + __pyx_tuple__2381 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2381)) __PYX_ERR(2, 3954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2381); + __Pyx_GIVEREF(__pyx_tuple__2381); + __pyx_codeobj__2382 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLIDENTICAL3CROWS, 3954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2382)) __PYX_ERR(2, 3954, __pyx_L1_error) + + /* "talib/_func.pxi":4042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + __pyx_tuple__2383 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2383)) __PYX_ERR(2, 4042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2383); + __Pyx_GIVEREF(__pyx_tuple__2383); + __pyx_codeobj__2384 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLINNECK, 4042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2384)) __PYX_ERR(2, 4042, __pyx_L1_error) + + /* "talib/_func.pxi":4130 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + __pyx_tuple__2385 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2385)) __PYX_ERR(2, 4130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2385); + __Pyx_GIVEREF(__pyx_tuple__2385); + __pyx_codeobj__2386 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLINVERTEDHAMMER, 4130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2386)) __PYX_ERR(2, 4130, __pyx_L1_error) + + /* "talib/_func.pxi":4218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + __pyx_tuple__2387 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2387)) __PYX_ERR(2, 4218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2387); + __Pyx_GIVEREF(__pyx_tuple__2387); + __pyx_codeobj__2388 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLKICKING, 4218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2388)) __PYX_ERR(2, 4218, __pyx_L1_error) + + /* "talib/_func.pxi":4306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + __pyx_tuple__2389 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2389)) __PYX_ERR(2, 4306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2389); + __Pyx_GIVEREF(__pyx_tuple__2389); + __pyx_codeobj__2390 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLKICKINGBYLENGTH, 4306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2390)) __PYX_ERR(2, 4306, __pyx_L1_error) + + /* "talib/_func.pxi":4394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + __pyx_tuple__2391 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2391)) __PYX_ERR(2, 4394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2391); + __Pyx_GIVEREF(__pyx_tuple__2391); + __pyx_codeobj__2392 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLLADDERBOTTOM, 4394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2392)) __PYX_ERR(2, 4394, __pyx_L1_error) + + /* "talib/_func.pxi":4482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + __pyx_tuple__2393 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2393)) __PYX_ERR(2, 4482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2393); + __Pyx_GIVEREF(__pyx_tuple__2393); + __pyx_codeobj__2394 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLLONGLEGGEDDOJI, 4482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2394)) __PYX_ERR(2, 4482, __pyx_L1_error) + + /* "talib/_func.pxi":4570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + __pyx_tuple__2395 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2395)) __PYX_ERR(2, 4570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2395); + __Pyx_GIVEREF(__pyx_tuple__2395); + __pyx_codeobj__2396 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLLONGLINE, 4570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2396)) __PYX_ERR(2, 4570, __pyx_L1_error) + + /* "talib/_func.pxi":4658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + __pyx_tuple__2397 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2397)) __PYX_ERR(2, 4658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2397); + __Pyx_GIVEREF(__pyx_tuple__2397); + __pyx_codeobj__2398 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLMARUBOZU, 4658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2398)) __PYX_ERR(2, 4658, __pyx_L1_error) + + /* "talib/_func.pxi":4746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + __pyx_tuple__2399 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2399)) __PYX_ERR(2, 4746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2399); + __Pyx_GIVEREF(__pyx_tuple__2399); + __pyx_codeobj__2400 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLMATCHINGLOW, 4746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2400)) __PYX_ERR(2, 4746, __pyx_L1_error) + + /* "talib/_func.pxi":4834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2401 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2401)) __PYX_ERR(2, 4834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2401); + __Pyx_GIVEREF(__pyx_tuple__2401); + __pyx_codeobj__2402 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLMATHOLD, 4834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2402)) __PYX_ERR(2, 4834, __pyx_L1_error) + + /* "talib/_func.pxi":4924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2403 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2403)) __PYX_ERR(2, 4924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2403); + __Pyx_GIVEREF(__pyx_tuple__2403); + __pyx_codeobj__2404 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLMORNINGDOJISTAR, 4924, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2404)) __PYX_ERR(2, 4924, __pyx_L1_error) + + /* "talib/_func.pxi":5014 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2405 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2405)) __PYX_ERR(2, 5014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2405); + __Pyx_GIVEREF(__pyx_tuple__2405); + __pyx_codeobj__2406 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLMORNINGSTAR, 5014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2406)) __PYX_ERR(2, 5014, __pyx_L1_error) + + /* "talib/_func.pxi":5104 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + __pyx_tuple__2407 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2407)) __PYX_ERR(2, 5104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2407); + __Pyx_GIVEREF(__pyx_tuple__2407); + __pyx_codeobj__2408 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLONNECK, 5104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2408)) __PYX_ERR(2, 5104, __pyx_L1_error) + + /* "talib/_func.pxi":5192 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + __pyx_tuple__2409 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2409)) __PYX_ERR(2, 5192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2409); + __Pyx_GIVEREF(__pyx_tuple__2409); + __pyx_codeobj__2410 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLPIERCING, 5192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2410)) __PYX_ERR(2, 5192, __pyx_L1_error) + + /* "talib/_func.pxi":5280 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + __pyx_tuple__2411 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2411)) __PYX_ERR(2, 5280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2411); + __Pyx_GIVEREF(__pyx_tuple__2411); + __pyx_codeobj__2412 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLRICKSHAWMAN, 5280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2412)) __PYX_ERR(2, 5280, __pyx_L1_error) + + /* "talib/_func.pxi":5368 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + __pyx_tuple__2413 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2413)) __PYX_ERR(2, 5368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2413); + __Pyx_GIVEREF(__pyx_tuple__2413); + __pyx_codeobj__2414 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLRISEFALL3METHODS, 5368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2414)) __PYX_ERR(2, 5368, __pyx_L1_error) + + /* "talib/_func.pxi":5456 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + __pyx_tuple__2415 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2415)) __PYX_ERR(2, 5456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2415); + __Pyx_GIVEREF(__pyx_tuple__2415); + __pyx_codeobj__2416 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSEPARATINGLINES, 5456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2416)) __PYX_ERR(2, 5456, __pyx_L1_error) + + /* "talib/_func.pxi":5544 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + __pyx_tuple__2417 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2417)) __PYX_ERR(2, 5544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2417); + __Pyx_GIVEREF(__pyx_tuple__2417); + __pyx_codeobj__2418 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSHOOTINGSTAR, 5544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2418)) __PYX_ERR(2, 5544, __pyx_L1_error) + + /* "talib/_func.pxi":5632 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + __pyx_tuple__2419 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2419)) __PYX_ERR(2, 5632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2419); + __Pyx_GIVEREF(__pyx_tuple__2419); + __pyx_codeobj__2420 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSHORTLINE, 5632, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2420)) __PYX_ERR(2, 5632, __pyx_L1_error) + + /* "talib/_func.pxi":5720 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + __pyx_tuple__2421 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2421)) __PYX_ERR(2, 5720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2421); + __Pyx_GIVEREF(__pyx_tuple__2421); + __pyx_codeobj__2422 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSPINNINGTOP, 5720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2422)) __PYX_ERR(2, 5720, __pyx_L1_error) + + /* "talib/_func.pxi":5808 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + __pyx_tuple__2423 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2423)) __PYX_ERR(2, 5808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2423); + __Pyx_GIVEREF(__pyx_tuple__2423); + __pyx_codeobj__2424 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSTALLEDPATTERN, 5808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2424)) __PYX_ERR(2, 5808, __pyx_L1_error) + + /* "talib/_func.pxi":5896 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + __pyx_tuple__2425 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2425)) __PYX_ERR(2, 5896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2425); + __Pyx_GIVEREF(__pyx_tuple__2425); + __pyx_codeobj__2426 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLSTICKSANDWICH, 5896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2426)) __PYX_ERR(2, 5896, __pyx_L1_error) + + /* "talib/_func.pxi":5984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + __pyx_tuple__2427 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2427)) __PYX_ERR(2, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2427); + __Pyx_GIVEREF(__pyx_tuple__2427); + __pyx_codeobj__2428 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLTAKURI, 5984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2428)) __PYX_ERR(2, 5984, __pyx_L1_error) + + /* "talib/_func.pxi":6072 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + __pyx_tuple__2429 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2429)) __PYX_ERR(2, 6072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2429); + __Pyx_GIVEREF(__pyx_tuple__2429); + __pyx_codeobj__2430 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2429, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLTASUKIGAP, 6072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2430)) __PYX_ERR(2, 6072, __pyx_L1_error) + + /* "talib/_func.pxi":6160 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + __pyx_tuple__2431 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2431)) __PYX_ERR(2, 6160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2431); + __Pyx_GIVEREF(__pyx_tuple__2431); + __pyx_codeobj__2432 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2431, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLTHRUSTING, 6160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2432)) __PYX_ERR(2, 6160, __pyx_L1_error) + + /* "talib/_func.pxi":6248 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + __pyx_tuple__2433 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2433)) __PYX_ERR(2, 6248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2433); + __Pyx_GIVEREF(__pyx_tuple__2433); + __pyx_codeobj__2434 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2433, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLTRISTAR, 6248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2434)) __PYX_ERR(2, 6248, __pyx_L1_error) + + /* "talib/_func.pxi":6336 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + __pyx_tuple__2435 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2435)) __PYX_ERR(2, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2435); + __Pyx_GIVEREF(__pyx_tuple__2435); + __pyx_codeobj__2436 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2435, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLUNIQUE3RIVER, 6336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2436)) __PYX_ERR(2, 6336, __pyx_L1_error) + + /* "talib/_func.pxi":6424 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + __pyx_tuple__2437 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2437)) __PYX_ERR(2, 6424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2437); + __Pyx_GIVEREF(__pyx_tuple__2437); + __pyx_codeobj__2438 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2437, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLUPSIDEGAP2CROWS, 6424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2438)) __PYX_ERR(2, 6424, __pyx_L1_error) + + /* "talib/_func.pxi":6512 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + __pyx_tuple__2439 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2439)) __PYX_ERR(2, 6512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2439); + __Pyx_GIVEREF(__pyx_tuple__2439); + __pyx_codeobj__2440 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2439, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CDLXSIDEGAP3METHODS, 6512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2440)) __PYX_ERR(2, 6512, __pyx_L1_error) + + /* "talib/_func.pxi":6600 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + __pyx_tuple__2441 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2441)) __PYX_ERR(2, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2441); + __Pyx_GIVEREF(__pyx_tuple__2441); + __pyx_codeobj__2442 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2441, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CEIL, 6600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2442)) __PYX_ERR(2, 6600, __pyx_L1_error) + + /* "talib/_func.pxi":6649 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + __pyx_tuple__2443 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2443)) __PYX_ERR(2, 6649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2443); + __Pyx_GIVEREF(__pyx_tuple__2443); + __pyx_codeobj__2444 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2443, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CMO, 6649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2444)) __PYX_ERR(2, 6649, __pyx_L1_error) + + /* "talib/_func.pxi":6700 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + __pyx_tuple__2445 = PyTuple_Pack(16, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2445)) __PYX_ERR(2, 6700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2445); + __Pyx_GIVEREF(__pyx_tuple__2445); + __pyx_codeobj__2446 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2445, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_CORREL, 6700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2446)) __PYX_ERR(2, 6700, __pyx_L1_error) + + /* "talib/_func.pxi":6765 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + __pyx_tuple__2447 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2447)) __PYX_ERR(2, 6765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2447); + __Pyx_GIVEREF(__pyx_tuple__2447); + __pyx_codeobj__2448 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2447, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_COS, 6765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2448)) __PYX_ERR(2, 6765, __pyx_L1_error) + + /* "talib/_func.pxi":6814 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + __pyx_tuple__2449 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2449)) __PYX_ERR(2, 6814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2449); + __Pyx_GIVEREF(__pyx_tuple__2449); + __pyx_codeobj__2450 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2449, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_COSH, 6814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2450)) __PYX_ERR(2, 6814, __pyx_L1_error) + + /* "talib/_func.pxi":6863 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2451 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2451)) __PYX_ERR(2, 6863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2451); + __Pyx_GIVEREF(__pyx_tuple__2451); + __pyx_codeobj__2452 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2451, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_DEMA, 6863, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2452)) __PYX_ERR(2, 6863, __pyx_L1_error) + + /* "talib/_func.pxi":6914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + __pyx_tuple__2453 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2453)) __PYX_ERR(2, 6914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2453); + __Pyx_GIVEREF(__pyx_tuple__2453); + __pyx_codeobj__2454 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2453, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_DIV, 6914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2454)) __PYX_ERR(2, 6914, __pyx_L1_error) + + /* "talib/_func.pxi":6977 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2455 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2455)) __PYX_ERR(2, 6977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2455); + __Pyx_GIVEREF(__pyx_tuple__2455); + __pyx_codeobj__2456 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2455, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_DX, 6977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2456)) __PYX_ERR(2, 6977, __pyx_L1_error) + + /* "talib/_func.pxi":7054 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2457 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2457)) __PYX_ERR(2, 7054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2457); + __Pyx_GIVEREF(__pyx_tuple__2457); + __pyx_codeobj__2458 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2457, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_EMA, 7054, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2458)) __PYX_ERR(2, 7054, __pyx_L1_error) + + /* "talib/_func.pxi":7105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + __pyx_tuple__2459 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2459)) __PYX_ERR(2, 7105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2459); + __Pyx_GIVEREF(__pyx_tuple__2459); + __pyx_codeobj__2460 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_EXP, 7105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2460)) __PYX_ERR(2, 7105, __pyx_L1_error) + + /* "talib/_func.pxi":7154 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + __pyx_tuple__2461 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2461)) __PYX_ERR(2, 7154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2461); + __Pyx_GIVEREF(__pyx_tuple__2461); + __pyx_codeobj__2462 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2461, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_FLOOR, 7154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2462)) __PYX_ERR(2, 7154, __pyx_L1_error) + + /* "talib/_func.pxi":7203 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + __pyx_tuple__2463 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2463)) __PYX_ERR(2, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2463); + __Pyx_GIVEREF(__pyx_tuple__2463); + __pyx_codeobj__2464 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2463, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_DCPERIOD, 7203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2464)) __PYX_ERR(2, 7203, __pyx_L1_error) + + /* "talib/_func.pxi":7252 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + __pyx_tuple__2465 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2465)) __PYX_ERR(2, 7252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2465); + __Pyx_GIVEREF(__pyx_tuple__2465); + __pyx_codeobj__2466 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_DCPHASE, 7252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2466)) __PYX_ERR(2, 7252, __pyx_L1_error) + + /* "talib/_func.pxi":7301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + __pyx_tuple__2467 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinphase, __pyx_n_s_outinphase_data, __pyx_n_s_outquadrature, __pyx_n_s_outquadrature_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2467)) __PYX_ERR(2, 7301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2467); + __Pyx_GIVEREF(__pyx_tuple__2467); + __pyx_codeobj__2468 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_PHASOR, 7301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2468)) __PYX_ERR(2, 7301, __pyx_L1_error) + + /* "talib/_func.pxi":7357 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + __pyx_tuple__2469 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outsine, __pyx_n_s_outsine_data, __pyx_n_s_outleadsine, __pyx_n_s_outleadsine_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2469)) __PYX_ERR(2, 7357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2469); + __Pyx_GIVEREF(__pyx_tuple__2469); + __pyx_codeobj__2470 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_SINE, 7357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2470)) __PYX_ERR(2, 7357, __pyx_L1_error) + + /* "talib/_func.pxi":7413 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + __pyx_tuple__2471 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2471)) __PYX_ERR(2, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2471); + __Pyx_GIVEREF(__pyx_tuple__2471); + __pyx_codeobj__2472 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_TRENDLINE, 7413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2472)) __PYX_ERR(2, 7413, __pyx_L1_error) + + /* "talib/_func.pxi":7462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + __pyx_tuple__2473 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2473)) __PYX_ERR(2, 7462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2473); + __Pyx_GIVEREF(__pyx_tuple__2473); + __pyx_codeobj__2474 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_HT_TRENDMODE, 7462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2474)) __PYX_ERR(2, 7462, __pyx_L1_error) + + /* "talib/_func.pxi":7511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2475 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2475)) __PYX_ERR(2, 7511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2475); + __Pyx_GIVEREF(__pyx_tuple__2475); + __pyx_codeobj__2476 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_KAMA, 7511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2476)) __PYX_ERR(2, 7511, __pyx_L1_error) + + /* "talib/_func.pxi":7562 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + __pyx_tuple__2477 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2477)) __PYX_ERR(2, 7562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2477); + __Pyx_GIVEREF(__pyx_tuple__2477); + __pyx_codeobj__2478 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LINEARREG, 7562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2478)) __PYX_ERR(2, 7562, __pyx_L1_error) + + /* "talib/_func.pxi":7613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + __pyx_tuple__2479 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2479)) __PYX_ERR(2, 7613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2479); + __Pyx_GIVEREF(__pyx_tuple__2479); + __pyx_codeobj__2480 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LINEARREG_ANGLE, 7613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2480)) __PYX_ERR(2, 7613, __pyx_L1_error) + + /* "talib/_func.pxi":7664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + __pyx_tuple__2481 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2481)) __PYX_ERR(2, 7664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2481); + __Pyx_GIVEREF(__pyx_tuple__2481); + __pyx_codeobj__2482 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LINEARREG_INTERCEPT, 7664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2482)) __PYX_ERR(2, 7664, __pyx_L1_error) + + /* "talib/_func.pxi":7715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + __pyx_tuple__2483 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2483)) __PYX_ERR(2, 7715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2483); + __Pyx_GIVEREF(__pyx_tuple__2483); + __pyx_codeobj__2484 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LINEARREG_SLOPE, 7715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2484)) __PYX_ERR(2, 7715, __pyx_L1_error) + + /* "talib/_func.pxi":7766 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + __pyx_tuple__2485 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2485)) __PYX_ERR(2, 7766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2485); + __Pyx_GIVEREF(__pyx_tuple__2485); + __pyx_codeobj__2486 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LN, 7766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2486)) __PYX_ERR(2, 7766, __pyx_L1_error) + + /* "talib/_func.pxi":7815 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + __pyx_tuple__2487 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2487)) __PYX_ERR(2, 7815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2487); + __Pyx_GIVEREF(__pyx_tuple__2487); + __pyx_codeobj__2488 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_LOG10, 7815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2488)) __PYX_ERR(2, 7815, __pyx_L1_error) + + /* "talib/_func.pxi":7864 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + __pyx_tuple__2489 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2489)) __PYX_ERR(2, 7864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2489); + __Pyx_GIVEREF(__pyx_tuple__2489); + __pyx_codeobj__2490 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2489, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MA, 7864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2490)) __PYX_ERR(2, 7864, __pyx_L1_error) + + /* "talib/_func.pxi":7916 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + __pyx_tuple__2491 = PyTuple_Pack(20, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2491)) __PYX_ERR(2, 7916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2491); + __Pyx_GIVEREF(__pyx_tuple__2491); + __pyx_codeobj__2492 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2491, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MACD, 7916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2492)) __PYX_ERR(2, 7916, __pyx_L1_error) + + /* "talib/_func.pxi":7983 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + __pyx_tuple__2493 = PyTuple_Pack(23, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_fastmatype, __pyx_n_s_slowperiod, __pyx_n_s_slowmatype, __pyx_n_s_signalperiod, __pyx_n_s_signalmatype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2493)) __PYX_ERR(2, 7983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2493); + __Pyx_GIVEREF(__pyx_tuple__2493); + __pyx_codeobj__2494 = (PyObject*)__Pyx_PyCode_New(7, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2493, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MACDEXT, 7983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2494)) __PYX_ERR(2, 7983, __pyx_L1_error) + + /* "talib/_func.pxi":8053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + __pyx_tuple__2495 = PyTuple_Pack(18, __pyx_n_s_real, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2495)) __PYX_ERR(2, 8053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2495); + __Pyx_GIVEREF(__pyx_tuple__2495); + __pyx_codeobj__2496 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2495, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MACDFIX, 8053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2496)) __PYX_ERR(2, 8053, __pyx_L1_error) + + /* "talib/_func.pxi":8118 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + __pyx_tuple__2497 = PyTuple_Pack(17, __pyx_n_s_real, __pyx_n_s_fastlimit, __pyx_n_s_slowlimit, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmama, __pyx_n_s_outmama_data, __pyx_n_s_outfama, __pyx_n_s_outfama_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2497)) __PYX_ERR(2, 8118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2497); + __Pyx_GIVEREF(__pyx_tuple__2497); + __pyx_codeobj__2498 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MAMA, 8118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2498)) __PYX_ERR(2, 8118, __pyx_L1_error) + + /* "talib/_func.pxi":8177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + __pyx_tuple__2499 = PyTuple_Pack(18, __pyx_n_s_real, __pyx_n_s_periods, __pyx_n_s_minperiod, __pyx_n_s_maxperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_periods_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2499)) __PYX_ERR(2, 8177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2499); + __Pyx_GIVEREF(__pyx_tuple__2499); + __pyx_codeobj__2500 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MAVP, 8177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2500)) __PYX_ERR(2, 8177, __pyx_L1_error) + + /* "talib/_func.pxi":8244 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2501 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2501)) __PYX_ERR(2, 8244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2501); + __Pyx_GIVEREF(__pyx_tuple__2501); + __pyx_codeobj__2502 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2501, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MAX, 8244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2502)) __PYX_ERR(2, 8244, __pyx_L1_error) + + /* "talib/_func.pxi":8295 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2503 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2503)) __PYX_ERR(2, 8295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2503); + __Pyx_GIVEREF(__pyx_tuple__2503); + __pyx_codeobj__2504 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2503, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MAXINDEX, 8295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2504)) __PYX_ERR(2, 8295, __pyx_L1_error) + + /* "talib/_func.pxi":8346 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + __pyx_tuple__2505 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2505)) __PYX_ERR(2, 8346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2505); + __Pyx_GIVEREF(__pyx_tuple__2505); + __pyx_codeobj__2506 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2505, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MEDPRICE, 8346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2506)) __PYX_ERR(2, 8346, __pyx_L1_error) + + /* "talib/_func.pxi":8408 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + __pyx_tuple__2507 = PyTuple_Pack(20, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2507)) __PYX_ERR(2, 8408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2507); + __Pyx_GIVEREF(__pyx_tuple__2507); + __pyx_codeobj__2508 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2507, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MFI, 8408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2508)) __PYX_ERR(2, 8408, __pyx_L1_error) + + /* "talib/_func.pxi":8498 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + __pyx_tuple__2509 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2509)) __PYX_ERR(2, 8498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2509); + __Pyx_GIVEREF(__pyx_tuple__2509); + __pyx_codeobj__2510 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2509, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MIDPOINT, 8498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2510)) __PYX_ERR(2, 8498, __pyx_L1_error) + + /* "talib/_func.pxi":8549 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2511 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2511)) __PYX_ERR(2, 8549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2511); + __Pyx_GIVEREF(__pyx_tuple__2511); + __pyx_codeobj__2512 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2511, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MIDPRICE, 8549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2512)) __PYX_ERR(2, 8549, __pyx_L1_error) + + /* "talib/_func.pxi":8613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + __pyx_tuple__2513 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2513)) __PYX_ERR(2, 8613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2513); + __Pyx_GIVEREF(__pyx_tuple__2513); + __pyx_codeobj__2514 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2513, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MIN, 8613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2514)) __PYX_ERR(2, 8613, __pyx_L1_error) + + /* "talib/_func.pxi":8664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2515 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2515)) __PYX_ERR(2, 8664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2515); + __Pyx_GIVEREF(__pyx_tuple__2515); + __pyx_codeobj__2516 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2515, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MININDEX, 8664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2516)) __PYX_ERR(2, 8664, __pyx_L1_error) + + /* "talib/_func.pxi":8715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2517 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmin, __pyx_n_s_outmin_data, __pyx_n_s_outmax, __pyx_n_s_outmax_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2517)) __PYX_ERR(2, 8715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2517); + __Pyx_GIVEREF(__pyx_tuple__2517); + __pyx_codeobj__2518 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MINMAX, 8715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2518)) __PYX_ERR(2, 8715, __pyx_L1_error) + + /* "talib/_func.pxi":8773 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2519 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outminidx, __pyx_n_s_outminidx_data, __pyx_n_s_outmaxidx, __pyx_n_s_outmaxidx_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2519)) __PYX_ERR(2, 8773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2519); + __Pyx_GIVEREF(__pyx_tuple__2519); + __pyx_codeobj__2520 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MINMAXINDEX, 8773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2520)) __PYX_ERR(2, 8773, __pyx_L1_error) + + /* "talib/_func.pxi":8831 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2521 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2521)) __PYX_ERR(2, 8831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2521); + __Pyx_GIVEREF(__pyx_tuple__2521); + __pyx_codeobj__2522 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MINUS_DI, 8831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2522)) __PYX_ERR(2, 8831, __pyx_L1_error) + + /* "talib/_func.pxi":8908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2523 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2523)) __PYX_ERR(2, 8908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2523); + __Pyx_GIVEREF(__pyx_tuple__2523); + __pyx_codeobj__2524 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2523, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MINUS_DM, 8908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2524)) __PYX_ERR(2, 8908, __pyx_L1_error) + + /* "talib/_func.pxi":8972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + __pyx_tuple__2525 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2525)) __PYX_ERR(2, 8972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2525); + __Pyx_GIVEREF(__pyx_tuple__2525); + __pyx_codeobj__2526 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2525, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MOM, 8972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2526)) __PYX_ERR(2, 8972, __pyx_L1_error) + + /* "talib/_func.pxi":9023 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + __pyx_tuple__2527 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2527)) __PYX_ERR(2, 9023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2527); + __Pyx_GIVEREF(__pyx_tuple__2527); + __pyx_codeobj__2528 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2527, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_MULT, 9023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2528)) __PYX_ERR(2, 9023, __pyx_L1_error) + + /* "talib/_func.pxi":9086 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2529 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2529)) __PYX_ERR(2, 9086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2529); + __Pyx_GIVEREF(__pyx_tuple__2529); + __pyx_codeobj__2530 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2529, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_NATR, 9086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2530)) __PYX_ERR(2, 9086, __pyx_L1_error) + + /* "talib/_func.pxi":9163 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + __pyx_tuple__2531 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2531)) __PYX_ERR(2, 9163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2531); + __Pyx_GIVEREF(__pyx_tuple__2531); + __pyx_codeobj__2532 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2531, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_OBV, 9163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2532)) __PYX_ERR(2, 9163, __pyx_L1_error) + + /* "talib/_func.pxi":9226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2533 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2533)) __PYX_ERR(2, 9226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2533); + __Pyx_GIVEREF(__pyx_tuple__2533); + __pyx_codeobj__2534 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2533, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_PLUS_DI, 9226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2534)) __PYX_ERR(2, 9226, __pyx_L1_error) + + /* "talib/_func.pxi":9303 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2535 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2535)) __PYX_ERR(2, 9303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2535); + __Pyx_GIVEREF(__pyx_tuple__2535); + __pyx_codeobj__2536 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2535, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_PLUS_DM, 9303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2536)) __PYX_ERR(2, 9303, __pyx_L1_error) + + /* "talib/_func.pxi":9367 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_tuple__2537 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2537)) __PYX_ERR(2, 9367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2537); + __Pyx_GIVEREF(__pyx_tuple__2537); + __pyx_codeobj__2538 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2537, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_PPO, 9367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2538)) __PYX_ERR(2, 9367, __pyx_L1_error) + + /* "talib/_func.pxi":9420 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + __pyx_tuple__2539 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2539)) __PYX_ERR(2, 9420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2539); + __Pyx_GIVEREF(__pyx_tuple__2539); + __pyx_codeobj__2540 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2539, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ROC, 9420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2540)) __PYX_ERR(2, 9420, __pyx_L1_error) + + /* "talib/_func.pxi":9471 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + __pyx_tuple__2541 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2541)) __PYX_ERR(2, 9471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2541); + __Pyx_GIVEREF(__pyx_tuple__2541); + __pyx_codeobj__2542 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2541, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ROCP, 9471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2542)) __PYX_ERR(2, 9471, __pyx_L1_error) + + /* "talib/_func.pxi":9522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + __pyx_tuple__2543 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2543)) __PYX_ERR(2, 9522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2543); + __Pyx_GIVEREF(__pyx_tuple__2543); + __pyx_codeobj__2544 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2543, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ROCR, 9522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2544)) __PYX_ERR(2, 9522, __pyx_L1_error) + + /* "talib/_func.pxi":9573 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + __pyx_tuple__2545 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2545)) __PYX_ERR(2, 9573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2545); + __Pyx_GIVEREF(__pyx_tuple__2545); + __pyx_codeobj__2546 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ROCR100, 9573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2546)) __PYX_ERR(2, 9573, __pyx_L1_error) + + /* "talib/_func.pxi":9624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + __pyx_tuple__2547 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2547)) __PYX_ERR(2, 9624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2547); + __Pyx_GIVEREF(__pyx_tuple__2547); + __pyx_codeobj__2548 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2547, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_RSI, 9624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2548)) __PYX_ERR(2, 9624, __pyx_L1_error) + + /* "talib/_func.pxi":9675 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + __pyx_tuple__2549 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_acceleration, __pyx_n_s_maximum, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2549)) __PYX_ERR(2, 9675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2549); + __Pyx_GIVEREF(__pyx_tuple__2549); + __pyx_codeobj__2550 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2549, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SAR, 9675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2550)) __PYX_ERR(2, 9675, __pyx_L1_error) + + /* "talib/_func.pxi":9740 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + __pyx_tuple__2551 = PyTuple_Pack(23, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_startvalue, __pyx_n_s_offsetonreverse, __pyx_n_s_accelerationinitlong, __pyx_n_s_accelerationlong, __pyx_n_s_accelerationmaxlong, __pyx_n_s_accelerationinitshort, __pyx_n_s_accelerationshort, __pyx_n_s_accelerationmaxshort, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2551)) __PYX_ERR(2, 9740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2551); + __Pyx_GIVEREF(__pyx_tuple__2551); + __pyx_codeobj__2552 = (PyObject*)__Pyx_PyCode_New(10, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2551, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SAREXT, 9740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2552)) __PYX_ERR(2, 9740, __pyx_L1_error) + + /* "talib/_func.pxi":9811 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + __pyx_tuple__2553 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2553)) __PYX_ERR(2, 9811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2553); + __Pyx_GIVEREF(__pyx_tuple__2553); + __pyx_codeobj__2554 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2553, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SIN, 9811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2554)) __PYX_ERR(2, 9811, __pyx_L1_error) + + /* "talib/_func.pxi":9860 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + __pyx_tuple__2555 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2555)) __PYX_ERR(2, 9860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2555); + __Pyx_GIVEREF(__pyx_tuple__2555); + __pyx_codeobj__2556 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2555, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SINH, 9860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2556)) __PYX_ERR(2, 9860, __pyx_L1_error) + + /* "talib/_func.pxi":9909 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2557 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2557)) __PYX_ERR(2, 9909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2557); + __Pyx_GIVEREF(__pyx_tuple__2557); + __pyx_codeobj__2558 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2557, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SMA, 9909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2558)) __PYX_ERR(2, 9909, __pyx_L1_error) + + /* "talib/_func.pxi":9960 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + __pyx_tuple__2559 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2559)) __PYX_ERR(2, 9960, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2559); + __Pyx_GIVEREF(__pyx_tuple__2559); + __pyx_codeobj__2560 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2559, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SQRT, 9960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2560)) __PYX_ERR(2, 9960, __pyx_L1_error) + + /* "talib/_func.pxi":10009 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_tuple__2561 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2561)) __PYX_ERR(2, 10009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2561); + __Pyx_GIVEREF(__pyx_tuple__2561); + __pyx_codeobj__2562 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2561, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_STDDEV, 10009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2562)) __PYX_ERR(2, 10009, __pyx_L1_error) + + /* "talib/_func.pxi":10061 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + __pyx_tuple__2563 = PyTuple_Pack(24, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_slowk_period, __pyx_n_s_slowk_matype, __pyx_n_s_slowd_period, __pyx_n_s_slowd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outslowk, __pyx_n_s_outslowk_data, __pyx_n_s_outslowd, __pyx_n_s_outslowd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2563)) __PYX_ERR(2, 10061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2563); + __Pyx_GIVEREF(__pyx_tuple__2563); + __pyx_codeobj__2564 = (PyObject*)__Pyx_PyCode_New(8, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2563, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_STOCH, 10061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2564)) __PYX_ERR(2, 10061, __pyx_L1_error) + + /* "talib/_func.pxi":10149 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_tuple__2565 = PyTuple_Pack(22, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastk_data, __pyx_n_s_outfastd, __pyx_n_s_outfastd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2565)) __PYX_ERR(2, 10149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2565); + __Pyx_GIVEREF(__pyx_tuple__2565); + __pyx_codeobj__2566 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2565, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_STOCHF, 10149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2566)) __PYX_ERR(2, 10149, __pyx_L1_error) + + /* "talib/_func.pxi":10235 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_tuple__2567 = PyTuple_Pack(19, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastk_data, __pyx_n_s_outfastd, __pyx_n_s_outfastd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2567)) __PYX_ERR(2, 10235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2567); + __Pyx_GIVEREF(__pyx_tuple__2567); + __pyx_codeobj__2568 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2567, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_STOCHRSI, 10235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2568)) __PYX_ERR(2, 10235, __pyx_L1_error) + + /* "talib/_func.pxi":10296 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + __pyx_tuple__2569 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2569)) __PYX_ERR(2, 10296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2569); + __Pyx_GIVEREF(__pyx_tuple__2569); + __pyx_codeobj__2570 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2569, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SUB, 10296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2570)) __PYX_ERR(2, 10296, __pyx_L1_error) + + /* "talib/_func.pxi":10359 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + __pyx_tuple__2571 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2571)) __PYX_ERR(2, 10359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2571); + __Pyx_GIVEREF(__pyx_tuple__2571); + __pyx_codeobj__2572 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2571, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_SUM, 10359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2572)) __PYX_ERR(2, 10359, __pyx_L1_error) + + /* "talib/_func.pxi":10410 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + __pyx_tuple__2573 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_vfactor, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2573)) __PYX_ERR(2, 10410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2573); + __Pyx_GIVEREF(__pyx_tuple__2573); + __pyx_codeobj__2574 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2573, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_T3, 10410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2574)) __PYX_ERR(2, 10410, __pyx_L1_error) + + /* "talib/_func.pxi":10462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + __pyx_tuple__2575 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2575)) __PYX_ERR(2, 10462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2575); + __Pyx_GIVEREF(__pyx_tuple__2575); + __pyx_codeobj__2576 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2575, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TAN, 10462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2576)) __PYX_ERR(2, 10462, __pyx_L1_error) + + /* "talib/_func.pxi":10511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + __pyx_tuple__2577 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2577)) __PYX_ERR(2, 10511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2577); + __Pyx_GIVEREF(__pyx_tuple__2577); + __pyx_codeobj__2578 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2577, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TANH, 10511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2578)) __PYX_ERR(2, 10511, __pyx_L1_error) + + /* "talib/_func.pxi":10560 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2579 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2579)) __PYX_ERR(2, 10560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2579); + __Pyx_GIVEREF(__pyx_tuple__2579); + __pyx_codeobj__2580 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2579, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TEMA, 10560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2580)) __PYX_ERR(2, 10560, __pyx_L1_error) + + /* "talib/_func.pxi":10611 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + __pyx_tuple__2581 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2581)) __PYX_ERR(2, 10611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2581); + __Pyx_GIVEREF(__pyx_tuple__2581); + __pyx_codeobj__2582 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2581, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TRANGE, 10611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2582)) __PYX_ERR(2, 10611, __pyx_L1_error) + + /* "talib/_func.pxi":10686 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2583 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2583)) __PYX_ERR(2, 10686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2583); + __Pyx_GIVEREF(__pyx_tuple__2583); + __pyx_codeobj__2584 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2583, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TRIMA, 10686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2584)) __PYX_ERR(2, 10686, __pyx_L1_error) + + /* "talib/_func.pxi":10737 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2585 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2585)) __PYX_ERR(2, 10737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2585); + __Pyx_GIVEREF(__pyx_tuple__2585); + __pyx_codeobj__2586 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2585, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TRIX, 10737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2586)) __PYX_ERR(2, 10737, __pyx_L1_error) + + /* "talib/_func.pxi":10788 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + __pyx_tuple__2587 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2587)) __PYX_ERR(2, 10788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2587); + __Pyx_GIVEREF(__pyx_tuple__2587); + __pyx_codeobj__2588 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2587, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TSF, 10788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2588)) __PYX_ERR(2, 10788, __pyx_L1_error) + + /* "talib/_func.pxi":10839 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + __pyx_tuple__2589 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2589)) __PYX_ERR(2, 10839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2589); + __Pyx_GIVEREF(__pyx_tuple__2589); + __pyx_codeobj__2590 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2589, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_TYPPRICE, 10839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2590)) __PYX_ERR(2, 10839, __pyx_L1_error) + + /* "talib/_func.pxi":10914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + __pyx_tuple__2591 = PyTuple_Pack(20, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod1, __pyx_n_s_timeperiod2, __pyx_n_s_timeperiod3, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2591)) __PYX_ERR(2, 10914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2591); + __Pyx_GIVEREF(__pyx_tuple__2591); + __pyx_codeobj__2592 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2591, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_ULTOSC, 10914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2592)) __PYX_ERR(2, 10914, __pyx_L1_error) + + /* "talib/_func.pxi":10993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_tuple__2593 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2593)) __PYX_ERR(2, 10993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2593); + __Pyx_GIVEREF(__pyx_tuple__2593); + __pyx_codeobj__2594 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2593, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_VAR, 10993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2594)) __PYX_ERR(2, 10993, __pyx_L1_error) + + /* "talib/_func.pxi":11045 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + __pyx_tuple__2595 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2595)) __PYX_ERR(2, 11045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2595); + __Pyx_GIVEREF(__pyx_tuple__2595); + __pyx_codeobj__2596 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2595, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_WCLPRICE, 11045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2596)) __PYX_ERR(2, 11045, __pyx_L1_error) + + /* "talib/_func.pxi":11120 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2597 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2597)) __PYX_ERR(2, 11120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2597); + __Pyx_GIVEREF(__pyx_tuple__2597); + __pyx_codeobj__2598 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2597, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_WILLR, 11120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2598)) __PYX_ERR(2, 11120, __pyx_L1_error) + + /* "talib/_func.pxi":11197 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2599 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2599)) __PYX_ERR(2, 11197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2599); + __Pyx_GIVEREF(__pyx_tuple__2599); + __pyx_codeobj__2600 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2599, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_2, __pyx_n_s_WMA, 11197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2600)) __PYX_ERR(2, 11197, __pyx_L1_error) + + /* "talib/_abstract.pxi":47 + * if sys.version >= '3': + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return bytes(s, 'ascii') + * + */ + __pyx_tuple__2601 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__2601)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2601); + __Pyx_GIVEREF(__pyx_tuple__2601); + __pyx_codeobj__2602 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2601, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_str2bytes, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2602)) __PYX_ERR(1, 47, __pyx_L1_error) + + /* "talib/_abstract.pxi":50 + * return bytes(s, 'ascii') + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b.decode('ascii') + * + */ + __pyx_tuple__2603 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__2603)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2603); + __Pyx_GIVEREF(__pyx_tuple__2603); + __pyx_codeobj__2604 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2603, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_bytes2str, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2604)) __PYX_ERR(1, 50, __pyx_L1_error) + + /* "talib/_abstract.pxi":55 + * else: + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return s + * + */ + __pyx_tuple__2605 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__2605)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2605); + __Pyx_GIVEREF(__pyx_tuple__2605); + __pyx_codeobj__2606 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2605, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_str2bytes, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2606)) __PYX_ERR(1, 55, __pyx_L1_error) + + /* "talib/_abstract.pxi":58 + * return s + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b + * + */ + __pyx_tuple__2607 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__2607)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2607); + __Pyx_GIVEREF(__pyx_tuple__2607); + __pyx_codeobj__2608 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2607, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_bytes2str, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2608)) __PYX_ERR(1, 58, __pyx_L1_error) + + /* "talib/_abstract.pxi":90 + * """ + * + * def __init__(self, function_name, func_object, *args, **kwargs): # <<<<<<<<<<<<<< + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() + */ + __pyx_tuple__2609 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_function_name, __pyx_n_s_func_object, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__2609)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2609); + __Pyx_GIVEREF(__pyx_tuple__2609); + __pyx_codeobj__2610 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2609, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_init, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2610)) __PYX_ERR(1, 90, __pyx_L1_error) + + /* "talib/_abstract.pxi":109 + * self.func_object = func_object + * + * def __initialize_function_info(self): # <<<<<<<<<<<<<< + * # function info + * self.__info = _ta_getFuncInfo(self.__name) + */ + __pyx_tuple__2611 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_info, __pyx_n_s_input_name, __pyx_n_s_param_name, __pyx_n_s_output_name); if (unlikely(!__pyx_tuple__2611)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2611); + __Pyx_GIVEREF(__pyx_tuple__2611); + __pyx_codeobj__2612 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2611, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_initialize_function_info, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2612)) __PYX_ERR(1, 109, __pyx_L1_error) + + /* "talib/_abstract.pxi":139 + * + * @property + * def info(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the function's info dict. + */ + __pyx_tuple__2613 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2613)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2613); + __Pyx_GIVEREF(__pyx_tuple__2613); + __pyx_codeobj__2614 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2613, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_info, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2614)) __PYX_ERR(1, 139, __pyx_L1_error) + + /* "talib/_abstract.pxi":146 + * + * @property + * def function_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns any function flags defined for this indicator function. + */ + __pyx_tuple__2615 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2615)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2615); + __Pyx_GIVEREF(__pyx_tuple__2615); + __pyx_codeobj__2616 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2615, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_function_flags, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2616)) __PYX_ERR(1, 146, __pyx_L1_error) + + /* "talib/_abstract.pxi":153 + * + * @property + * def output_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns the flags for each output for this indicator function. + */ + __pyx_tuple__2617 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2617)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2617); + __Pyx_GIVEREF(__pyx_tuple__2617); + __pyx_codeobj__2618 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2617, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_output_flags, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2618)) __PYX_ERR(1, 153, __pyx_L1_error) + + /* "talib/_abstract.pxi":159 + * return self.__info['output_flags'].copy() + * + * def get_input_names(self): # <<<<<<<<<<<<<< + * """ + * Returns the dict of input price series names that specifies which + */ + __pyx_tuple__2619 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_input_name); if (unlikely(!__pyx_tuple__2619)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2619); + __Pyx_GIVEREF(__pyx_tuple__2619); + __pyx_codeobj__2620 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2619, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_input_names, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2620)) __PYX_ERR(1, 159, __pyx_L1_error) + + /* "talib/_abstract.pxi":169 + * return ret + * + * def set_input_names(self, input_names): # <<<<<<<<<<<<<< + * """ + * Sets the input price series names to use. + */ + __pyx_tuple__2621 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input_names, __pyx_n_s_input_name, __pyx_n_s_price_series); if (unlikely(!__pyx_tuple__2621)) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2621); + __Pyx_GIVEREF(__pyx_tuple__2621); + __pyx_codeobj__2622 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2621, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_set_input_names, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2622)) __PYX_ERR(1, 169, __pyx_L1_error) + + /* "talib/_abstract.pxi":180 + * input_names = property(get_input_names, set_input_names) + * + * def get_input_arrays(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the dict of input arrays in use. + */ + __pyx_tuple__2623 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2623)) __PYX_ERR(1, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2623); + __Pyx_GIVEREF(__pyx_tuple__2623); + __pyx_codeobj__2624 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2623, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_input_arrays, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2624)) __PYX_ERR(1, 180, __pyx_L1_error) + + /* "talib/_abstract.pxi":186 + * return self.__input_arrays.copy() + * + * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< + * """ + * Sets the dict of input_arrays to use. Returns True/False for + */ + __pyx_tuple__2625 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input_arrays, __pyx_n_s_missing_keys, __pyx_n_s_key); if (unlikely(!__pyx_tuple__2625)) __PYX_ERR(1, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2625); + __Pyx_GIVEREF(__pyx_tuple__2625); + __pyx_codeobj__2626 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2625, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_set_input_arrays, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2626)) __PYX_ERR(1, 186, __pyx_L1_error) + + /* "talib/_abstract.pxi":229 + * input_arrays = property(get_input_arrays, set_input_arrays) + * + * def get_parameters(self): # <<<<<<<<<<<<<< + * """ + * Returns the function's optional parameters and their default values. + */ + __pyx_tuple__2627 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_opt_input); if (unlikely(!__pyx_tuple__2627)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2627); + __Pyx_GIVEREF(__pyx_tuple__2627); + __pyx_codeobj__2628 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2627, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_parameters, 229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2628)) __PYX_ERR(1, 229, __pyx_L1_error) + + /* "talib/_abstract.pxi":238 + * return ret + * + * def set_parameters(self, parameters): # <<<<<<<<<<<<<< + * """ + * Sets the function parameter values. + */ + __pyx_tuple__2629 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_parameters, __pyx_n_s_param, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2629)) __PYX_ERR(1, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2629); + __Pyx_GIVEREF(__pyx_tuple__2629); + __pyx_codeobj__2630 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2629, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_set_parameters, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2630)) __PYX_ERR(1, 238, __pyx_L1_error) + + /* "talib/_abstract.pxi":249 + * parameters = property(get_parameters, set_parameters) + * + * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] + */ + __pyx_tuple__2631 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_update_info, __pyx_n_s_key, __pyx_n_s_skip_first, __pyx_n_s_i, __pyx_n_s_param_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2631)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2631); + __Pyx_GIVEREF(__pyx_tuple__2631); + __pyx_codeobj__2632 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2631, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_set_function_args, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2632)) __PYX_ERR(1, 249, __pyx_L1_error) + + /* "talib/_abstract.pxi":281 + * + * @property + * def lookback(self): # <<<<<<<<<<<<<< + * """ + * Returns the lookback window size for the function with the parameter + */ + __pyx_tuple__2633 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_holder, __pyx_n_s_i, __pyx_n_s_opt_input, __pyx_n_s_value, __pyx_n_s_type, __pyx_n_s_lookback); if (unlikely(!__pyx_tuple__2633)) __PYX_ERR(1, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2633); + __Pyx_GIVEREF(__pyx_tuple__2633); + __pyx_codeobj__2634 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2633, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_lookback, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2634)) __PYX_ERR(1, 281, __pyx_L1_error) + + /* "talib/_abstract.pxi":301 + * + * @property + * def output_names(self): # <<<<<<<<<<<<<< + * """ + * Returns a list of the output names returned by this function. + */ + __pyx_tuple__2635 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__2635)) __PYX_ERR(1, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2635); + __Pyx_GIVEREF(__pyx_tuple__2635); + __pyx_codeobj__2636 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2635, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_output_names, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2636)) __PYX_ERR(1, 301, __pyx_L1_error) + + /* "talib/_abstract.pxi":311 + * + * @property + * def outputs(self): # <<<<<<<<<<<<<< + * """ + * Returns the TA function values for the currently set input_arrays and + */ + __pyx_tuple__2637 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_index); if (unlikely(!__pyx_tuple__2637)) __PYX_ERR(1, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2637); + __Pyx_GIVEREF(__pyx_tuple__2637); + __pyx_codeobj__2638 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2637, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_outputs, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2638)) __PYX_ERR(1, 311, __pyx_L1_error) + + /* "talib/_abstract.pxi":334 + * return ret[0] if len(ret) == 1 else ret + * + * def run(self, input_arrays=None): # <<<<<<<<<<<<<< + * """ + * run([input_arrays=None]) + */ + __pyx_tuple__2639 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_input_arrays); if (unlikely(!__pyx_tuple__2639)) __PYX_ERR(1, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2639); + __Pyx_GIVEREF(__pyx_tuple__2639); + __pyx_codeobj__2640 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2639, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_run, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2640)) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_tuple__2641 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__2641)) __PYX_ERR(1, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2641); + __Pyx_GIVEREF(__pyx_tuple__2641); + + /* "talib/_abstract.pxi":346 + * return self.outputs + * + * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) + */ + __pyx_tuple__2642 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__2642)) __PYX_ERR(1, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2642); + __Pyx_GIVEREF(__pyx_tuple__2642); + __pyx_codeobj__2643 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_call, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2643)) __PYX_ERR(1, 346, __pyx_L1_error) + + /* "talib/_abstract.pxi":358 + * + * # figure out which price series names we're using for inputs + * def __input_price_series_names(self): # <<<<<<<<<<<<<< + * input_price_series_names = [] + * for input_name in self.__input_names: + */ + __pyx_tuple__2644 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_input_price_series_names, __pyx_n_s_input_name, __pyx_n_s_price_series, __pyx_n_s_name); if (unlikely(!__pyx_tuple__2644)) __PYX_ERR(1, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2644); + __Pyx_GIVEREF(__pyx_tuple__2644); + __pyx_codeobj__2645 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_input_price_series_names_2, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2645)) __PYX_ERR(1, 358, __pyx_L1_error) + + /* "talib/_abstract.pxi":369 + * return input_price_series_names + * + * def __call_function(self): # <<<<<<<<<<<<<< + * input_price_series_names = self.__input_price_series_names() + * + */ + __pyx_tuple__2646 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_input_price_series_names, __pyx_n_s_args, __pyx_n_s_price_series, __pyx_n_s_series, __pyx_n_s_opt_input, __pyx_n_s_value, __pyx_n_s_results, __pyx_n_s_keys, __pyx_n_s_i, __pyx_n_s_output); if (unlikely(!__pyx_tuple__2646)) __PYX_ERR(1, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2646); + __Pyx_GIVEREF(__pyx_tuple__2646); + __pyx_codeobj__2647 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2646, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_call_function, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2647)) __PYX_ERR(1, 369, __pyx_L1_error) + + /* "talib/_abstract.pxi":396 + * self.__outputs_valid = True + * + * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< + * """ + * Returns the user-set value if there is one, otherwise the default. + */ + __pyx_tuple__2648 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_input_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2648)) __PYX_ERR(1, 396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2648); + __Pyx_GIVEREF(__pyx_tuple__2648); + __pyx_codeobj__2649 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2648, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_opt_input_value, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2649)) __PYX_ERR(1, 396, __pyx_L1_error) + + /* "talib/_abstract.pxi":405 + * return value + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '%s' % self.info + * + */ + __pyx_tuple__2650 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2650)) __PYX_ERR(1, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2650); + __Pyx_GIVEREF(__pyx_tuple__2650); + __pyx_codeobj__2651 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2650, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_repr, 405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2651)) __PYX_ERR(1, 405, __pyx_L1_error) + + /* "talib/_abstract.pxi":408 + * return '%s' % self.info + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * return unicode(self.__str__()) + * + */ + __pyx_tuple__2652 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2652)) __PYX_ERR(1, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2652); + __Pyx_GIVEREF(__pyx_tuple__2652); + __pyx_codeobj__2653 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2652, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_unicode, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2653)) __PYX_ERR(1, 408, __pyx_L1_error) + + /* "talib/_abstract.pxi":411 + * return unicode(self.__str__()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults + * + */ + __pyx_tuple__2654 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2654)) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2654); + __Pyx_GIVEREF(__pyx_tuple__2654); + __pyx_codeobj__2655 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2654, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_str, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2655)) __PYX_ERR(1, 411, __pyx_L1_error) + + /* "talib/_abstract.pxi":425 + * # therefore recommended over using these functions directly. + * + * def _ta_getGroupTable(): # <<<<<<<<<<<<<< + * """ + * Returns the list of available TALIB function group names. *slow* + */ + __pyx_tuple__2656 = PyTuple_Pack(3, __pyx_n_s_table, __pyx_n_s_groups, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2656)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2656); + __Pyx_GIVEREF(__pyx_tuple__2656); + __pyx_codeobj__2657 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2656, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getGroupTable, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2657)) __PYX_ERR(1, 425, __pyx_L1_error) + + /* "talib/_abstract.pxi":437 + * return groups + * + * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< + * """ + * Returns a list of the functions for the specified group name. *slow* + */ + __pyx_tuple__2658 = PyTuple_Pack(5, __pyx_n_s_group, __pyx_n_s_group, __pyx_n_s_table, __pyx_n_s_functions, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2658)) __PYX_ERR(1, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2658); + __Pyx_GIVEREF(__pyx_tuple__2658); + __pyx_codeobj__2659 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2658, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getFuncTable, 437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2659)) __PYX_ERR(1, 437, __pyx_L1_error) + + /* "talib/_abstract.pxi":449 + * return functions + * + * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< + * """ + * TA-LIB provides hints for multiple flags as a bitwise-ORed int. + */ + __pyx_tuple__2660 = PyTuple_Pack(7, __pyx_n_s_flag, __pyx_n_s_flags_lookup_dict, __pyx_n_s_value_range, __pyx_n_s_min_int, __pyx_n_s_max_int, __pyx_n_s_ret, __pyx_n_s_i); if (unlikely(!__pyx_tuple__2660)) __PYX_ERR(1, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2660); + __Pyx_GIVEREF(__pyx_tuple__2660); + __pyx_codeobj__2661 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2660, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_flags, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2661)) __PYX_ERR(1, 449, __pyx_L1_error) + + /* "talib/_abstract.pxi":508 + * } + * + * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns the info dict for the function. It has the following keys: name, + */ + __pyx_tuple__2662 = PyTuple_Pack(4, __pyx_n_s_function_name, __pyx_n_s_function_name, __pyx_n_s_info, __pyx_n_s_retCode); if (unlikely(!__pyx_tuple__2662)) __PYX_ERR(1, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2662); + __Pyx_GIVEREF(__pyx_tuple__2662); + __pyx_codeobj__2663 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2662, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getFuncInfo, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2663)) __PYX_ERR(1, 508, __pyx_L1_error) + + /* "talib/_abstract.pxi":527 + * } + * + * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's input info dict for the given index. It has two + */ + __pyx_tuple__2664 = PyTuple_Pack(5, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name); if (unlikely(!__pyx_tuple__2664)) __PYX_ERR(1, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2664); + __Pyx_GIVEREF(__pyx_tuple__2664); + __pyx_codeobj__2665 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2664, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getInputParameterInfo, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2665)) __PYX_ERR(1, 527, __pyx_L1_error) + + /* "talib/_abstract.pxi":548 + * } + * + * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's opt_input info dict for the given index. It has the + */ + __pyx_tuple__2666 = PyTuple_Pack(6, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name, __pyx_n_s_default_value); if (unlikely(!__pyx_tuple__2666)) __PYX_ERR(1, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2666); + __Pyx_GIVEREF(__pyx_tuple__2666); + __pyx_codeobj__2667 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2666, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getOptInputParameterInfo, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2667)) __PYX_ERR(1, 548, __pyx_L1_error) + + /* "talib/_abstract.pxi":572 + * } + * + * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's output info dict for the given index. It has two + */ + __pyx_tuple__2668 = PyTuple_Pack(5, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name); if (unlikely(!__pyx_tuple__2668)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2668); + __Pyx_GIVEREF(__pyx_tuple__2668); + __pyx_codeobj__2669 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2668, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_ta_getOutputParameterInfo, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2669)) __PYX_ERR(1, 572, __pyx_L1_error) + + /* "talib/_abstract.pxi":592 + * } + * + * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< + * """ + * Returns a tuple with two outputs: defaults, a dict of parameter defaults, + */ + __pyx_tuple__2670 = PyTuple_Pack(13, __pyx_n_s_func_info, __pyx_n_s_defaults, __pyx_n_s_func_line, __pyx_n_s_func_args, __pyx_n_s_docs, __pyx_n_s_input_names, __pyx_n_s_input_name, __pyx_n_s_value, __pyx_n_s_params, __pyx_n_s_param, __pyx_n_s_outputs, __pyx_n_s_output, __pyx_n_s_documentation); if (unlikely(!__pyx_tuple__2670)) __PYX_ERR(1, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2670); + __Pyx_GIVEREF(__pyx_tuple__2670); + __pyx_codeobj__2671 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2670, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_3, __pyx_n_s_get_defaults_and_docs, 592, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2671)) __PYX_ERR(1, 592, __pyx_L1_error) + + /* "talib/_stream.pxi":10 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + __pyx_tuple__2672 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2672)) __PYX_ERR(3, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2672); + __Pyx_GIVEREF(__pyx_tuple__2672); + __pyx_codeobj__2673 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2672, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ACOS, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2673)) __PYX_ERR(3, 10, __pyx_L1_error) + + /* "talib/_stream.pxi":44 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + __pyx_tuple__2674 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2674)) __PYX_ERR(3, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2674); + __Pyx_GIVEREF(__pyx_tuple__2674); + __pyx_codeobj__2675 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2674, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_AD, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2675)) __PYX_ERR(3, 44, __pyx_L1_error) + + /* "talib/_stream.pxi":108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + __pyx_tuple__2676 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2676)) __PYX_ERR(3, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2676); + __Pyx_GIVEREF(__pyx_tuple__2676); + __pyx_codeobj__2677 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2676, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ADD, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2677)) __PYX_ERR(3, 108, __pyx_L1_error) + + /* "talib/_stream.pxi":153 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + __pyx_tuple__2678 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2678)) __PYX_ERR(3, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2678); + __Pyx_GIVEREF(__pyx_tuple__2678); + __pyx_codeobj__2679 = (PyObject*)__Pyx_PyCode_New(6, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2678, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ADOSC, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2679)) __PYX_ERR(3, 153, __pyx_L1_error) + + /* "talib/_stream.pxi":220 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2680 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2680)) __PYX_ERR(3, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2680); + __Pyx_GIVEREF(__pyx_tuple__2680); + __pyx_codeobj__2681 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2680, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ADX, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2681)) __PYX_ERR(3, 220, __pyx_L1_error) + + /* "talib/_stream.pxi":276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2682 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2682)) __PYX_ERR(3, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2682); + __Pyx_GIVEREF(__pyx_tuple__2682); + __pyx_codeobj__2683 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2682, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ADXR, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2683)) __PYX_ERR(3, 276, __pyx_L1_error) + + /* "talib/_stream.pxi":332 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_tuple__2684 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2684)) __PYX_ERR(3, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2684); + __Pyx_GIVEREF(__pyx_tuple__2684); + __pyx_codeobj__2685 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2684, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_APO, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2685)) __PYX_ERR(3, 332, __pyx_L1_error) + + /* "talib/_stream.pxi":370 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2686 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outaroondown, __pyx_n_s_outaroonup); if (unlikely(!__pyx_tuple__2686)) __PYX_ERR(3, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2686); + __Pyx_GIVEREF(__pyx_tuple__2686); + __pyx_codeobj__2687 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_AROON, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2687)) __PYX_ERR(3, 370, __pyx_L1_error) + + /* "talib/_stream.pxi":419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2688 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2688)) __PYX_ERR(3, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2688); + __Pyx_GIVEREF(__pyx_tuple__2688); + __pyx_codeobj__2689 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2688, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_AROONOSC, 419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2689)) __PYX_ERR(3, 419, __pyx_L1_error) + + /* "talib/_stream.pxi":465 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + __pyx_tuple__2690 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2690)) __PYX_ERR(3, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2690); + __Pyx_GIVEREF(__pyx_tuple__2690); + __pyx_codeobj__2691 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2690, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ASIN, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2691)) __PYX_ERR(3, 465, __pyx_L1_error) + + /* "talib/_stream.pxi":499 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + __pyx_tuple__2692 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2692)) __PYX_ERR(3, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2692); + __Pyx_GIVEREF(__pyx_tuple__2692); + __pyx_codeobj__2693 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2692, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ATAN, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2693)) __PYX_ERR(3, 499, __pyx_L1_error) + + /* "talib/_stream.pxi":533 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2694 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2694)) __PYX_ERR(3, 533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2694); + __Pyx_GIVEREF(__pyx_tuple__2694); + __pyx_codeobj__2695 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2694, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ATR, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2695)) __PYX_ERR(3, 533, __pyx_L1_error) + + /* "talib/_stream.pxi":589 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + __pyx_tuple__2696 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2696)) __PYX_ERR(3, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2696); + __Pyx_GIVEREF(__pyx_tuple__2696); + __pyx_codeobj__2697 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2696, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_AVGPRICE, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2697)) __PYX_ERR(3, 589, __pyx_L1_error) + + /* "talib/_stream.pxi":653 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + __pyx_tuple__2698 = PyTuple_Pack(17, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdevup, __pyx_n_s_nbdevdn, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outrealupperband, __pyx_n_s_outrealmiddleband, __pyx_n_s_outreallowerband); if (unlikely(!__pyx_tuple__2698)) __PYX_ERR(3, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2698); + __Pyx_GIVEREF(__pyx_tuple__2698); + __pyx_codeobj__2699 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2698, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_BBANDS, 653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2699)) __PYX_ERR(3, 653, __pyx_L1_error) + + /* "talib/_stream.pxi":698 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + __pyx_tuple__2700 = PyTuple_Pack(14, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2700)) __PYX_ERR(3, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2700); + __Pyx_GIVEREF(__pyx_tuple__2700); + __pyx_codeobj__2701 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2700, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_BETA, 698, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2701)) __PYX_ERR(3, 698, __pyx_L1_error) + + /* "talib/_stream.pxi":745 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + __pyx_tuple__2702 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2702)) __PYX_ERR(3, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2702); + __Pyx_GIVEREF(__pyx_tuple__2702); + __pyx_codeobj__2703 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2702, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_BOP, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2703)) __PYX_ERR(3, 745, __pyx_L1_error) + + /* "talib/_stream.pxi":809 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2704 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2704)) __PYX_ERR(3, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2704); + __Pyx_GIVEREF(__pyx_tuple__2704); + __pyx_codeobj__2705 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2704, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CCI, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2705)) __PYX_ERR(3, 809, __pyx_L1_error) + + /* "talib/_stream.pxi":865 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + __pyx_tuple__2706 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2706)) __PYX_ERR(3, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2706); + __Pyx_GIVEREF(__pyx_tuple__2706); + __pyx_codeobj__2707 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2706, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL2CROWS, 865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2707)) __PYX_ERR(3, 865, __pyx_L1_error) + + /* "talib/_stream.pxi":929 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + __pyx_tuple__2708 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2708)) __PYX_ERR(3, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2708); + __Pyx_GIVEREF(__pyx_tuple__2708); + __pyx_codeobj__2709 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2708, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3BLACKCROWS, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2709)) __PYX_ERR(3, 929, __pyx_L1_error) + + /* "talib/_stream.pxi":993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + __pyx_tuple__2710 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2710)) __PYX_ERR(3, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2710); + __Pyx_GIVEREF(__pyx_tuple__2710); + __pyx_codeobj__2711 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2710, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3INSIDE, 993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2711)) __PYX_ERR(3, 993, __pyx_L1_error) + + /* "talib/_stream.pxi":1057 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + __pyx_tuple__2712 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2712)) __PYX_ERR(3, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2712); + __Pyx_GIVEREF(__pyx_tuple__2712); + __pyx_codeobj__2713 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2712, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3LINESTRIKE, 1057, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2713)) __PYX_ERR(3, 1057, __pyx_L1_error) + + /* "talib/_stream.pxi":1121 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + __pyx_tuple__2714 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2714)) __PYX_ERR(3, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2714); + __Pyx_GIVEREF(__pyx_tuple__2714); + __pyx_codeobj__2715 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2714, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3OUTSIDE, 1121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2715)) __PYX_ERR(3, 1121, __pyx_L1_error) + + /* "talib/_stream.pxi":1185 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + __pyx_tuple__2716 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2716)) __PYX_ERR(3, 1185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2716); + __Pyx_GIVEREF(__pyx_tuple__2716); + __pyx_codeobj__2717 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2716, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3STARSINSOUTH, 1185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2717)) __PYX_ERR(3, 1185, __pyx_L1_error) + + /* "talib/_stream.pxi":1249 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + __pyx_tuple__2718 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2718)) __PYX_ERR(3, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2718); + __Pyx_GIVEREF(__pyx_tuple__2718); + __pyx_codeobj__2719 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2718, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDL3WHITESOLDIERS, 1249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2719)) __PYX_ERR(3, 1249, __pyx_L1_error) + + /* "talib/_stream.pxi":1313 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2720 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2720)) __PYX_ERR(3, 1313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2720); + __Pyx_GIVEREF(__pyx_tuple__2720); + __pyx_codeobj__2721 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2720, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLABANDONEDBABY, 1313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2721)) __PYX_ERR(3, 1313, __pyx_L1_error) + + /* "talib/_stream.pxi":1379 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + __pyx_tuple__2722 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2722)) __PYX_ERR(3, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2722); + __Pyx_GIVEREF(__pyx_tuple__2722); + __pyx_codeobj__2723 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2722, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLADVANCEBLOCK, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2723)) __PYX_ERR(3, 1379, __pyx_L1_error) + + /* "talib/_stream.pxi":1443 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + __pyx_tuple__2724 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2724)) __PYX_ERR(3, 1443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2724); + __Pyx_GIVEREF(__pyx_tuple__2724); + __pyx_codeobj__2725 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2724, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLBELTHOLD, 1443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2725)) __PYX_ERR(3, 1443, __pyx_L1_error) + + /* "talib/_stream.pxi":1507 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + __pyx_tuple__2726 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2726)) __PYX_ERR(3, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2726); + __Pyx_GIVEREF(__pyx_tuple__2726); + __pyx_codeobj__2727 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2726, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLBREAKAWAY, 1507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2727)) __PYX_ERR(3, 1507, __pyx_L1_error) + + /* "talib/_stream.pxi":1571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + __pyx_tuple__2728 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2728)) __PYX_ERR(3, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2728); + __Pyx_GIVEREF(__pyx_tuple__2728); + __pyx_codeobj__2729 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2728, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLCLOSINGMARUBOZU, 1571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2729)) __PYX_ERR(3, 1571, __pyx_L1_error) + + /* "talib/_stream.pxi":1635 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + __pyx_tuple__2730 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2730)) __PYX_ERR(3, 1635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2730); + __Pyx_GIVEREF(__pyx_tuple__2730); + __pyx_codeobj__2731 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2730, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLCONCEALBABYSWALL, 1635, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2731)) __PYX_ERR(3, 1635, __pyx_L1_error) + + /* "talib/_stream.pxi":1699 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + __pyx_tuple__2732 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2732)) __PYX_ERR(3, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2732); + __Pyx_GIVEREF(__pyx_tuple__2732); + __pyx_codeobj__2733 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2732, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLCOUNTERATTACK, 1699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2733)) __PYX_ERR(3, 1699, __pyx_L1_error) + + /* "talib/_stream.pxi":1763 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2734 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2734)) __PYX_ERR(3, 1763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2734); + __Pyx_GIVEREF(__pyx_tuple__2734); + __pyx_codeobj__2735 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2734, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLDARKCLOUDCOVER, 1763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2735)) __PYX_ERR(3, 1763, __pyx_L1_error) + + /* "talib/_stream.pxi":1829 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + __pyx_tuple__2736 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2736)) __PYX_ERR(3, 1829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2736); + __Pyx_GIVEREF(__pyx_tuple__2736); + __pyx_codeobj__2737 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2736, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLDOJI, 1829, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2737)) __PYX_ERR(3, 1829, __pyx_L1_error) + + /* "talib/_stream.pxi":1893 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + __pyx_tuple__2738 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2738)) __PYX_ERR(3, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2738); + __Pyx_GIVEREF(__pyx_tuple__2738); + __pyx_codeobj__2739 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2738, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLDOJISTAR, 1893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2739)) __PYX_ERR(3, 1893, __pyx_L1_error) + + /* "talib/_stream.pxi":1957 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + __pyx_tuple__2740 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2740)) __PYX_ERR(3, 1957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2740); + __Pyx_GIVEREF(__pyx_tuple__2740); + __pyx_codeobj__2741 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2740, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLDRAGONFLYDOJI, 1957, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2741)) __PYX_ERR(3, 1957, __pyx_L1_error) + + /* "talib/_stream.pxi":2021 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + __pyx_tuple__2742 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2742)) __PYX_ERR(3, 2021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2742); + __Pyx_GIVEREF(__pyx_tuple__2742); + __pyx_codeobj__2743 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2742, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLENGULFING, 2021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2743)) __PYX_ERR(3, 2021, __pyx_L1_error) + + /* "talib/_stream.pxi":2085 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2744 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2744)) __PYX_ERR(3, 2085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2744); + __Pyx_GIVEREF(__pyx_tuple__2744); + __pyx_codeobj__2745 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2744, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLEVENINGDOJISTAR, 2085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2745)) __PYX_ERR(3, 2085, __pyx_L1_error) + + /* "talib/_stream.pxi":2151 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2746 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2746)) __PYX_ERR(3, 2151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2746); + __Pyx_GIVEREF(__pyx_tuple__2746); + __pyx_codeobj__2747 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2746, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLEVENINGSTAR, 2151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2747)) __PYX_ERR(3, 2151, __pyx_L1_error) + + /* "talib/_stream.pxi":2217 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + __pyx_tuple__2748 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2748)) __PYX_ERR(3, 2217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2748); + __Pyx_GIVEREF(__pyx_tuple__2748); + __pyx_codeobj__2749 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2748, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLGAPSIDESIDEWHITE, 2217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2749)) __PYX_ERR(3, 2217, __pyx_L1_error) + + /* "talib/_stream.pxi":2281 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + __pyx_tuple__2750 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2750)) __PYX_ERR(3, 2281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2750); + __Pyx_GIVEREF(__pyx_tuple__2750); + __pyx_codeobj__2751 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2750, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLGRAVESTONEDOJI, 2281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2751)) __PYX_ERR(3, 2281, __pyx_L1_error) + + /* "talib/_stream.pxi":2345 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + __pyx_tuple__2752 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2752)) __PYX_ERR(3, 2345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2752); + __Pyx_GIVEREF(__pyx_tuple__2752); + __pyx_codeobj__2753 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2752, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHAMMER, 2345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2753)) __PYX_ERR(3, 2345, __pyx_L1_error) + + /* "talib/_stream.pxi":2409 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + __pyx_tuple__2754 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2754)) __PYX_ERR(3, 2409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2754); + __Pyx_GIVEREF(__pyx_tuple__2754); + __pyx_codeobj__2755 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2754, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHANGINGMAN, 2409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2755)) __PYX_ERR(3, 2409, __pyx_L1_error) + + /* "talib/_stream.pxi":2473 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + __pyx_tuple__2756 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2756)) __PYX_ERR(3, 2473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2756); + __Pyx_GIVEREF(__pyx_tuple__2756); + __pyx_codeobj__2757 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2756, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHARAMI, 2473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2757)) __PYX_ERR(3, 2473, __pyx_L1_error) + + /* "talib/_stream.pxi":2537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + __pyx_tuple__2758 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2758)) __PYX_ERR(3, 2537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2758); + __Pyx_GIVEREF(__pyx_tuple__2758); + __pyx_codeobj__2759 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2758, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHARAMICROSS, 2537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2759)) __PYX_ERR(3, 2537, __pyx_L1_error) + + /* "talib/_stream.pxi":2601 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + __pyx_tuple__2760 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2760)) __PYX_ERR(3, 2601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2760); + __Pyx_GIVEREF(__pyx_tuple__2760); + __pyx_codeobj__2761 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2760, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHIGHWAVE, 2601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2761)) __PYX_ERR(3, 2601, __pyx_L1_error) + + /* "talib/_stream.pxi":2665 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + __pyx_tuple__2762 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2762)) __PYX_ERR(3, 2665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2762); + __Pyx_GIVEREF(__pyx_tuple__2762); + __pyx_codeobj__2763 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2762, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHIKKAKE, 2665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2763)) __PYX_ERR(3, 2665, __pyx_L1_error) + + /* "talib/_stream.pxi":2729 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + __pyx_tuple__2764 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2764)) __PYX_ERR(3, 2729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2764); + __Pyx_GIVEREF(__pyx_tuple__2764); + __pyx_codeobj__2765 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2764, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHIKKAKEMOD, 2729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2765)) __PYX_ERR(3, 2729, __pyx_L1_error) + + /* "talib/_stream.pxi":2793 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + __pyx_tuple__2766 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2766)) __PYX_ERR(3, 2793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2766); + __Pyx_GIVEREF(__pyx_tuple__2766); + __pyx_codeobj__2767 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2766, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLHOMINGPIGEON, 2793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2767)) __PYX_ERR(3, 2793, __pyx_L1_error) + + /* "talib/_stream.pxi":2857 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + __pyx_tuple__2768 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2768)) __PYX_ERR(3, 2857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2768); + __Pyx_GIVEREF(__pyx_tuple__2768); + __pyx_codeobj__2769 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2768, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLIDENTICAL3CROWS, 2857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2769)) __PYX_ERR(3, 2857, __pyx_L1_error) + + /* "talib/_stream.pxi":2921 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + __pyx_tuple__2770 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2770)) __PYX_ERR(3, 2921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2770); + __Pyx_GIVEREF(__pyx_tuple__2770); + __pyx_codeobj__2771 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2770, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLINNECK, 2921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2771)) __PYX_ERR(3, 2921, __pyx_L1_error) + + /* "talib/_stream.pxi":2985 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + __pyx_tuple__2772 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2772)) __PYX_ERR(3, 2985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2772); + __Pyx_GIVEREF(__pyx_tuple__2772); + __pyx_codeobj__2773 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2772, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLINVERTEDHAMMER, 2985, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2773)) __PYX_ERR(3, 2985, __pyx_L1_error) + + /* "talib/_stream.pxi":3049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + __pyx_tuple__2774 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2774)) __PYX_ERR(3, 3049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2774); + __Pyx_GIVEREF(__pyx_tuple__2774); + __pyx_codeobj__2775 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2774, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLKICKING, 3049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2775)) __PYX_ERR(3, 3049, __pyx_L1_error) + + /* "talib/_stream.pxi":3113 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + __pyx_tuple__2776 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2776)) __PYX_ERR(3, 3113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2776); + __Pyx_GIVEREF(__pyx_tuple__2776); + __pyx_codeobj__2777 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2776, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLKICKINGBYLENGTH, 3113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2777)) __PYX_ERR(3, 3113, __pyx_L1_error) + + /* "talib/_stream.pxi":3177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + __pyx_tuple__2778 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2778)) __PYX_ERR(3, 3177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2778); + __Pyx_GIVEREF(__pyx_tuple__2778); + __pyx_codeobj__2779 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2778, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLLADDERBOTTOM, 3177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2779)) __PYX_ERR(3, 3177, __pyx_L1_error) + + /* "talib/_stream.pxi":3241 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + __pyx_tuple__2780 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2780)) __PYX_ERR(3, 3241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2780); + __Pyx_GIVEREF(__pyx_tuple__2780); + __pyx_codeobj__2781 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2780, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLLONGLEGGEDDOJI, 3241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2781)) __PYX_ERR(3, 3241, __pyx_L1_error) + + /* "talib/_stream.pxi":3305 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + __pyx_tuple__2782 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2782)) __PYX_ERR(3, 3305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2782); + __Pyx_GIVEREF(__pyx_tuple__2782); + __pyx_codeobj__2783 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2782, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLLONGLINE, 3305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2783)) __PYX_ERR(3, 3305, __pyx_L1_error) + + /* "talib/_stream.pxi":3369 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + __pyx_tuple__2784 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2784)) __PYX_ERR(3, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2784); + __Pyx_GIVEREF(__pyx_tuple__2784); + __pyx_codeobj__2785 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2784, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLMARUBOZU, 3369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2785)) __PYX_ERR(3, 3369, __pyx_L1_error) + + /* "talib/_stream.pxi":3433 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + __pyx_tuple__2786 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2786)) __PYX_ERR(3, 3433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2786); + __Pyx_GIVEREF(__pyx_tuple__2786); + __pyx_codeobj__2787 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2786, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLMATCHINGLOW, 3433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2787)) __PYX_ERR(3, 3433, __pyx_L1_error) + + /* "talib/_stream.pxi":3497 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2788 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2788)) __PYX_ERR(3, 3497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2788); + __Pyx_GIVEREF(__pyx_tuple__2788); + __pyx_codeobj__2789 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2788, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLMATHOLD, 3497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2789)) __PYX_ERR(3, 3497, __pyx_L1_error) + + /* "talib/_stream.pxi":3563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2790 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2790)) __PYX_ERR(3, 3563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2790); + __Pyx_GIVEREF(__pyx_tuple__2790); + __pyx_codeobj__2791 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2790, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLMORNINGDOJISTAR, 3563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2791)) __PYX_ERR(3, 3563, __pyx_L1_error) + + /* "talib/_stream.pxi":3629 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_tuple__2792 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2792)) __PYX_ERR(3, 3629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2792); + __Pyx_GIVEREF(__pyx_tuple__2792); + __pyx_codeobj__2793 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2792, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLMORNINGSTAR, 3629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2793)) __PYX_ERR(3, 3629, __pyx_L1_error) + + /* "talib/_stream.pxi":3695 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + __pyx_tuple__2794 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2794)) __PYX_ERR(3, 3695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2794); + __Pyx_GIVEREF(__pyx_tuple__2794); + __pyx_codeobj__2795 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2794, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLONNECK, 3695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2795)) __PYX_ERR(3, 3695, __pyx_L1_error) + + /* "talib/_stream.pxi":3759 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + __pyx_tuple__2796 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2796)) __PYX_ERR(3, 3759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2796); + __Pyx_GIVEREF(__pyx_tuple__2796); + __pyx_codeobj__2797 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2796, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLPIERCING, 3759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2797)) __PYX_ERR(3, 3759, __pyx_L1_error) + + /* "talib/_stream.pxi":3823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + __pyx_tuple__2798 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2798)) __PYX_ERR(3, 3823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2798); + __Pyx_GIVEREF(__pyx_tuple__2798); + __pyx_codeobj__2799 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2798, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLRICKSHAWMAN, 3823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2799)) __PYX_ERR(3, 3823, __pyx_L1_error) + + /* "talib/_stream.pxi":3887 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + __pyx_tuple__2800 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2800)) __PYX_ERR(3, 3887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2800); + __Pyx_GIVEREF(__pyx_tuple__2800); + __pyx_codeobj__2801 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2800, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLRISEFALL3METHODS, 3887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2801)) __PYX_ERR(3, 3887, __pyx_L1_error) + + /* "talib/_stream.pxi":3951 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + __pyx_tuple__2802 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2802)) __PYX_ERR(3, 3951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2802); + __Pyx_GIVEREF(__pyx_tuple__2802); + __pyx_codeobj__2803 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2802, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSEPARATINGLINES, 3951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2803)) __PYX_ERR(3, 3951, __pyx_L1_error) + + /* "talib/_stream.pxi":4015 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + __pyx_tuple__2804 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2804)) __PYX_ERR(3, 4015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2804); + __Pyx_GIVEREF(__pyx_tuple__2804); + __pyx_codeobj__2805 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2804, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSHOOTINGSTAR, 4015, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2805)) __PYX_ERR(3, 4015, __pyx_L1_error) + + /* "talib/_stream.pxi":4079 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + __pyx_tuple__2806 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2806)) __PYX_ERR(3, 4079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2806); + __Pyx_GIVEREF(__pyx_tuple__2806); + __pyx_codeobj__2807 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2806, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSHORTLINE, 4079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2807)) __PYX_ERR(3, 4079, __pyx_L1_error) + + /* "talib/_stream.pxi":4143 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + __pyx_tuple__2808 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2808)) __PYX_ERR(3, 4143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2808); + __Pyx_GIVEREF(__pyx_tuple__2808); + __pyx_codeobj__2809 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2808, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSPINNINGTOP, 4143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2809)) __PYX_ERR(3, 4143, __pyx_L1_error) + + /* "talib/_stream.pxi":4207 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + __pyx_tuple__2810 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2810)) __PYX_ERR(3, 4207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2810); + __Pyx_GIVEREF(__pyx_tuple__2810); + __pyx_codeobj__2811 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2810, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSTALLEDPATTERN, 4207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2811)) __PYX_ERR(3, 4207, __pyx_L1_error) + + /* "talib/_stream.pxi":4271 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + __pyx_tuple__2812 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2812)) __PYX_ERR(3, 4271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2812); + __Pyx_GIVEREF(__pyx_tuple__2812); + __pyx_codeobj__2813 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2812, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLSTICKSANDWICH, 4271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2813)) __PYX_ERR(3, 4271, __pyx_L1_error) + + /* "talib/_stream.pxi":4335 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + __pyx_tuple__2814 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2814)) __PYX_ERR(3, 4335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2814); + __Pyx_GIVEREF(__pyx_tuple__2814); + __pyx_codeobj__2815 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2814, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLTAKURI, 4335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2815)) __PYX_ERR(3, 4335, __pyx_L1_error) + + /* "talib/_stream.pxi":4399 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + __pyx_tuple__2816 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2816)) __PYX_ERR(3, 4399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2816); + __Pyx_GIVEREF(__pyx_tuple__2816); + __pyx_codeobj__2817 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2816, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLTASUKIGAP, 4399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2817)) __PYX_ERR(3, 4399, __pyx_L1_error) + + /* "talib/_stream.pxi":4463 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + __pyx_tuple__2818 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2818)) __PYX_ERR(3, 4463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2818); + __Pyx_GIVEREF(__pyx_tuple__2818); + __pyx_codeobj__2819 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2818, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLTHRUSTING, 4463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2819)) __PYX_ERR(3, 4463, __pyx_L1_error) + + /* "talib/_stream.pxi":4527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + __pyx_tuple__2820 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2820)) __PYX_ERR(3, 4527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2820); + __Pyx_GIVEREF(__pyx_tuple__2820); + __pyx_codeobj__2821 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2820, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLTRISTAR, 4527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2821)) __PYX_ERR(3, 4527, __pyx_L1_error) + + /* "talib/_stream.pxi":4591 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + __pyx_tuple__2822 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2822)) __PYX_ERR(3, 4591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2822); + __Pyx_GIVEREF(__pyx_tuple__2822); + __pyx_codeobj__2823 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2822, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLUNIQUE3RIVER, 4591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2823)) __PYX_ERR(3, 4591, __pyx_L1_error) + + /* "talib/_stream.pxi":4655 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + __pyx_tuple__2824 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2824)) __PYX_ERR(3, 4655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2824); + __Pyx_GIVEREF(__pyx_tuple__2824); + __pyx_codeobj__2825 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2824, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLUPSIDEGAP2CROWS, 4655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2825)) __PYX_ERR(3, 4655, __pyx_L1_error) + + /* "talib/_stream.pxi":4719 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + __pyx_tuple__2826 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2826)) __PYX_ERR(3, 4719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2826); + __Pyx_GIVEREF(__pyx_tuple__2826); + __pyx_codeobj__2827 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2826, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CDLXSIDEGAP3METHODS, 4719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2827)) __PYX_ERR(3, 4719, __pyx_L1_error) + + /* "talib/_stream.pxi":4783 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + __pyx_tuple__2828 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2828)) __PYX_ERR(3, 4783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2828); + __Pyx_GIVEREF(__pyx_tuple__2828); + __pyx_codeobj__2829 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2828, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CEIL, 4783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2829)) __PYX_ERR(3, 4783, __pyx_L1_error) + + /* "talib/_stream.pxi":4817 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + __pyx_tuple__2830 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2830)) __PYX_ERR(3, 4817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2830); + __Pyx_GIVEREF(__pyx_tuple__2830); + __pyx_codeobj__2831 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2830, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CMO, 4817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2831)) __PYX_ERR(3, 4817, __pyx_L1_error) + + /* "talib/_stream.pxi":4853 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + __pyx_tuple__2832 = PyTuple_Pack(14, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2832)) __PYX_ERR(3, 4853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2832); + __Pyx_GIVEREF(__pyx_tuple__2832); + __pyx_codeobj__2833 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2832, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_CORREL, 4853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2833)) __PYX_ERR(3, 4853, __pyx_L1_error) + + /* "talib/_stream.pxi":4900 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + __pyx_tuple__2834 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2834)) __PYX_ERR(3, 4900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2834); + __Pyx_GIVEREF(__pyx_tuple__2834); + __pyx_codeobj__2835 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2834, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_COS, 4900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2835)) __PYX_ERR(3, 4900, __pyx_L1_error) + + /* "talib/_stream.pxi":4934 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + __pyx_tuple__2836 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2836)) __PYX_ERR(3, 4934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2836); + __Pyx_GIVEREF(__pyx_tuple__2836); + __pyx_codeobj__2837 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2836, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_COSH, 4934, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2837)) __PYX_ERR(3, 4934, __pyx_L1_error) + + /* "talib/_stream.pxi":4968 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2838 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2838)) __PYX_ERR(3, 4968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2838); + __Pyx_GIVEREF(__pyx_tuple__2838); + __pyx_codeobj__2839 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2838, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_DEMA, 4968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2839)) __PYX_ERR(3, 4968, __pyx_L1_error) + + /* "talib/_stream.pxi":5004 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + __pyx_tuple__2840 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2840)) __PYX_ERR(3, 5004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2840); + __Pyx_GIVEREF(__pyx_tuple__2840); + __pyx_codeobj__2841 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2840, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_DIV, 5004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2841)) __PYX_ERR(3, 5004, __pyx_L1_error) + + /* "talib/_stream.pxi":5049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2842 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2842)) __PYX_ERR(3, 5049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2842); + __Pyx_GIVEREF(__pyx_tuple__2842); + __pyx_codeobj__2843 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2842, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_DX, 5049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2843)) __PYX_ERR(3, 5049, __pyx_L1_error) + + /* "talib/_stream.pxi":5105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2844 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2844)) __PYX_ERR(3, 5105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2844); + __Pyx_GIVEREF(__pyx_tuple__2844); + __pyx_codeobj__2845 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2844, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_EMA, 5105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2845)) __PYX_ERR(3, 5105, __pyx_L1_error) + + /* "talib/_stream.pxi":5141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + __pyx_tuple__2846 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2846)) __PYX_ERR(3, 5141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2846); + __Pyx_GIVEREF(__pyx_tuple__2846); + __pyx_codeobj__2847 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2846, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_EXP, 5141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2847)) __PYX_ERR(3, 5141, __pyx_L1_error) + + /* "talib/_stream.pxi":5175 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + __pyx_tuple__2848 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2848)) __PYX_ERR(3, 5175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2848); + __Pyx_GIVEREF(__pyx_tuple__2848); + __pyx_codeobj__2849 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2848, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_FLOOR, 5175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2849)) __PYX_ERR(3, 5175, __pyx_L1_error) + + /* "talib/_stream.pxi":5209 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + __pyx_tuple__2850 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2850)) __PYX_ERR(3, 5209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2850); + __Pyx_GIVEREF(__pyx_tuple__2850); + __pyx_codeobj__2851 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2850, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_DCPERIOD, 5209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2851)) __PYX_ERR(3, 5209, __pyx_L1_error) + + /* "talib/_stream.pxi":5243 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + __pyx_tuple__2852 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2852)) __PYX_ERR(3, 5243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2852); + __Pyx_GIVEREF(__pyx_tuple__2852); + __pyx_codeobj__2853 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2852, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_DCPHASE, 5243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2853)) __PYX_ERR(3, 5243, __pyx_L1_error) + + /* "talib/_stream.pxi":5277 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + __pyx_tuple__2854 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinphase, __pyx_n_s_outquadrature); if (unlikely(!__pyx_tuple__2854)) __PYX_ERR(3, 5277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2854); + __Pyx_GIVEREF(__pyx_tuple__2854); + __pyx_codeobj__2855 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2854, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_PHASOR, 5277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2855)) __PYX_ERR(3, 5277, __pyx_L1_error) + + /* "talib/_stream.pxi":5314 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + __pyx_tuple__2856 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outsine, __pyx_n_s_outleadsine); if (unlikely(!__pyx_tuple__2856)) __PYX_ERR(3, 5314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2856); + __Pyx_GIVEREF(__pyx_tuple__2856); + __pyx_codeobj__2857 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2856, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_SINE, 5314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2857)) __PYX_ERR(3, 5314, __pyx_L1_error) + + /* "talib/_stream.pxi":5351 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + __pyx_tuple__2858 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2858)) __PYX_ERR(3, 5351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2858); + __Pyx_GIVEREF(__pyx_tuple__2858); + __pyx_codeobj__2859 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2858, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_TRENDLINE, 5351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2859)) __PYX_ERR(3, 5351, __pyx_L1_error) + + /* "talib/_stream.pxi":5385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + __pyx_tuple__2860 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2860)) __PYX_ERR(3, 5385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2860); + __Pyx_GIVEREF(__pyx_tuple__2860); + __pyx_codeobj__2861 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2860, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_HT_TRENDMODE, 5385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2861)) __PYX_ERR(3, 5385, __pyx_L1_error) + + /* "talib/_stream.pxi":5419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2862 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2862)) __PYX_ERR(3, 5419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2862); + __Pyx_GIVEREF(__pyx_tuple__2862); + __pyx_codeobj__2863 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2862, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_KAMA, 5419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2863)) __PYX_ERR(3, 5419, __pyx_L1_error) + + /* "talib/_stream.pxi":5455 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + __pyx_tuple__2864 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2864)) __PYX_ERR(3, 5455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2864); + __Pyx_GIVEREF(__pyx_tuple__2864); + __pyx_codeobj__2865 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2864, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LINEARREG, 5455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2865)) __PYX_ERR(3, 5455, __pyx_L1_error) + + /* "talib/_stream.pxi":5491 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + __pyx_tuple__2866 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2866)) __PYX_ERR(3, 5491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2866); + __Pyx_GIVEREF(__pyx_tuple__2866); + __pyx_codeobj__2867 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2866, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LINEARREG_ANGLE, 5491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2867)) __PYX_ERR(3, 5491, __pyx_L1_error) + + /* "talib/_stream.pxi":5527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + __pyx_tuple__2868 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2868)) __PYX_ERR(3, 5527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2868); + __Pyx_GIVEREF(__pyx_tuple__2868); + __pyx_codeobj__2869 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2868, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LINEARREG_INTERCEPT, 5527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2869)) __PYX_ERR(3, 5527, __pyx_L1_error) + + /* "talib/_stream.pxi":5563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + __pyx_tuple__2870 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2870)) __PYX_ERR(3, 5563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2870); + __Pyx_GIVEREF(__pyx_tuple__2870); + __pyx_codeobj__2871 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2870, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LINEARREG_SLOPE, 5563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2871)) __PYX_ERR(3, 5563, __pyx_L1_error) + + /* "talib/_stream.pxi":5599 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + __pyx_tuple__2872 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2872)) __PYX_ERR(3, 5599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2872); + __Pyx_GIVEREF(__pyx_tuple__2872); + __pyx_codeobj__2873 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2872, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LN, 5599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2873)) __PYX_ERR(3, 5599, __pyx_L1_error) + + /* "talib/_stream.pxi":5633 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + __pyx_tuple__2874 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2874)) __PYX_ERR(3, 5633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2874); + __Pyx_GIVEREF(__pyx_tuple__2874); + __pyx_codeobj__2875 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2874, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_LOG10, 5633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2875)) __PYX_ERR(3, 5633, __pyx_L1_error) + + /* "talib/_stream.pxi":5667 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + __pyx_tuple__2876 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2876)) __PYX_ERR(3, 5667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2876); + __Pyx_GIVEREF(__pyx_tuple__2876); + __pyx_codeobj__2877 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2876, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MA, 5667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2877)) __PYX_ERR(3, 5667, __pyx_L1_error) + + /* "talib/_stream.pxi":5704 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + __pyx_tuple__2878 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__2878)) __PYX_ERR(3, 5704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2878); + __Pyx_GIVEREF(__pyx_tuple__2878); + __pyx_codeobj__2879 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2878, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MACD, 5704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2879)) __PYX_ERR(3, 5704, __pyx_L1_error) + + /* "talib/_stream.pxi":5748 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + __pyx_tuple__2880 = PyTuple_Pack(19, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_fastmatype, __pyx_n_s_slowperiod, __pyx_n_s_slowmatype, __pyx_n_s_signalperiod, __pyx_n_s_signalmatype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__2880)) __PYX_ERR(3, 5748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2880); + __Pyx_GIVEREF(__pyx_tuple__2880); + __pyx_codeobj__2881 = (PyObject*)__Pyx_PyCode_New(7, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2880, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MACDEXT, 5748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2881)) __PYX_ERR(3, 5748, __pyx_L1_error) + + /* "talib/_stream.pxi":5795 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + __pyx_tuple__2882 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__2882)) __PYX_ERR(3, 5795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2882); + __Pyx_GIVEREF(__pyx_tuple__2882); + __pyx_codeobj__2883 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2882, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MACDFIX, 5795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2883)) __PYX_ERR(3, 5795, __pyx_L1_error) + + /* "talib/_stream.pxi":5837 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + __pyx_tuple__2884 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastlimit, __pyx_n_s_slowlimit, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmama, __pyx_n_s_outfama); if (unlikely(!__pyx_tuple__2884)) __PYX_ERR(3, 5837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2884); + __Pyx_GIVEREF(__pyx_tuple__2884); + __pyx_codeobj__2885 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2884, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MAMA, 5837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2885)) __PYX_ERR(3, 5837, __pyx_L1_error) + + /* "talib/_stream.pxi":5877 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + __pyx_tuple__2886 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_periods, __pyx_n_s_minperiod, __pyx_n_s_maxperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_periods_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2886)) __PYX_ERR(3, 5877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2886); + __Pyx_GIVEREF(__pyx_tuple__2886); + __pyx_codeobj__2887 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2886, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MAVP, 5877, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2887)) __PYX_ERR(3, 5877, __pyx_L1_error) + + /* "talib/_stream.pxi":5926 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2888 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2888)) __PYX_ERR(3, 5926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2888); + __Pyx_GIVEREF(__pyx_tuple__2888); + __pyx_codeobj__2889 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2888, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MAX, 5926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2889)) __PYX_ERR(3, 5926, __pyx_L1_error) + + /* "talib/_stream.pxi":5962 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2890 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2890)) __PYX_ERR(3, 5962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2890); + __Pyx_GIVEREF(__pyx_tuple__2890); + __pyx_codeobj__2891 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2890, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MAXINDEX, 5962, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2891)) __PYX_ERR(3, 5962, __pyx_L1_error) + + /* "talib/_stream.pxi":5998 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + __pyx_tuple__2892 = PyTuple_Pack(13, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2892)) __PYX_ERR(3, 5998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2892); + __Pyx_GIVEREF(__pyx_tuple__2892); + __pyx_codeobj__2893 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2892, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MEDPRICE, 5998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2893)) __PYX_ERR(3, 5998, __pyx_L1_error) + + /* "talib/_stream.pxi":6042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + __pyx_tuple__2894 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2894)) __PYX_ERR(3, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2894); + __Pyx_GIVEREF(__pyx_tuple__2894); + __pyx_codeobj__2895 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2894, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MFI, 6042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2895)) __PYX_ERR(3, 6042, __pyx_L1_error) + + /* "talib/_stream.pxi":6108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + __pyx_tuple__2896 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2896)) __PYX_ERR(3, 6108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2896); + __Pyx_GIVEREF(__pyx_tuple__2896); + __pyx_codeobj__2897 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2896, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MIDPOINT, 6108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2897)) __PYX_ERR(3, 6108, __pyx_L1_error) + + /* "talib/_stream.pxi":6144 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2898 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2898)) __PYX_ERR(3, 6144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2898); + __Pyx_GIVEREF(__pyx_tuple__2898); + __pyx_codeobj__2899 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2898, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MIDPRICE, 6144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2899)) __PYX_ERR(3, 6144, __pyx_L1_error) + + /* "talib/_stream.pxi":6190 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + __pyx_tuple__2900 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2900)) __PYX_ERR(3, 6190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2900); + __Pyx_GIVEREF(__pyx_tuple__2900); + __pyx_codeobj__2901 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2900, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MIN, 6190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2901)) __PYX_ERR(3, 6190, __pyx_L1_error) + + /* "talib/_stream.pxi":6226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2902 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__2902)) __PYX_ERR(3, 6226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2902); + __Pyx_GIVEREF(__pyx_tuple__2902); + __pyx_codeobj__2903 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2902, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MININDEX, 6226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2903)) __PYX_ERR(3, 6226, __pyx_L1_error) + + /* "talib/_stream.pxi":6262 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2904 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmin, __pyx_n_s_outmax); if (unlikely(!__pyx_tuple__2904)) __PYX_ERR(3, 6262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2904); + __Pyx_GIVEREF(__pyx_tuple__2904); + __pyx_codeobj__2905 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2904, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MINMAX, 6262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2905)) __PYX_ERR(3, 6262, __pyx_L1_error) + + /* "talib/_stream.pxi":6301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2906 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outminidx, __pyx_n_s_outmaxidx); if (unlikely(!__pyx_tuple__2906)) __PYX_ERR(3, 6301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2906); + __Pyx_GIVEREF(__pyx_tuple__2906); + __pyx_codeobj__2907 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2906, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MINMAXINDEX, 6301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2907)) __PYX_ERR(3, 6301, __pyx_L1_error) + + /* "talib/_stream.pxi":6340 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2908 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2908)) __PYX_ERR(3, 6340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2908); + __Pyx_GIVEREF(__pyx_tuple__2908); + __pyx_codeobj__2909 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2908, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MINUS_DI, 6340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2909)) __PYX_ERR(3, 6340, __pyx_L1_error) + + /* "talib/_stream.pxi":6396 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2910 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2910)) __PYX_ERR(3, 6396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2910); + __Pyx_GIVEREF(__pyx_tuple__2910); + __pyx_codeobj__2911 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2910, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MINUS_DM, 6396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2911)) __PYX_ERR(3, 6396, __pyx_L1_error) + + /* "talib/_stream.pxi":6442 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + __pyx_tuple__2912 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2912)) __PYX_ERR(3, 6442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2912); + __Pyx_GIVEREF(__pyx_tuple__2912); + __pyx_codeobj__2913 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2912, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MOM, 6442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2913)) __PYX_ERR(3, 6442, __pyx_L1_error) + + /* "talib/_stream.pxi":6478 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + __pyx_tuple__2914 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2914)) __PYX_ERR(3, 6478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2914); + __Pyx_GIVEREF(__pyx_tuple__2914); + __pyx_codeobj__2915 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2914, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_MULT, 6478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2915)) __PYX_ERR(3, 6478, __pyx_L1_error) + + /* "talib/_stream.pxi":6523 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2916 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2916)) __PYX_ERR(3, 6523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2916); + __Pyx_GIVEREF(__pyx_tuple__2916); + __pyx_codeobj__2917 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2916, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_NATR, 6523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2917)) __PYX_ERR(3, 6523, __pyx_L1_error) + + /* "talib/_stream.pxi":6579 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + __pyx_tuple__2918 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2918)) __PYX_ERR(3, 6579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2918); + __Pyx_GIVEREF(__pyx_tuple__2918); + __pyx_codeobj__2919 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2918, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_OBV, 6579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2919)) __PYX_ERR(3, 6579, __pyx_L1_error) + + /* "talib/_stream.pxi":6624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2920 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2920)) __PYX_ERR(3, 6624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2920); + __Pyx_GIVEREF(__pyx_tuple__2920); + __pyx_codeobj__2921 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2920, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_PLUS_DI, 6624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2921)) __PYX_ERR(3, 6624, __pyx_L1_error) + + /* "talib/_stream.pxi":6680 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_tuple__2922 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2922)) __PYX_ERR(3, 6680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2922); + __Pyx_GIVEREF(__pyx_tuple__2922); + __pyx_codeobj__2923 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2922, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_PLUS_DM, 6680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2923)) __PYX_ERR(3, 6680, __pyx_L1_error) + + /* "talib/_stream.pxi":6726 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_tuple__2924 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2924)) __PYX_ERR(3, 6726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2924); + __Pyx_GIVEREF(__pyx_tuple__2924); + __pyx_codeobj__2925 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2924, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_PPO, 6726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2925)) __PYX_ERR(3, 6726, __pyx_L1_error) + + /* "talib/_stream.pxi":6764 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + __pyx_tuple__2926 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2926)) __PYX_ERR(3, 6764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2926); + __Pyx_GIVEREF(__pyx_tuple__2926); + __pyx_codeobj__2927 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2926, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ROC, 6764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2927)) __PYX_ERR(3, 6764, __pyx_L1_error) + + /* "talib/_stream.pxi":6800 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + __pyx_tuple__2928 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2928)) __PYX_ERR(3, 6800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2928); + __Pyx_GIVEREF(__pyx_tuple__2928); + __pyx_codeobj__2929 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2928, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ROCP, 6800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2929)) __PYX_ERR(3, 6800, __pyx_L1_error) + + /* "talib/_stream.pxi":6836 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + __pyx_tuple__2930 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2930)) __PYX_ERR(3, 6836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2930); + __Pyx_GIVEREF(__pyx_tuple__2930); + __pyx_codeobj__2931 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2930, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ROCR, 6836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2931)) __PYX_ERR(3, 6836, __pyx_L1_error) + + /* "talib/_stream.pxi":6872 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + __pyx_tuple__2932 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2932)) __PYX_ERR(3, 6872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2932); + __Pyx_GIVEREF(__pyx_tuple__2932); + __pyx_codeobj__2933 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2932, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ROCR100, 6872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2933)) __PYX_ERR(3, 6872, __pyx_L1_error) + + /* "talib/_stream.pxi":6908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + __pyx_tuple__2934 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2934)) __PYX_ERR(3, 6908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2934); + __Pyx_GIVEREF(__pyx_tuple__2934); + __pyx_codeobj__2935 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2934, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_RSI, 6908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2935)) __PYX_ERR(3, 6908, __pyx_L1_error) + + /* "talib/_stream.pxi":6944 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + __pyx_tuple__2936 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_acceleration, __pyx_n_s_maximum, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2936)) __PYX_ERR(3, 6944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2936); + __Pyx_GIVEREF(__pyx_tuple__2936); + __pyx_codeobj__2937 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2936, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SAR, 6944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2937)) __PYX_ERR(3, 6944, __pyx_L1_error) + + /* "talib/_stream.pxi":6991 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + __pyx_tuple__2938 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_startvalue, __pyx_n_s_offsetonreverse, __pyx_n_s_accelerationinitlong, __pyx_n_s_accelerationlong, __pyx_n_s_accelerationmaxlong, __pyx_n_s_accelerationinitshort, __pyx_n_s_accelerationshort, __pyx_n_s_accelerationmaxshort, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2938)) __PYX_ERR(3, 6991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2938); + __Pyx_GIVEREF(__pyx_tuple__2938); + __pyx_codeobj__2939 = (PyObject*)__Pyx_PyCode_New(10, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2938, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SAREXT, 6991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2939)) __PYX_ERR(3, 6991, __pyx_L1_error) + + /* "talib/_stream.pxi":7044 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + __pyx_tuple__2940 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2940)) __PYX_ERR(3, 7044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2940); + __Pyx_GIVEREF(__pyx_tuple__2940); + __pyx_codeobj__2941 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2940, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SIN, 7044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2941)) __PYX_ERR(3, 7044, __pyx_L1_error) + + /* "talib/_stream.pxi":7078 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + __pyx_tuple__2942 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2942)) __PYX_ERR(3, 7078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2942); + __Pyx_GIVEREF(__pyx_tuple__2942); + __pyx_codeobj__2943 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2942, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SINH, 7078, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2943)) __PYX_ERR(3, 7078, __pyx_L1_error) + + /* "talib/_stream.pxi":7112 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2944 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2944)) __PYX_ERR(3, 7112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2944); + __Pyx_GIVEREF(__pyx_tuple__2944); + __pyx_codeobj__2945 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2944, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SMA, 7112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2945)) __PYX_ERR(3, 7112, __pyx_L1_error) + + /* "talib/_stream.pxi":7148 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + __pyx_tuple__2946 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2946)) __PYX_ERR(3, 7148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2946); + __Pyx_GIVEREF(__pyx_tuple__2946); + __pyx_codeobj__2947 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2946, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SQRT, 7148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2947)) __PYX_ERR(3, 7148, __pyx_L1_error) + + /* "talib/_stream.pxi":7182 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_tuple__2948 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2948)) __PYX_ERR(3, 7182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2948); + __Pyx_GIVEREF(__pyx_tuple__2948); + __pyx_codeobj__2949 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2948, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_STDDEV, 7182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2949)) __PYX_ERR(3, 7182, __pyx_L1_error) + + /* "talib/_stream.pxi":7219 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + __pyx_tuple__2950 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_slowk_period, __pyx_n_s_slowk_matype, __pyx_n_s_slowd_period, __pyx_n_s_slowd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outslowk, __pyx_n_s_outslowd); if (unlikely(!__pyx_tuple__2950)) __PYX_ERR(3, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2950); + __Pyx_GIVEREF(__pyx_tuple__2950); + __pyx_codeobj__2951 = (PyObject*)__Pyx_PyCode_New(8, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2950, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_STOCH, 7219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2951)) __PYX_ERR(3, 7219, __pyx_L1_error) + + /* "talib/_stream.pxi":7282 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_tuple__2952 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastd); if (unlikely(!__pyx_tuple__2952)) __PYX_ERR(3, 7282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2952); + __Pyx_GIVEREF(__pyx_tuple__2952); + __pyx_codeobj__2953 = (PyObject*)__Pyx_PyCode_New(6, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2952, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_STOCHF, 7282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2953)) __PYX_ERR(3, 7282, __pyx_L1_error) + + /* "talib/_stream.pxi":7343 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_tuple__2954 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastd); if (unlikely(!__pyx_tuple__2954)) __PYX_ERR(3, 7343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2954); + __Pyx_GIVEREF(__pyx_tuple__2954); + __pyx_codeobj__2955 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2954, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_STOCHRSI, 7343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2955)) __PYX_ERR(3, 7343, __pyx_L1_error) + + /* "talib/_stream.pxi":7385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + __pyx_tuple__2956 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2956)) __PYX_ERR(3, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2956); + __Pyx_GIVEREF(__pyx_tuple__2956); + __pyx_codeobj__2957 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2956, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SUB, 7385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2957)) __PYX_ERR(3, 7385, __pyx_L1_error) + + /* "talib/_stream.pxi":7430 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + __pyx_tuple__2958 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2958)) __PYX_ERR(3, 7430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2958); + __Pyx_GIVEREF(__pyx_tuple__2958); + __pyx_codeobj__2959 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2958, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_SUM, 7430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2959)) __PYX_ERR(3, 7430, __pyx_L1_error) + + /* "talib/_stream.pxi":7466 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + __pyx_tuple__2960 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_vfactor, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2960)) __PYX_ERR(3, 7466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2960); + __Pyx_GIVEREF(__pyx_tuple__2960); + __pyx_codeobj__2961 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2960, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_T3, 7466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2961)) __PYX_ERR(3, 7466, __pyx_L1_error) + + /* "talib/_stream.pxi":7503 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + __pyx_tuple__2962 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2962)) __PYX_ERR(3, 7503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2962); + __Pyx_GIVEREF(__pyx_tuple__2962); + __pyx_codeobj__2963 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2962, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TAN, 7503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2963)) __PYX_ERR(3, 7503, __pyx_L1_error) + + /* "talib/_stream.pxi":7537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + __pyx_tuple__2964 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2964)) __PYX_ERR(3, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2964); + __Pyx_GIVEREF(__pyx_tuple__2964); + __pyx_codeobj__2965 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2964, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TANH, 7537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2965)) __PYX_ERR(3, 7537, __pyx_L1_error) + + /* "talib/_stream.pxi":7571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2966 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2966)) __PYX_ERR(3, 7571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2966); + __Pyx_GIVEREF(__pyx_tuple__2966); + __pyx_codeobj__2967 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2966, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TEMA, 7571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2967)) __PYX_ERR(3, 7571, __pyx_L1_error) + + /* "talib/_stream.pxi":7607 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + __pyx_tuple__2968 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2968)) __PYX_ERR(3, 7607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2968); + __Pyx_GIVEREF(__pyx_tuple__2968); + __pyx_codeobj__2969 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2968, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TRANGE, 7607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2969)) __PYX_ERR(3, 7607, __pyx_L1_error) + + /* "talib/_stream.pxi":7661 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2970 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2970)) __PYX_ERR(3, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2970); + __Pyx_GIVEREF(__pyx_tuple__2970); + __pyx_codeobj__2971 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2970, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TRIMA, 7661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2971)) __PYX_ERR(3, 7661, __pyx_L1_error) + + /* "talib/_stream.pxi":7697 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + __pyx_tuple__2972 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2972)) __PYX_ERR(3, 7697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2972); + __Pyx_GIVEREF(__pyx_tuple__2972); + __pyx_codeobj__2973 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2972, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TRIX, 7697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2973)) __PYX_ERR(3, 7697, __pyx_L1_error) + + /* "talib/_stream.pxi":7733 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + __pyx_tuple__2974 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2974)) __PYX_ERR(3, 7733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2974); + __Pyx_GIVEREF(__pyx_tuple__2974); + __pyx_codeobj__2975 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2974, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TSF, 7733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2975)) __PYX_ERR(3, 7733, __pyx_L1_error) + + /* "talib/_stream.pxi":7769 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + __pyx_tuple__2976 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2976)) __PYX_ERR(3, 7769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2976); + __Pyx_GIVEREF(__pyx_tuple__2976); + __pyx_codeobj__2977 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2976, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_TYPPRICE, 7769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2977)) __PYX_ERR(3, 7769, __pyx_L1_error) + + /* "talib/_stream.pxi":7823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + __pyx_tuple__2978 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod1, __pyx_n_s_timeperiod2, __pyx_n_s_timeperiod3, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2978)) __PYX_ERR(3, 7823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2978); + __Pyx_GIVEREF(__pyx_tuple__2978); + __pyx_codeobj__2979 = (PyObject*)__Pyx_PyCode_New(6, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2978, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_ULTOSC, 7823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2979)) __PYX_ERR(3, 7823, __pyx_L1_error) + + /* "talib/_stream.pxi":7881 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_tuple__2980 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2980)) __PYX_ERR(3, 7881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2980); + __Pyx_GIVEREF(__pyx_tuple__2980); + __pyx_codeobj__2981 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2980, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_VAR, 7881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2981)) __PYX_ERR(3, 7881, __pyx_L1_error) + + /* "talib/_stream.pxi":7918 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + __pyx_tuple__2982 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2982)) __PYX_ERR(3, 7918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2982); + __Pyx_GIVEREF(__pyx_tuple__2982); + __pyx_codeobj__2983 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2982, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_WCLPRICE, 7918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2983)) __PYX_ERR(3, 7918, __pyx_L1_error) + + /* "talib/_stream.pxi":7972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + __pyx_tuple__2984 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2984)) __PYX_ERR(3, 7972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2984); + __Pyx_GIVEREF(__pyx_tuple__2984); + __pyx_codeobj__2985 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2984, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_WILLR, 7972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2985)) __PYX_ERR(3, 7972, __pyx_L1_error) + + /* "talib/_stream.pxi":8028 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + __pyx_tuple__2986 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__2986)) __PYX_ERR(3, 8028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2986); + __Pyx_GIVEREF(__pyx_tuple__2986); + __pyx_codeobj__2987 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2986, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_kelvin_GitHub_mrjbq7_ta_l_4, __pyx_n_s_stream_WMA, 8028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2987)) __PYX_ERR(3, 8028, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(5, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_5000 = PyInt_FromLong(5000); if (unlikely(!__pyx_int_5000)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_16777216 = PyInt_FromLong(16777216L); if (unlikely(!__pyx_int_16777216)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_67108864 = PyInt_FromLong(67108864L); if (unlikely(!__pyx_int_67108864)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_134217728 = PyInt_FromLong(134217728L); if (unlikely(!__pyx_int_134217728)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(5, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_ta_lib(void); /*proto*/ +PyMODINIT_FUNC init_ta_lib(void) +#else +PyMODINIT_FUNC PyInit__ta_lib(void); /*proto*/ +PyMODINIT_FUNC PyInit__ta_lib(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + double __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_t_21; + int __pyx_t_22; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__ta_lib(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(5, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_ta_lib", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(5, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(5, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(5, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(5, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_talib___ta_lib) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(5, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(5, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "talib._ta_lib")) { + if (unlikely(PyDict_SetItemString(modules, "talib._ta_lib", __pyx_m) < 0)) __PYX_ERR(5, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(6, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(4, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(4, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(4, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(4, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(5, 1, __pyx_L1_error) + #endif + + /* "talib/_common.pxi":4 + * from _ta_lib cimport TA_RetCode, TA_FuncUnstId + * + * __ta_version__ = lib.TA_GetVersionString() # <<<<<<<<<<<<<< + * + * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): + */ + __pyx_t_1 = __Pyx_PyBytes_FromString(TA_GetVersionString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_version, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":33 + * function_name, ret_code, ta_errors[ret_code])) + * + * def _ta_initialize(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Initialize() + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_3_ta_initialize, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_initialize, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":38 + * _ta_check_success('TA_Initialize', ret_code) + * + * def _ta_shutdown(): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * ret_code = lib.TA_Shutdown() + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_5_ta_shutdown, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_shutdown, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":43 + * _ta_check_success('TA_Shutdown', ret_code) + * + * class MA_Type(object): # <<<<<<<<<<<<<< + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MA_Type, __pyx_n_s_MA_Type, (PyObject *) NULL, __pyx_n_s_talib__ta_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "talib/_common.pxi":44 + * + * class MA_Type(object): + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__2276, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 9)) { + if (size > 9) __Pyx_RaiseTooManyValuesError(9); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 44, __pyx_L1_error) + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6); + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_7 = PyList_GET_ITEM(sequence, 2); + __pyx_t_8 = PyList_GET_ITEM(sequence, 3); + __pyx_t_9 = PyList_GET_ITEM(sequence, 4); + __pyx_t_10 = PyList_GET_ITEM(sequence, 5); + __pyx_t_11 = PyList_GET_ITEM(sequence, 6); + __pyx_t_12 = PyList_GET_ITEM(sequence, 7); + __pyx_t_13 = PyList_GET_ITEM(sequence, 8); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + #else + { + Py_ssize_t i; + PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13}; + for (i=0; i < 9; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13}; + __pyx_t_14 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext; + for (index=0; index < 9; index++) { + PyObject* item = __pyx_t_15(__pyx_t_14); if (unlikely(!item)) goto __pyx_L2_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 9) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L3_unpacking_done; + __pyx_L2_unpacking_failed:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_L3_unpacking_done:; + } + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SMA, __pyx_t_5) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_EMA, __pyx_t_6) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_WMA, __pyx_t_7) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DEMA, __pyx_t_8) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TEMA, __pyx_t_9) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TRIMA, __pyx_t_10) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_KAMA, __pyx_t_11) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MAMA, __pyx_t_12) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_T3, __pyx_t_13) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "talib/_common.pxi":46 + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + * def __init__(self): # <<<<<<<<<<<<<< + * self._lookup = { + * MA_Type.SMA: 'Simple Moving Average', + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_7MA_Type_1__init__, 0, __pyx_n_s_MA_Type___init, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2278)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_common.pxi":59 + * } + * + * def __getitem__(self, type_): # <<<<<<<<<<<<<< + * return self._lookup[type_] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_7MA_Type_3__getitem__, 0, __pyx_n_s_MA_Type___getitem, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2280)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_common.pxi":43 + * _ta_check_success('TA_Shutdown', ret_code) + * + * class MA_Type(object): # <<<<<<<<<<<<<< + * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) + * + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MA_Type, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA_Type, __pyx_t_4) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":62 + * return self._lookup[type_] + * + * MA_Type = MA_Type() # <<<<<<<<<<<<<< + * + * _ta_func_unst_ids = {'NONE': -1} + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA_Type, __pyx_t_1) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":64 + * MA_Type = MA_Type() + * + * _ta_func_unst_ids = {'NONE': -1} # <<<<<<<<<<<<<< + * for i, name in enumerate([ + * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_NONE, __pyx_int_neg_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_func_unst_ids, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":65 + * + * _ta_func_unst_ids = {'NONE': -1} + * for i, name in enumerate([ # <<<<<<<<<<<<<< + * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', + * 'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDLINE', + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = PyList_New(24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ADX); + __Pyx_GIVEREF(__pyx_n_s_ADX); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ADX); + __Pyx_INCREF(__pyx_n_s_ADXR); + __Pyx_GIVEREF(__pyx_n_s_ADXR); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ADXR); + __Pyx_INCREF(__pyx_n_s_ATR); + __Pyx_GIVEREF(__pyx_n_s_ATR); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ATR); + __Pyx_INCREF(__pyx_n_s_CMO); + __Pyx_GIVEREF(__pyx_n_s_CMO); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_CMO); + __Pyx_INCREF(__pyx_n_s_DX); + __Pyx_GIVEREF(__pyx_n_s_DX); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_DX); + __Pyx_INCREF(__pyx_n_s_EMA); + __Pyx_GIVEREF(__pyx_n_s_EMA); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_EMA); + __Pyx_INCREF(__pyx_n_s_HT_DCPERIOD); + __Pyx_GIVEREF(__pyx_n_s_HT_DCPERIOD); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_HT_DCPERIOD); + __Pyx_INCREF(__pyx_n_s_HT_DCPHASE); + __Pyx_GIVEREF(__pyx_n_s_HT_DCPHASE); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_HT_DCPHASE); + __Pyx_INCREF(__pyx_n_s_HT_PHASOR); + __Pyx_GIVEREF(__pyx_n_s_HT_PHASOR); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_HT_PHASOR); + __Pyx_INCREF(__pyx_n_s_HT_SINE); + __Pyx_GIVEREF(__pyx_n_s_HT_SINE); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_HT_SINE); + __Pyx_INCREF(__pyx_n_s_HT_TRENDLINE); + __Pyx_GIVEREF(__pyx_n_s_HT_TRENDLINE); + PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_s_HT_TRENDLINE); + __Pyx_INCREF(__pyx_n_s_HT_TRENDMODE); + __Pyx_GIVEREF(__pyx_n_s_HT_TRENDMODE); + PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_s_HT_TRENDMODE); + __Pyx_INCREF(__pyx_n_s_KAMA); + __Pyx_GIVEREF(__pyx_n_s_KAMA); + PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_s_KAMA); + __Pyx_INCREF(__pyx_n_s_MAMA); + __Pyx_GIVEREF(__pyx_n_s_MAMA); + PyList_SET_ITEM(__pyx_t_2, 13, __pyx_n_s_MAMA); + __Pyx_INCREF(__pyx_n_s_MFI); + __Pyx_GIVEREF(__pyx_n_s_MFI); + PyList_SET_ITEM(__pyx_t_2, 14, __pyx_n_s_MFI); + __Pyx_INCREF(__pyx_n_s_MINUS_DI); + __Pyx_GIVEREF(__pyx_n_s_MINUS_DI); + PyList_SET_ITEM(__pyx_t_2, 15, __pyx_n_s_MINUS_DI); + __Pyx_INCREF(__pyx_n_s_MINUS_DM); + __Pyx_GIVEREF(__pyx_n_s_MINUS_DM); + PyList_SET_ITEM(__pyx_t_2, 16, __pyx_n_s_MINUS_DM); + __Pyx_INCREF(__pyx_n_s_NATR); + __Pyx_GIVEREF(__pyx_n_s_NATR); + PyList_SET_ITEM(__pyx_t_2, 17, __pyx_n_s_NATR); + __Pyx_INCREF(__pyx_n_s_PLUS_DI); + __Pyx_GIVEREF(__pyx_n_s_PLUS_DI); + PyList_SET_ITEM(__pyx_t_2, 18, __pyx_n_s_PLUS_DI); + __Pyx_INCREF(__pyx_n_s_PLUS_DM); + __Pyx_GIVEREF(__pyx_n_s_PLUS_DM); + PyList_SET_ITEM(__pyx_t_2, 19, __pyx_n_s_PLUS_DM); + __Pyx_INCREF(__pyx_n_s_RSI); + __Pyx_GIVEREF(__pyx_n_s_RSI); + PyList_SET_ITEM(__pyx_t_2, 20, __pyx_n_s_RSI); + __Pyx_INCREF(__pyx_n_s_STOCHRSI); + __Pyx_GIVEREF(__pyx_n_s_STOCHRSI); + PyList_SET_ITEM(__pyx_t_2, 21, __pyx_n_s_STOCHRSI); + __Pyx_INCREF(__pyx_n_s_T3); + __Pyx_GIVEREF(__pyx_n_s_T3); + PyList_SET_ITEM(__pyx_t_2, 22, __pyx_n_s_T3); + __Pyx_INCREF(__pyx_n_s_ALL); + __Pyx_GIVEREF(__pyx_n_s_ALL); + PyList_SET_ITEM(__pyx_t_2, 23, __pyx_n_s_ALL); + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_16 >= 24) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_i, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "talib/_common.pxi":71 + * 'NATR', 'PLUS_DI', 'PLUS_DM', 'RSI', 'STOCHRSI', 'T3', 'ALL' + * ]): + * _ta_func_unst_ids[name] = i # <<<<<<<<<<<<<< + * + * def _ta_set_unstable_period(name, period): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_2) < 0)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_common.pxi":65 + * + * _ta_func_unst_ids = {'NONE': -1} + * for i, name in enumerate([ # <<<<<<<<<<<<<< + * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', + * 'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDLINE', + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":73 + * _ta_func_unst_ids[name] = i + * + * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< + * cdef TA_RetCode ret_code + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_7_ta_set_unstable_period, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_set_unstable_period, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_common.pxi":79 + * _ta_check_success('TA_SetUnstablePeriod', ret_code) + * + * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< + * cdef unsigned int period + * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_9_ta_get_unstable_period, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_get_unstable_period, __pyx_t_1) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_func.pxi":2 + * cimport numpy as np + * from numpy import nan # <<<<<<<<<<<<<< + * from cython import boundscheck, wraparound + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_nan); + __Pyx_GIVEREF(__pyx_n_s_nan); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_nan); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nan, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7 + * # _ta_check_success: defined in _common.pxi + * + * cdef double NaN = nan # <<<<<<<<<<<<<< + * + * cdef extern from "numpy/arrayobject.h": + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_5talib_7_ta_lib_NaN = __pyx_t_17; + + /* "talib/_func.pxi":15 + * object PyArray_GETCONTIGUOUS(np.ndarray) + * + * np.import_array() # Initialize the NumPy C API # <<<<<<<<<<<<<< + * + * cimport _ta_lib as lib + */ + import_array(); + + /* "talib/_func.pxi":20 + * from _ta_lib cimport TA_RetCode + * + * lib.TA_Initialize() # <<<<<<<<<<<<<< + * + * @wraparound(False) # turn off relative indexing from end of lists + */ + TA_Initialize(); + + /* "talib/_func.pxi":24 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_11ACOS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACOS, __pyx_t_3) < 0) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":73 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_13AD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AD, __pyx_t_3) < 0) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":161 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_15ADD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD, __pyx_t_3) < 0) __PYX_ERR(2, 161, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":224 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_17ADOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADOSC, __pyx_t_3) < 0) __PYX_ERR(2, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":315 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_19ADX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADX, __pyx_t_3) < 0) __PYX_ERR(2, 315, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":392 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_21ADXR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADXR, __pyx_t_3) < 0) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":469 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_23APO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_APO, __pyx_t_3) < 0) __PYX_ERR(2, 469, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_25AROON, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROON, __pyx_t_3) < 0) __PYX_ERR(2, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":593 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_27AROONOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROONOSC, __pyx_t_3) < 0) __PYX_ERR(2, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":657 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_29ASIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASIN, __pyx_t_3) < 0) __PYX_ERR(2, 657, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":706 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_31ATAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATAN, __pyx_t_3) < 0) __PYX_ERR(2, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":755 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_33ATR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATR, __pyx_t_3) < 0) __PYX_ERR(2, 755, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":832 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_35AVGPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AVGPRICE, __pyx_t_3) < 0) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":920 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_37BBANDS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 920, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BBANDS, __pyx_t_3) < 0) __PYX_ERR(2, 920, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":988 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_39BETA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BETA, __pyx_t_3) < 0) __PYX_ERR(2, 988, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_41BOP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BOP, __pyx_t_3) < 0) __PYX_ERR(2, 1053, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_43CCI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CCI, __pyx_t_3) < 0) __PYX_ERR(2, 1141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_45CDL2CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL2CROWS, __pyx_t_3) < 0) __PYX_ERR(2, 1218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_47CDL3BLACKCROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3BLACKCROWS, __pyx_t_3) < 0) __PYX_ERR(2, 1306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_49CDL3INSIDE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3INSIDE, __pyx_t_3) < 0) __PYX_ERR(2, 1394, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_51CDL3LINESTRIKE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3LINESTRIKE, __pyx_t_3) < 0) __PYX_ERR(2, 1482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_53CDL3OUTSIDE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3OUTSIDE, __pyx_t_3) < 0) __PYX_ERR(2, 1570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_55CDL3STARSINSOUTH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3STARSINSOUTH, __pyx_t_3) < 0) __PYX_ERR(2, 1658, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_57CDL3WHITESOLDIERS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3WHITESOLDIERS, __pyx_t_3) < 0) __PYX_ERR(2, 1746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_59CDLABANDONEDBABY, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLABANDONEDBABY, __pyx_t_3) < 0) __PYX_ERR(2, 1834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":1924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_61CDLADVANCEBLOCK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLADVANCEBLOCK, __pyx_t_3) < 0) __PYX_ERR(2, 1924, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2012 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_63CDLBELTHOLD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBELTHOLD, __pyx_t_3) < 0) __PYX_ERR(2, 2012, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2100 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_65CDLBREAKAWAY, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBREAKAWAY, __pyx_t_3) < 0) __PYX_ERR(2, 2100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2188 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_67CDLCLOSINGMARUBOZU, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(2, 2188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_69CDLCONCEALBABYSWALL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCONCEALBABYSWALL, __pyx_t_3) < 0) __PYX_ERR(2, 2276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2364 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_71CDLCOUNTERATTACK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCOUNTERATTACK, __pyx_t_3) < 0) __PYX_ERR(2, 2364, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2452 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_73CDLDARKCLOUDCOVER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDARKCLOUDCOVER, __pyx_t_3) < 0) __PYX_ERR(2, 2452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2542 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_75CDLDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJI, __pyx_t_3) < 0) __PYX_ERR(2, 2542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2630 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_77CDLDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(2, 2630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2718 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_79CDLDRAGONFLYDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDRAGONFLYDOJI, __pyx_t_3) < 0) __PYX_ERR(2, 2718, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2806 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_81CDLENGULFING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLENGULFING, __pyx_t_3) < 0) __PYX_ERR(2, 2806, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2894 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_83CDLEVENINGDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(2, 2894, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":2984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_85CDLEVENINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGSTAR, __pyx_t_3) < 0) __PYX_ERR(2, 2984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3074 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_87CDLGAPSIDESIDEWHITE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_t_3) < 0) __PYX_ERR(2, 3074, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3162 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_89CDLGRAVESTONEDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGRAVESTONEDOJI, __pyx_t_3) < 0) __PYX_ERR(2, 3162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3250 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_91CDLHAMMER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHAMMER, __pyx_t_3) < 0) __PYX_ERR(2, 3250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3338 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_93CDLHANGINGMAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHANGINGMAN, __pyx_t_3) < 0) __PYX_ERR(2, 3338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3426 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_95CDLHARAMI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMI, __pyx_t_3) < 0) __PYX_ERR(2, 3426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3514 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_97CDLHARAMICROSS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMICROSS, __pyx_t_3) < 0) __PYX_ERR(2, 3514, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3602 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_99CDLHIGHWAVE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIGHWAVE, __pyx_t_3) < 0) __PYX_ERR(2, 3602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3690 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_101CDLHIKKAKE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKE, __pyx_t_3) < 0) __PYX_ERR(2, 3690, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3778 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_103CDLHIKKAKEMOD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKEMOD, __pyx_t_3) < 0) __PYX_ERR(2, 3778, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3866 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_105CDLHOMINGPIGEON, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHOMINGPIGEON, __pyx_t_3) < 0) __PYX_ERR(2, 3866, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":3954 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_107CDLIDENTICAL3CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLIDENTICAL3CROWS, __pyx_t_3) < 0) __PYX_ERR(2, 3954, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_109CDLINNECK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINNECK, __pyx_t_3) < 0) __PYX_ERR(2, 4042, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4130 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_111CDLINVERTEDHAMMER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINVERTEDHAMMER, __pyx_t_3) < 0) __PYX_ERR(2, 4130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4218 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_113CDLKICKING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKING, __pyx_t_3) < 0) __PYX_ERR(2, 4218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4306 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_115CDLKICKINGBYLENGTH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKINGBYLENGTH, __pyx_t_3) < 0) __PYX_ERR(2, 4306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4394 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_117CDLLADDERBOTTOM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLADDERBOTTOM, __pyx_t_3) < 0) __PYX_ERR(2, 4394, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4482 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_119CDLLONGLEGGEDDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_t_3) < 0) __PYX_ERR(2, 4482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4570 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_121CDLLONGLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLINE, __pyx_t_3) < 0) __PYX_ERR(2, 4570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4658 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_123CDLMARUBOZU, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(2, 4658, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4746 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_125CDLMATCHINGLOW, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATCHINGLOW, __pyx_t_3) < 0) __PYX_ERR(2, 4746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4834 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_127CDLMATHOLD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATHOLD, __pyx_t_3) < 0) __PYX_ERR(2, 4834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":4924 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_129CDLMORNINGDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(2, 4924, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5014 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_131CDLMORNINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGSTAR, __pyx_t_3) < 0) __PYX_ERR(2, 5014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5104 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_133CDLONNECK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLONNECK, __pyx_t_3) < 0) __PYX_ERR(2, 5104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5192 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_135CDLPIERCING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLPIERCING, __pyx_t_3) < 0) __PYX_ERR(2, 5192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5280 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_137CDLRICKSHAWMAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRICKSHAWMAN, __pyx_t_3) < 0) __PYX_ERR(2, 5280, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5368 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_139CDLRISEFALL3METHODS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRISEFALL3METHODS, __pyx_t_3) < 0) __PYX_ERR(2, 5368, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5456 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_141CDLSEPARATINGLINES, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSEPARATINGLINES, __pyx_t_3) < 0) __PYX_ERR(2, 5456, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5544 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_143CDLSHOOTINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHOOTINGSTAR, __pyx_t_3) < 0) __PYX_ERR(2, 5544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5632 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_145CDLSHORTLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHORTLINE, __pyx_t_3) < 0) __PYX_ERR(2, 5632, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5720 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_147CDLSPINNINGTOP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSPINNINGTOP, __pyx_t_3) < 0) __PYX_ERR(2, 5720, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5808 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_149CDLSTALLEDPATTERN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTALLEDPATTERN, __pyx_t_3) < 0) __PYX_ERR(2, 5808, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5896 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_151CDLSTICKSANDWICH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTICKSANDWICH, __pyx_t_3) < 0) __PYX_ERR(2, 5896, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":5984 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_153CDLTAKURI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTAKURI, __pyx_t_3) < 0) __PYX_ERR(2, 5984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6072 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_155CDLTASUKIGAP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTASUKIGAP, __pyx_t_3) < 0) __PYX_ERR(2, 6072, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6160 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_157CDLTHRUSTING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTHRUSTING, __pyx_t_3) < 0) __PYX_ERR(2, 6160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6248 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_159CDLTRISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTRISTAR, __pyx_t_3) < 0) __PYX_ERR(2, 6248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6336 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_161CDLUNIQUE3RIVER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUNIQUE3RIVER, __pyx_t_3) < 0) __PYX_ERR(2, 6336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6424 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_163CDLUPSIDEGAP2CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_t_3) < 0) __PYX_ERR(2, 6424, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6512 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_165CDLXSIDEGAP3METHODS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_t_3) < 0) __PYX_ERR(2, 6512, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6600 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_167CEIL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CEIL, __pyx_t_3) < 0) __PYX_ERR(2, 6600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6649 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_169CMO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMO, __pyx_t_3) < 0) __PYX_ERR(2, 6649, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6700 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_171CORREL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CORREL, __pyx_t_3) < 0) __PYX_ERR(2, 6700, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6765 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_173COS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_COS, __pyx_t_3) < 0) __PYX_ERR(2, 6765, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6814 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_175COSH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_COSH, __pyx_t_3) < 0) __PYX_ERR(2, 6814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6863 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_177DEMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEMA, __pyx_t_3) < 0) __PYX_ERR(2, 6863, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_179DIV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DIV, __pyx_t_3) < 0) __PYX_ERR(2, 6914, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":6977 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_181DX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DX, __pyx_t_3) < 0) __PYX_ERR(2, 6977, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7054 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_183EMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMA, __pyx_t_3) < 0) __PYX_ERR(2, 7054, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_185EXP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXP, __pyx_t_3) < 0) __PYX_ERR(2, 7105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7154 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_187FLOOR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FLOOR, __pyx_t_3) < 0) __PYX_ERR(2, 7154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7203 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_189HT_DCPERIOD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPERIOD, __pyx_t_3) < 0) __PYX_ERR(2, 7203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7252 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_191HT_DCPHASE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPHASE, __pyx_t_3) < 0) __PYX_ERR(2, 7252, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_193HT_PHASOR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_PHASOR, __pyx_t_3) < 0) __PYX_ERR(2, 7301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7357 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_195HT_SINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_SINE, __pyx_t_3) < 0) __PYX_ERR(2, 7357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7413 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_197HT_TRENDLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDLINE, __pyx_t_3) < 0) __PYX_ERR(2, 7413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_199HT_TRENDMODE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDMODE, __pyx_t_3) < 0) __PYX_ERR(2, 7462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_201KAMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_KAMA, __pyx_t_3) < 0) __PYX_ERR(2, 7511, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7562 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_203LINEARREG, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG, __pyx_t_3) < 0) __PYX_ERR(2, 7562, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_205LINEARREG_ANGLE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_ANGLE, __pyx_t_3) < 0) __PYX_ERR(2, 7613, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_207LINEARREG_INTERCEPT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_INTERCEPT, __pyx_t_3) < 0) __PYX_ERR(2, 7664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_209LINEARREG_SLOPE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_SLOPE, __pyx_t_3) < 0) __PYX_ERR(2, 7715, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7766 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_211LN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LN, __pyx_t_3) < 0) __PYX_ERR(2, 7766, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7815 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_213LOG10, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOG10, __pyx_t_3) < 0) __PYX_ERR(2, 7815, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7864 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_215MA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA, __pyx_t_3) < 0) __PYX_ERR(2, 7864, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7916 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_217MACD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACD, __pyx_t_3) < 0) __PYX_ERR(2, 7916, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":7983 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_219MACDEXT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDEXT, __pyx_t_3) < 0) __PYX_ERR(2, 7983, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8053 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_221MACDFIX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDFIX, __pyx_t_3) < 0) __PYX_ERR(2, 8053, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8118 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_223MAMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAMA, __pyx_t_3) < 0) __PYX_ERR(2, 8118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_225MAVP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAVP, __pyx_t_3) < 0) __PYX_ERR(2, 8177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8244 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_227MAX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX, __pyx_t_3) < 0) __PYX_ERR(2, 8244, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8295 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_229MAXINDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINDEX, __pyx_t_3) < 0) __PYX_ERR(2, 8295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8346 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_231MEDPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MEDPRICE, __pyx_t_3) < 0) __PYX_ERR(2, 8346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8408 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_233MFI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MFI, __pyx_t_3) < 0) __PYX_ERR(2, 8408, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8498 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_235MIDPOINT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPOINT, __pyx_t_3) < 0) __PYX_ERR(2, 8498, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8549 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_237MIDPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPRICE, __pyx_t_3) < 0) __PYX_ERR(2, 8549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8613 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_239MIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIN, __pyx_t_3) < 0) __PYX_ERR(2, 8613, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8664 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_241MININDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MININDEX, __pyx_t_3) < 0) __PYX_ERR(2, 8664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8715 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_243MINMAX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAX, __pyx_t_3) < 0) __PYX_ERR(2, 8715, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8773 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_245MINMAXINDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAXINDEX, __pyx_t_3) < 0) __PYX_ERR(2, 8773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8831 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_247MINUS_DI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DI, __pyx_t_3) < 0) __PYX_ERR(2, 8831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_249MINUS_DM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DM, __pyx_t_3) < 0) __PYX_ERR(2, 8908, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":8972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_251MOM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOM, __pyx_t_3) < 0) __PYX_ERR(2, 8972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9023 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_253MULT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULT, __pyx_t_3) < 0) __PYX_ERR(2, 9023, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9086 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_255NATR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NATR, __pyx_t_3) < 0) __PYX_ERR(2, 9086, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9163 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_257OBV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OBV, __pyx_t_3) < 0) __PYX_ERR(2, 9163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_259PLUS_DI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DI, __pyx_t_3) < 0) __PYX_ERR(2, 9226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9303 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_261PLUS_DM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DM, __pyx_t_3) < 0) __PYX_ERR(2, 9303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9367 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_263PPO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PPO, __pyx_t_3) < 0) __PYX_ERR(2, 9367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9420 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_265ROC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROC, __pyx_t_3) < 0) __PYX_ERR(2, 9420, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9471 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_267ROCP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCP, __pyx_t_3) < 0) __PYX_ERR(2, 9471, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9522 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_269ROCR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR, __pyx_t_3) < 0) __PYX_ERR(2, 9522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9573 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_271ROCR100, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR100, __pyx_t_3) < 0) __PYX_ERR(2, 9573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_273RSI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RSI, __pyx_t_3) < 0) __PYX_ERR(2, 9624, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9675 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_275SAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAR, __pyx_t_3) < 0) __PYX_ERR(2, 9675, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9740 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_277SAREXT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAREXT, __pyx_t_3) < 0) __PYX_ERR(2, 9740, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9811 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_279SIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIN, __pyx_t_3) < 0) __PYX_ERR(2, 9811, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9860 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_281SINH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SINH, __pyx_t_3) < 0) __PYX_ERR(2, 9860, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9909 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_283SMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SMA, __pyx_t_3) < 0) __PYX_ERR(2, 9909, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":9960 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_285SQRT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9960, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQRT, __pyx_t_3) < 0) __PYX_ERR(2, 9960, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10009 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_287STDDEV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STDDEV, __pyx_t_3) < 0) __PYX_ERR(2, 10009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10061 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_289STOCH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCH, __pyx_t_3) < 0) __PYX_ERR(2, 10061, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10149 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_291STOCHF, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHF, __pyx_t_3) < 0) __PYX_ERR(2, 10149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10235 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_293STOCHRSI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHRSI, __pyx_t_3) < 0) __PYX_ERR(2, 10235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10296 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_295SUB, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUB, __pyx_t_3) < 0) __PYX_ERR(2, 10296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10359 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_297SUM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUM, __pyx_t_3) < 0) __PYX_ERR(2, 10359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10410 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_299T3, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_T3, __pyx_t_3) < 0) __PYX_ERR(2, 10410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10462 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_301TAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAN, __pyx_t_3) < 0) __PYX_ERR(2, 10462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10511 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_303TANH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TANH, __pyx_t_3) < 0) __PYX_ERR(2, 10511, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10560 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_305TEMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEMA, __pyx_t_3) < 0) __PYX_ERR(2, 10560, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10611 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_307TRANGE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRANGE, __pyx_t_3) < 0) __PYX_ERR(2, 10611, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10686 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_309TRIMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIMA, __pyx_t_3) < 0) __PYX_ERR(2, 10686, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10737 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_311TRIX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIX, __pyx_t_3) < 0) __PYX_ERR(2, 10737, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10788 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_313TSF, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSF, __pyx_t_3) < 0) __PYX_ERR(2, 10788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10839 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_315TYPPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPPRICE, __pyx_t_3) < 0) __PYX_ERR(2, 10839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10914 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_317ULTOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ULTOSC, __pyx_t_3) < 0) __PYX_ERR(2, 10914, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":10993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_319VAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VAR, __pyx_t_3) < 0) __PYX_ERR(2, 10993, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":11045 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_321WCLPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WCLPRICE, __pyx_t_3) < 0) __PYX_ERR(2, 11045, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":11120 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_323WILLR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WILLR, __pyx_t_3) < 0) __PYX_ERR(2, 11120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":11197 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_325WMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WMA, __pyx_t_3) < 0) __PYX_ERR(2, 11197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_func.pxi":11246 + * return outreal + * + * __TA_FUNCTION_NAMES__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] # <<<<<<<<<<<<<< + */ + __pyx_t_3 = PyList_New(158); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_ACOS); + __Pyx_GIVEREF(__pyx_n_s_ACOS); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ACOS); + __Pyx_INCREF(__pyx_n_s_AD); + __Pyx_GIVEREF(__pyx_n_s_AD); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_AD); + __Pyx_INCREF(__pyx_n_s_ADD); + __Pyx_GIVEREF(__pyx_n_s_ADD); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ADD); + __Pyx_INCREF(__pyx_n_s_ADOSC); + __Pyx_GIVEREF(__pyx_n_s_ADOSC); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ADOSC); + __Pyx_INCREF(__pyx_n_s_ADX); + __Pyx_GIVEREF(__pyx_n_s_ADX); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ADX); + __Pyx_INCREF(__pyx_n_s_ADXR); + __Pyx_GIVEREF(__pyx_n_s_ADXR); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ADXR); + __Pyx_INCREF(__pyx_n_s_APO); + __Pyx_GIVEREF(__pyx_n_s_APO); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_APO); + __Pyx_INCREF(__pyx_n_s_AROON); + __Pyx_GIVEREF(__pyx_n_s_AROON); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_AROON); + __Pyx_INCREF(__pyx_n_s_AROONOSC); + __Pyx_GIVEREF(__pyx_n_s_AROONOSC); + PyList_SET_ITEM(__pyx_t_3, 8, __pyx_n_s_AROONOSC); + __Pyx_INCREF(__pyx_n_s_ASIN); + __Pyx_GIVEREF(__pyx_n_s_ASIN); + PyList_SET_ITEM(__pyx_t_3, 9, __pyx_n_s_ASIN); + __Pyx_INCREF(__pyx_n_s_ATAN); + __Pyx_GIVEREF(__pyx_n_s_ATAN); + PyList_SET_ITEM(__pyx_t_3, 10, __pyx_n_s_ATAN); + __Pyx_INCREF(__pyx_n_s_ATR); + __Pyx_GIVEREF(__pyx_n_s_ATR); + PyList_SET_ITEM(__pyx_t_3, 11, __pyx_n_s_ATR); + __Pyx_INCREF(__pyx_n_s_AVGPRICE); + __Pyx_GIVEREF(__pyx_n_s_AVGPRICE); + PyList_SET_ITEM(__pyx_t_3, 12, __pyx_n_s_AVGPRICE); + __Pyx_INCREF(__pyx_n_s_BBANDS); + __Pyx_GIVEREF(__pyx_n_s_BBANDS); + PyList_SET_ITEM(__pyx_t_3, 13, __pyx_n_s_BBANDS); + __Pyx_INCREF(__pyx_n_s_BETA); + __Pyx_GIVEREF(__pyx_n_s_BETA); + PyList_SET_ITEM(__pyx_t_3, 14, __pyx_n_s_BETA); + __Pyx_INCREF(__pyx_n_s_BOP); + __Pyx_GIVEREF(__pyx_n_s_BOP); + PyList_SET_ITEM(__pyx_t_3, 15, __pyx_n_s_BOP); + __Pyx_INCREF(__pyx_n_s_CCI); + __Pyx_GIVEREF(__pyx_n_s_CCI); + PyList_SET_ITEM(__pyx_t_3, 16, __pyx_n_s_CCI); + __Pyx_INCREF(__pyx_n_s_CDL2CROWS); + __Pyx_GIVEREF(__pyx_n_s_CDL2CROWS); + PyList_SET_ITEM(__pyx_t_3, 17, __pyx_n_s_CDL2CROWS); + __Pyx_INCREF(__pyx_n_s_CDL3BLACKCROWS); + __Pyx_GIVEREF(__pyx_n_s_CDL3BLACKCROWS); + PyList_SET_ITEM(__pyx_t_3, 18, __pyx_n_s_CDL3BLACKCROWS); + __Pyx_INCREF(__pyx_n_s_CDL3INSIDE); + __Pyx_GIVEREF(__pyx_n_s_CDL3INSIDE); + PyList_SET_ITEM(__pyx_t_3, 19, __pyx_n_s_CDL3INSIDE); + __Pyx_INCREF(__pyx_n_s_CDL3LINESTRIKE); + __Pyx_GIVEREF(__pyx_n_s_CDL3LINESTRIKE); + PyList_SET_ITEM(__pyx_t_3, 20, __pyx_n_s_CDL3LINESTRIKE); + __Pyx_INCREF(__pyx_n_s_CDL3OUTSIDE); + __Pyx_GIVEREF(__pyx_n_s_CDL3OUTSIDE); + PyList_SET_ITEM(__pyx_t_3, 21, __pyx_n_s_CDL3OUTSIDE); + __Pyx_INCREF(__pyx_n_s_CDL3STARSINSOUTH); + __Pyx_GIVEREF(__pyx_n_s_CDL3STARSINSOUTH); + PyList_SET_ITEM(__pyx_t_3, 22, __pyx_n_s_CDL3STARSINSOUTH); + __Pyx_INCREF(__pyx_n_s_CDL3WHITESOLDIERS); + __Pyx_GIVEREF(__pyx_n_s_CDL3WHITESOLDIERS); + PyList_SET_ITEM(__pyx_t_3, 23, __pyx_n_s_CDL3WHITESOLDIERS); + __Pyx_INCREF(__pyx_n_s_CDLABANDONEDBABY); + __Pyx_GIVEREF(__pyx_n_s_CDLABANDONEDBABY); + PyList_SET_ITEM(__pyx_t_3, 24, __pyx_n_s_CDLABANDONEDBABY); + __Pyx_INCREF(__pyx_n_s_CDLADVANCEBLOCK); + __Pyx_GIVEREF(__pyx_n_s_CDLADVANCEBLOCK); + PyList_SET_ITEM(__pyx_t_3, 25, __pyx_n_s_CDLADVANCEBLOCK); + __Pyx_INCREF(__pyx_n_s_CDLBELTHOLD); + __Pyx_GIVEREF(__pyx_n_s_CDLBELTHOLD); + PyList_SET_ITEM(__pyx_t_3, 26, __pyx_n_s_CDLBELTHOLD); + __Pyx_INCREF(__pyx_n_s_CDLBREAKAWAY); + __Pyx_GIVEREF(__pyx_n_s_CDLBREAKAWAY); + PyList_SET_ITEM(__pyx_t_3, 27, __pyx_n_s_CDLBREAKAWAY); + __Pyx_INCREF(__pyx_n_s_CDLCLOSINGMARUBOZU); + __Pyx_GIVEREF(__pyx_n_s_CDLCLOSINGMARUBOZU); + PyList_SET_ITEM(__pyx_t_3, 28, __pyx_n_s_CDLCLOSINGMARUBOZU); + __Pyx_INCREF(__pyx_n_s_CDLCONCEALBABYSWALL); + __Pyx_GIVEREF(__pyx_n_s_CDLCONCEALBABYSWALL); + PyList_SET_ITEM(__pyx_t_3, 29, __pyx_n_s_CDLCONCEALBABYSWALL); + __Pyx_INCREF(__pyx_n_s_CDLCOUNTERATTACK); + __Pyx_GIVEREF(__pyx_n_s_CDLCOUNTERATTACK); + PyList_SET_ITEM(__pyx_t_3, 30, __pyx_n_s_CDLCOUNTERATTACK); + __Pyx_INCREF(__pyx_n_s_CDLDARKCLOUDCOVER); + __Pyx_GIVEREF(__pyx_n_s_CDLDARKCLOUDCOVER); + PyList_SET_ITEM(__pyx_t_3, 31, __pyx_n_s_CDLDARKCLOUDCOVER); + __Pyx_INCREF(__pyx_n_s_CDLDOJI); + __Pyx_GIVEREF(__pyx_n_s_CDLDOJI); + PyList_SET_ITEM(__pyx_t_3, 32, __pyx_n_s_CDLDOJI); + __Pyx_INCREF(__pyx_n_s_CDLDOJISTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLDOJISTAR); + PyList_SET_ITEM(__pyx_t_3, 33, __pyx_n_s_CDLDOJISTAR); + __Pyx_INCREF(__pyx_n_s_CDLDRAGONFLYDOJI); + __Pyx_GIVEREF(__pyx_n_s_CDLDRAGONFLYDOJI); + PyList_SET_ITEM(__pyx_t_3, 34, __pyx_n_s_CDLDRAGONFLYDOJI); + __Pyx_INCREF(__pyx_n_s_CDLENGULFING); + __Pyx_GIVEREF(__pyx_n_s_CDLENGULFING); + PyList_SET_ITEM(__pyx_t_3, 35, __pyx_n_s_CDLENGULFING); + __Pyx_INCREF(__pyx_n_s_CDLEVENINGDOJISTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGDOJISTAR); + PyList_SET_ITEM(__pyx_t_3, 36, __pyx_n_s_CDLEVENINGDOJISTAR); + __Pyx_INCREF(__pyx_n_s_CDLEVENINGSTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGSTAR); + PyList_SET_ITEM(__pyx_t_3, 37, __pyx_n_s_CDLEVENINGSTAR); + __Pyx_INCREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); + __Pyx_GIVEREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); + PyList_SET_ITEM(__pyx_t_3, 38, __pyx_n_s_CDLGAPSIDESIDEWHITE); + __Pyx_INCREF(__pyx_n_s_CDLGRAVESTONEDOJI); + __Pyx_GIVEREF(__pyx_n_s_CDLGRAVESTONEDOJI); + PyList_SET_ITEM(__pyx_t_3, 39, __pyx_n_s_CDLGRAVESTONEDOJI); + __Pyx_INCREF(__pyx_n_s_CDLHAMMER); + __Pyx_GIVEREF(__pyx_n_s_CDLHAMMER); + PyList_SET_ITEM(__pyx_t_3, 40, __pyx_n_s_CDLHAMMER); + __Pyx_INCREF(__pyx_n_s_CDLHANGINGMAN); + __Pyx_GIVEREF(__pyx_n_s_CDLHANGINGMAN); + PyList_SET_ITEM(__pyx_t_3, 41, __pyx_n_s_CDLHANGINGMAN); + __Pyx_INCREF(__pyx_n_s_CDLHARAMI); + __Pyx_GIVEREF(__pyx_n_s_CDLHARAMI); + PyList_SET_ITEM(__pyx_t_3, 42, __pyx_n_s_CDLHARAMI); + __Pyx_INCREF(__pyx_n_s_CDLHARAMICROSS); + __Pyx_GIVEREF(__pyx_n_s_CDLHARAMICROSS); + PyList_SET_ITEM(__pyx_t_3, 43, __pyx_n_s_CDLHARAMICROSS); + __Pyx_INCREF(__pyx_n_s_CDLHIGHWAVE); + __Pyx_GIVEREF(__pyx_n_s_CDLHIGHWAVE); + PyList_SET_ITEM(__pyx_t_3, 44, __pyx_n_s_CDLHIGHWAVE); + __Pyx_INCREF(__pyx_n_s_CDLHIKKAKE); + __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKE); + PyList_SET_ITEM(__pyx_t_3, 45, __pyx_n_s_CDLHIKKAKE); + __Pyx_INCREF(__pyx_n_s_CDLHIKKAKEMOD); + __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKEMOD); + PyList_SET_ITEM(__pyx_t_3, 46, __pyx_n_s_CDLHIKKAKEMOD); + __Pyx_INCREF(__pyx_n_s_CDLHOMINGPIGEON); + __Pyx_GIVEREF(__pyx_n_s_CDLHOMINGPIGEON); + PyList_SET_ITEM(__pyx_t_3, 47, __pyx_n_s_CDLHOMINGPIGEON); + __Pyx_INCREF(__pyx_n_s_CDLIDENTICAL3CROWS); + __Pyx_GIVEREF(__pyx_n_s_CDLIDENTICAL3CROWS); + PyList_SET_ITEM(__pyx_t_3, 48, __pyx_n_s_CDLIDENTICAL3CROWS); + __Pyx_INCREF(__pyx_n_s_CDLINNECK); + __Pyx_GIVEREF(__pyx_n_s_CDLINNECK); + PyList_SET_ITEM(__pyx_t_3, 49, __pyx_n_s_CDLINNECK); + __Pyx_INCREF(__pyx_n_s_CDLINVERTEDHAMMER); + __Pyx_GIVEREF(__pyx_n_s_CDLINVERTEDHAMMER); + PyList_SET_ITEM(__pyx_t_3, 50, __pyx_n_s_CDLINVERTEDHAMMER); + __Pyx_INCREF(__pyx_n_s_CDLKICKING); + __Pyx_GIVEREF(__pyx_n_s_CDLKICKING); + PyList_SET_ITEM(__pyx_t_3, 51, __pyx_n_s_CDLKICKING); + __Pyx_INCREF(__pyx_n_s_CDLKICKINGBYLENGTH); + __Pyx_GIVEREF(__pyx_n_s_CDLKICKINGBYLENGTH); + PyList_SET_ITEM(__pyx_t_3, 52, __pyx_n_s_CDLKICKINGBYLENGTH); + __Pyx_INCREF(__pyx_n_s_CDLLADDERBOTTOM); + __Pyx_GIVEREF(__pyx_n_s_CDLLADDERBOTTOM); + PyList_SET_ITEM(__pyx_t_3, 53, __pyx_n_s_CDLLADDERBOTTOM); + __Pyx_INCREF(__pyx_n_s_CDLLONGLEGGEDDOJI); + __Pyx_GIVEREF(__pyx_n_s_CDLLONGLEGGEDDOJI); + PyList_SET_ITEM(__pyx_t_3, 54, __pyx_n_s_CDLLONGLEGGEDDOJI); + __Pyx_INCREF(__pyx_n_s_CDLLONGLINE); + __Pyx_GIVEREF(__pyx_n_s_CDLLONGLINE); + PyList_SET_ITEM(__pyx_t_3, 55, __pyx_n_s_CDLLONGLINE); + __Pyx_INCREF(__pyx_n_s_CDLMARUBOZU); + __Pyx_GIVEREF(__pyx_n_s_CDLMARUBOZU); + PyList_SET_ITEM(__pyx_t_3, 56, __pyx_n_s_CDLMARUBOZU); + __Pyx_INCREF(__pyx_n_s_CDLMATCHINGLOW); + __Pyx_GIVEREF(__pyx_n_s_CDLMATCHINGLOW); + PyList_SET_ITEM(__pyx_t_3, 57, __pyx_n_s_CDLMATCHINGLOW); + __Pyx_INCREF(__pyx_n_s_CDLMATHOLD); + __Pyx_GIVEREF(__pyx_n_s_CDLMATHOLD); + PyList_SET_ITEM(__pyx_t_3, 58, __pyx_n_s_CDLMATHOLD); + __Pyx_INCREF(__pyx_n_s_CDLMORNINGDOJISTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGDOJISTAR); + PyList_SET_ITEM(__pyx_t_3, 59, __pyx_n_s_CDLMORNINGDOJISTAR); + __Pyx_INCREF(__pyx_n_s_CDLMORNINGSTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGSTAR); + PyList_SET_ITEM(__pyx_t_3, 60, __pyx_n_s_CDLMORNINGSTAR); + __Pyx_INCREF(__pyx_n_s_CDLONNECK); + __Pyx_GIVEREF(__pyx_n_s_CDLONNECK); + PyList_SET_ITEM(__pyx_t_3, 61, __pyx_n_s_CDLONNECK); + __Pyx_INCREF(__pyx_n_s_CDLPIERCING); + __Pyx_GIVEREF(__pyx_n_s_CDLPIERCING); + PyList_SET_ITEM(__pyx_t_3, 62, __pyx_n_s_CDLPIERCING); + __Pyx_INCREF(__pyx_n_s_CDLRICKSHAWMAN); + __Pyx_GIVEREF(__pyx_n_s_CDLRICKSHAWMAN); + PyList_SET_ITEM(__pyx_t_3, 63, __pyx_n_s_CDLRICKSHAWMAN); + __Pyx_INCREF(__pyx_n_s_CDLRISEFALL3METHODS); + __Pyx_GIVEREF(__pyx_n_s_CDLRISEFALL3METHODS); + PyList_SET_ITEM(__pyx_t_3, 64, __pyx_n_s_CDLRISEFALL3METHODS); + __Pyx_INCREF(__pyx_n_s_CDLSEPARATINGLINES); + __Pyx_GIVEREF(__pyx_n_s_CDLSEPARATINGLINES); + PyList_SET_ITEM(__pyx_t_3, 65, __pyx_n_s_CDLSEPARATINGLINES); + __Pyx_INCREF(__pyx_n_s_CDLSHOOTINGSTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLSHOOTINGSTAR); + PyList_SET_ITEM(__pyx_t_3, 66, __pyx_n_s_CDLSHOOTINGSTAR); + __Pyx_INCREF(__pyx_n_s_CDLSHORTLINE); + __Pyx_GIVEREF(__pyx_n_s_CDLSHORTLINE); + PyList_SET_ITEM(__pyx_t_3, 67, __pyx_n_s_CDLSHORTLINE); + __Pyx_INCREF(__pyx_n_s_CDLSPINNINGTOP); + __Pyx_GIVEREF(__pyx_n_s_CDLSPINNINGTOP); + PyList_SET_ITEM(__pyx_t_3, 68, __pyx_n_s_CDLSPINNINGTOP); + __Pyx_INCREF(__pyx_n_s_CDLSTALLEDPATTERN); + __Pyx_GIVEREF(__pyx_n_s_CDLSTALLEDPATTERN); + PyList_SET_ITEM(__pyx_t_3, 69, __pyx_n_s_CDLSTALLEDPATTERN); + __Pyx_INCREF(__pyx_n_s_CDLSTICKSANDWICH); + __Pyx_GIVEREF(__pyx_n_s_CDLSTICKSANDWICH); + PyList_SET_ITEM(__pyx_t_3, 70, __pyx_n_s_CDLSTICKSANDWICH); + __Pyx_INCREF(__pyx_n_s_CDLTAKURI); + __Pyx_GIVEREF(__pyx_n_s_CDLTAKURI); + PyList_SET_ITEM(__pyx_t_3, 71, __pyx_n_s_CDLTAKURI); + __Pyx_INCREF(__pyx_n_s_CDLTASUKIGAP); + __Pyx_GIVEREF(__pyx_n_s_CDLTASUKIGAP); + PyList_SET_ITEM(__pyx_t_3, 72, __pyx_n_s_CDLTASUKIGAP); + __Pyx_INCREF(__pyx_n_s_CDLTHRUSTING); + __Pyx_GIVEREF(__pyx_n_s_CDLTHRUSTING); + PyList_SET_ITEM(__pyx_t_3, 73, __pyx_n_s_CDLTHRUSTING); + __Pyx_INCREF(__pyx_n_s_CDLTRISTAR); + __Pyx_GIVEREF(__pyx_n_s_CDLTRISTAR); + PyList_SET_ITEM(__pyx_t_3, 74, __pyx_n_s_CDLTRISTAR); + __Pyx_INCREF(__pyx_n_s_CDLUNIQUE3RIVER); + __Pyx_GIVEREF(__pyx_n_s_CDLUNIQUE3RIVER); + PyList_SET_ITEM(__pyx_t_3, 75, __pyx_n_s_CDLUNIQUE3RIVER); + __Pyx_INCREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); + __Pyx_GIVEREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); + PyList_SET_ITEM(__pyx_t_3, 76, __pyx_n_s_CDLUPSIDEGAP2CROWS); + __Pyx_INCREF(__pyx_n_s_CDLXSIDEGAP3METHODS); + __Pyx_GIVEREF(__pyx_n_s_CDLXSIDEGAP3METHODS); + PyList_SET_ITEM(__pyx_t_3, 77, __pyx_n_s_CDLXSIDEGAP3METHODS); + __Pyx_INCREF(__pyx_n_s_CEIL); + __Pyx_GIVEREF(__pyx_n_s_CEIL); + PyList_SET_ITEM(__pyx_t_3, 78, __pyx_n_s_CEIL); + __Pyx_INCREF(__pyx_n_s_CMO); + __Pyx_GIVEREF(__pyx_n_s_CMO); + PyList_SET_ITEM(__pyx_t_3, 79, __pyx_n_s_CMO); + __Pyx_INCREF(__pyx_n_s_CORREL); + __Pyx_GIVEREF(__pyx_n_s_CORREL); + PyList_SET_ITEM(__pyx_t_3, 80, __pyx_n_s_CORREL); + __Pyx_INCREF(__pyx_n_s_COS); + __Pyx_GIVEREF(__pyx_n_s_COS); + PyList_SET_ITEM(__pyx_t_3, 81, __pyx_n_s_COS); + __Pyx_INCREF(__pyx_n_s_COSH); + __Pyx_GIVEREF(__pyx_n_s_COSH); + PyList_SET_ITEM(__pyx_t_3, 82, __pyx_n_s_COSH); + __Pyx_INCREF(__pyx_n_s_DEMA); + __Pyx_GIVEREF(__pyx_n_s_DEMA); + PyList_SET_ITEM(__pyx_t_3, 83, __pyx_n_s_DEMA); + __Pyx_INCREF(__pyx_n_s_DIV); + __Pyx_GIVEREF(__pyx_n_s_DIV); + PyList_SET_ITEM(__pyx_t_3, 84, __pyx_n_s_DIV); + __Pyx_INCREF(__pyx_n_s_DX); + __Pyx_GIVEREF(__pyx_n_s_DX); + PyList_SET_ITEM(__pyx_t_3, 85, __pyx_n_s_DX); + __Pyx_INCREF(__pyx_n_s_EMA); + __Pyx_GIVEREF(__pyx_n_s_EMA); + PyList_SET_ITEM(__pyx_t_3, 86, __pyx_n_s_EMA); + __Pyx_INCREF(__pyx_n_s_EXP); + __Pyx_GIVEREF(__pyx_n_s_EXP); + PyList_SET_ITEM(__pyx_t_3, 87, __pyx_n_s_EXP); + __Pyx_INCREF(__pyx_n_s_FLOOR); + __Pyx_GIVEREF(__pyx_n_s_FLOOR); + PyList_SET_ITEM(__pyx_t_3, 88, __pyx_n_s_FLOOR); + __Pyx_INCREF(__pyx_n_s_HT_DCPERIOD); + __Pyx_GIVEREF(__pyx_n_s_HT_DCPERIOD); + PyList_SET_ITEM(__pyx_t_3, 89, __pyx_n_s_HT_DCPERIOD); + __Pyx_INCREF(__pyx_n_s_HT_DCPHASE); + __Pyx_GIVEREF(__pyx_n_s_HT_DCPHASE); + PyList_SET_ITEM(__pyx_t_3, 90, __pyx_n_s_HT_DCPHASE); + __Pyx_INCREF(__pyx_n_s_HT_PHASOR); + __Pyx_GIVEREF(__pyx_n_s_HT_PHASOR); + PyList_SET_ITEM(__pyx_t_3, 91, __pyx_n_s_HT_PHASOR); + __Pyx_INCREF(__pyx_n_s_HT_SINE); + __Pyx_GIVEREF(__pyx_n_s_HT_SINE); + PyList_SET_ITEM(__pyx_t_3, 92, __pyx_n_s_HT_SINE); + __Pyx_INCREF(__pyx_n_s_HT_TRENDLINE); + __Pyx_GIVEREF(__pyx_n_s_HT_TRENDLINE); + PyList_SET_ITEM(__pyx_t_3, 93, __pyx_n_s_HT_TRENDLINE); + __Pyx_INCREF(__pyx_n_s_HT_TRENDMODE); + __Pyx_GIVEREF(__pyx_n_s_HT_TRENDMODE); + PyList_SET_ITEM(__pyx_t_3, 94, __pyx_n_s_HT_TRENDMODE); + __Pyx_INCREF(__pyx_n_s_KAMA); + __Pyx_GIVEREF(__pyx_n_s_KAMA); + PyList_SET_ITEM(__pyx_t_3, 95, __pyx_n_s_KAMA); + __Pyx_INCREF(__pyx_n_s_LINEARREG); + __Pyx_GIVEREF(__pyx_n_s_LINEARREG); + PyList_SET_ITEM(__pyx_t_3, 96, __pyx_n_s_LINEARREG); + __Pyx_INCREF(__pyx_n_s_LINEARREG_ANGLE); + __Pyx_GIVEREF(__pyx_n_s_LINEARREG_ANGLE); + PyList_SET_ITEM(__pyx_t_3, 97, __pyx_n_s_LINEARREG_ANGLE); + __Pyx_INCREF(__pyx_n_s_LINEARREG_INTERCEPT); + __Pyx_GIVEREF(__pyx_n_s_LINEARREG_INTERCEPT); + PyList_SET_ITEM(__pyx_t_3, 98, __pyx_n_s_LINEARREG_INTERCEPT); + __Pyx_INCREF(__pyx_n_s_LINEARREG_SLOPE); + __Pyx_GIVEREF(__pyx_n_s_LINEARREG_SLOPE); + PyList_SET_ITEM(__pyx_t_3, 99, __pyx_n_s_LINEARREG_SLOPE); + __Pyx_INCREF(__pyx_n_s_LN); + __Pyx_GIVEREF(__pyx_n_s_LN); + PyList_SET_ITEM(__pyx_t_3, 100, __pyx_n_s_LN); + __Pyx_INCREF(__pyx_n_s_LOG10); + __Pyx_GIVEREF(__pyx_n_s_LOG10); + PyList_SET_ITEM(__pyx_t_3, 101, __pyx_n_s_LOG10); + __Pyx_INCREF(__pyx_n_s_MA); + __Pyx_GIVEREF(__pyx_n_s_MA); + PyList_SET_ITEM(__pyx_t_3, 102, __pyx_n_s_MA); + __Pyx_INCREF(__pyx_n_s_MACD); + __Pyx_GIVEREF(__pyx_n_s_MACD); + PyList_SET_ITEM(__pyx_t_3, 103, __pyx_n_s_MACD); + __Pyx_INCREF(__pyx_n_s_MACDEXT); + __Pyx_GIVEREF(__pyx_n_s_MACDEXT); + PyList_SET_ITEM(__pyx_t_3, 104, __pyx_n_s_MACDEXT); + __Pyx_INCREF(__pyx_n_s_MACDFIX); + __Pyx_GIVEREF(__pyx_n_s_MACDFIX); + PyList_SET_ITEM(__pyx_t_3, 105, __pyx_n_s_MACDFIX); + __Pyx_INCREF(__pyx_n_s_MAMA); + __Pyx_GIVEREF(__pyx_n_s_MAMA); + PyList_SET_ITEM(__pyx_t_3, 106, __pyx_n_s_MAMA); + __Pyx_INCREF(__pyx_n_s_MAVP); + __Pyx_GIVEREF(__pyx_n_s_MAVP); + PyList_SET_ITEM(__pyx_t_3, 107, __pyx_n_s_MAVP); + __Pyx_INCREF(__pyx_n_s_MAX); + __Pyx_GIVEREF(__pyx_n_s_MAX); + PyList_SET_ITEM(__pyx_t_3, 108, __pyx_n_s_MAX); + __Pyx_INCREF(__pyx_n_s_MAXINDEX); + __Pyx_GIVEREF(__pyx_n_s_MAXINDEX); + PyList_SET_ITEM(__pyx_t_3, 109, __pyx_n_s_MAXINDEX); + __Pyx_INCREF(__pyx_n_s_MEDPRICE); + __Pyx_GIVEREF(__pyx_n_s_MEDPRICE); + PyList_SET_ITEM(__pyx_t_3, 110, __pyx_n_s_MEDPRICE); + __Pyx_INCREF(__pyx_n_s_MFI); + __Pyx_GIVEREF(__pyx_n_s_MFI); + PyList_SET_ITEM(__pyx_t_3, 111, __pyx_n_s_MFI); + __Pyx_INCREF(__pyx_n_s_MIDPOINT); + __Pyx_GIVEREF(__pyx_n_s_MIDPOINT); + PyList_SET_ITEM(__pyx_t_3, 112, __pyx_n_s_MIDPOINT); + __Pyx_INCREF(__pyx_n_s_MIDPRICE); + __Pyx_GIVEREF(__pyx_n_s_MIDPRICE); + PyList_SET_ITEM(__pyx_t_3, 113, __pyx_n_s_MIDPRICE); + __Pyx_INCREF(__pyx_n_s_MIN); + __Pyx_GIVEREF(__pyx_n_s_MIN); + PyList_SET_ITEM(__pyx_t_3, 114, __pyx_n_s_MIN); + __Pyx_INCREF(__pyx_n_s_MININDEX); + __Pyx_GIVEREF(__pyx_n_s_MININDEX); + PyList_SET_ITEM(__pyx_t_3, 115, __pyx_n_s_MININDEX); + __Pyx_INCREF(__pyx_n_s_MINMAX); + __Pyx_GIVEREF(__pyx_n_s_MINMAX); + PyList_SET_ITEM(__pyx_t_3, 116, __pyx_n_s_MINMAX); + __Pyx_INCREF(__pyx_n_s_MINMAXINDEX); + __Pyx_GIVEREF(__pyx_n_s_MINMAXINDEX); + PyList_SET_ITEM(__pyx_t_3, 117, __pyx_n_s_MINMAXINDEX); + __Pyx_INCREF(__pyx_n_s_MINUS_DI); + __Pyx_GIVEREF(__pyx_n_s_MINUS_DI); + PyList_SET_ITEM(__pyx_t_3, 118, __pyx_n_s_MINUS_DI); + __Pyx_INCREF(__pyx_n_s_MINUS_DM); + __Pyx_GIVEREF(__pyx_n_s_MINUS_DM); + PyList_SET_ITEM(__pyx_t_3, 119, __pyx_n_s_MINUS_DM); + __Pyx_INCREF(__pyx_n_s_MOM); + __Pyx_GIVEREF(__pyx_n_s_MOM); + PyList_SET_ITEM(__pyx_t_3, 120, __pyx_n_s_MOM); + __Pyx_INCREF(__pyx_n_s_MULT); + __Pyx_GIVEREF(__pyx_n_s_MULT); + PyList_SET_ITEM(__pyx_t_3, 121, __pyx_n_s_MULT); + __Pyx_INCREF(__pyx_n_s_NATR); + __Pyx_GIVEREF(__pyx_n_s_NATR); + PyList_SET_ITEM(__pyx_t_3, 122, __pyx_n_s_NATR); + __Pyx_INCREF(__pyx_n_s_OBV); + __Pyx_GIVEREF(__pyx_n_s_OBV); + PyList_SET_ITEM(__pyx_t_3, 123, __pyx_n_s_OBV); + __Pyx_INCREF(__pyx_n_s_PLUS_DI); + __Pyx_GIVEREF(__pyx_n_s_PLUS_DI); + PyList_SET_ITEM(__pyx_t_3, 124, __pyx_n_s_PLUS_DI); + __Pyx_INCREF(__pyx_n_s_PLUS_DM); + __Pyx_GIVEREF(__pyx_n_s_PLUS_DM); + PyList_SET_ITEM(__pyx_t_3, 125, __pyx_n_s_PLUS_DM); + __Pyx_INCREF(__pyx_n_s_PPO); + __Pyx_GIVEREF(__pyx_n_s_PPO); + PyList_SET_ITEM(__pyx_t_3, 126, __pyx_n_s_PPO); + __Pyx_INCREF(__pyx_n_s_ROC); + __Pyx_GIVEREF(__pyx_n_s_ROC); + PyList_SET_ITEM(__pyx_t_3, 127, __pyx_n_s_ROC); + __Pyx_INCREF(__pyx_n_s_ROCP); + __Pyx_GIVEREF(__pyx_n_s_ROCP); + PyList_SET_ITEM(__pyx_t_3, 128, __pyx_n_s_ROCP); + __Pyx_INCREF(__pyx_n_s_ROCR); + __Pyx_GIVEREF(__pyx_n_s_ROCR); + PyList_SET_ITEM(__pyx_t_3, 129, __pyx_n_s_ROCR); + __Pyx_INCREF(__pyx_n_s_ROCR100); + __Pyx_GIVEREF(__pyx_n_s_ROCR100); + PyList_SET_ITEM(__pyx_t_3, 130, __pyx_n_s_ROCR100); + __Pyx_INCREF(__pyx_n_s_RSI); + __Pyx_GIVEREF(__pyx_n_s_RSI); + PyList_SET_ITEM(__pyx_t_3, 131, __pyx_n_s_RSI); + __Pyx_INCREF(__pyx_n_s_SAR); + __Pyx_GIVEREF(__pyx_n_s_SAR); + PyList_SET_ITEM(__pyx_t_3, 132, __pyx_n_s_SAR); + __Pyx_INCREF(__pyx_n_s_SAREXT); + __Pyx_GIVEREF(__pyx_n_s_SAREXT); + PyList_SET_ITEM(__pyx_t_3, 133, __pyx_n_s_SAREXT); + __Pyx_INCREF(__pyx_n_s_SIN); + __Pyx_GIVEREF(__pyx_n_s_SIN); + PyList_SET_ITEM(__pyx_t_3, 134, __pyx_n_s_SIN); + __Pyx_INCREF(__pyx_n_s_SINH); + __Pyx_GIVEREF(__pyx_n_s_SINH); + PyList_SET_ITEM(__pyx_t_3, 135, __pyx_n_s_SINH); + __Pyx_INCREF(__pyx_n_s_SMA); + __Pyx_GIVEREF(__pyx_n_s_SMA); + PyList_SET_ITEM(__pyx_t_3, 136, __pyx_n_s_SMA); + __Pyx_INCREF(__pyx_n_s_SQRT); + __Pyx_GIVEREF(__pyx_n_s_SQRT); + PyList_SET_ITEM(__pyx_t_3, 137, __pyx_n_s_SQRT); + __Pyx_INCREF(__pyx_n_s_STDDEV); + __Pyx_GIVEREF(__pyx_n_s_STDDEV); + PyList_SET_ITEM(__pyx_t_3, 138, __pyx_n_s_STDDEV); + __Pyx_INCREF(__pyx_n_s_STOCH); + __Pyx_GIVEREF(__pyx_n_s_STOCH); + PyList_SET_ITEM(__pyx_t_3, 139, __pyx_n_s_STOCH); + __Pyx_INCREF(__pyx_n_s_STOCHF); + __Pyx_GIVEREF(__pyx_n_s_STOCHF); + PyList_SET_ITEM(__pyx_t_3, 140, __pyx_n_s_STOCHF); + __Pyx_INCREF(__pyx_n_s_STOCHRSI); + __Pyx_GIVEREF(__pyx_n_s_STOCHRSI); + PyList_SET_ITEM(__pyx_t_3, 141, __pyx_n_s_STOCHRSI); + __Pyx_INCREF(__pyx_n_s_SUB); + __Pyx_GIVEREF(__pyx_n_s_SUB); + PyList_SET_ITEM(__pyx_t_3, 142, __pyx_n_s_SUB); + __Pyx_INCREF(__pyx_n_s_SUM); + __Pyx_GIVEREF(__pyx_n_s_SUM); + PyList_SET_ITEM(__pyx_t_3, 143, __pyx_n_s_SUM); + __Pyx_INCREF(__pyx_n_s_T3); + __Pyx_GIVEREF(__pyx_n_s_T3); + PyList_SET_ITEM(__pyx_t_3, 144, __pyx_n_s_T3); + __Pyx_INCREF(__pyx_n_s_TAN); + __Pyx_GIVEREF(__pyx_n_s_TAN); + PyList_SET_ITEM(__pyx_t_3, 145, __pyx_n_s_TAN); + __Pyx_INCREF(__pyx_n_s_TANH); + __Pyx_GIVEREF(__pyx_n_s_TANH); + PyList_SET_ITEM(__pyx_t_3, 146, __pyx_n_s_TANH); + __Pyx_INCREF(__pyx_n_s_TEMA); + __Pyx_GIVEREF(__pyx_n_s_TEMA); + PyList_SET_ITEM(__pyx_t_3, 147, __pyx_n_s_TEMA); + __Pyx_INCREF(__pyx_n_s_TRANGE); + __Pyx_GIVEREF(__pyx_n_s_TRANGE); + PyList_SET_ITEM(__pyx_t_3, 148, __pyx_n_s_TRANGE); + __Pyx_INCREF(__pyx_n_s_TRIMA); + __Pyx_GIVEREF(__pyx_n_s_TRIMA); + PyList_SET_ITEM(__pyx_t_3, 149, __pyx_n_s_TRIMA); + __Pyx_INCREF(__pyx_n_s_TRIX); + __Pyx_GIVEREF(__pyx_n_s_TRIX); + PyList_SET_ITEM(__pyx_t_3, 150, __pyx_n_s_TRIX); + __Pyx_INCREF(__pyx_n_s_TSF); + __Pyx_GIVEREF(__pyx_n_s_TSF); + PyList_SET_ITEM(__pyx_t_3, 151, __pyx_n_s_TSF); + __Pyx_INCREF(__pyx_n_s_TYPPRICE); + __Pyx_GIVEREF(__pyx_n_s_TYPPRICE); + PyList_SET_ITEM(__pyx_t_3, 152, __pyx_n_s_TYPPRICE); + __Pyx_INCREF(__pyx_n_s_ULTOSC); + __Pyx_GIVEREF(__pyx_n_s_ULTOSC); + PyList_SET_ITEM(__pyx_t_3, 153, __pyx_n_s_ULTOSC); + __Pyx_INCREF(__pyx_n_s_VAR); + __Pyx_GIVEREF(__pyx_n_s_VAR); + PyList_SET_ITEM(__pyx_t_3, 154, __pyx_n_s_VAR); + __Pyx_INCREF(__pyx_n_s_WCLPRICE); + __Pyx_GIVEREF(__pyx_n_s_WCLPRICE); + PyList_SET_ITEM(__pyx_t_3, 155, __pyx_n_s_WCLPRICE); + __Pyx_INCREF(__pyx_n_s_WILLR); + __Pyx_GIVEREF(__pyx_n_s_WILLR); + PyList_SET_ITEM(__pyx_t_3, 156, __pyx_n_s_WILLR); + __Pyx_INCREF(__pyx_n_s_WMA); + __Pyx_GIVEREF(__pyx_n_s_WMA); + PyList_SET_ITEM(__pyx_t_3, 157, __pyx_n_s_WMA); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_FUNCTION_NAMES, __pyx_t_3) < 0) __PYX_ERR(2, 11246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":4 + * This file Copyright (c) 2013 Brian A Cappello + * ''' + * import math # <<<<<<<<<<<<<< + * try: + * from collections import OrderedDict + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_3) < 0) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":5 + * ''' + * import math + * try: # <<<<<<<<<<<<<< + * from collections import OrderedDict + * except ImportError: # handle python 2.6 and earlier + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + /*try:*/ { + + /* "talib/_abstract.pxi":6 + * import math + * try: + * from collections import OrderedDict # <<<<<<<<<<<<<< + * except ImportError: # handle python 2.6 and earlier + * from ordereddict import OrderedDict + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_OrderedDict); + __Pyx_GIVEREF(__pyx_n_s_OrderedDict); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_OrderedDict); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_3, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_3) < 0) __PYX_ERR(1, 6, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":5 + * ''' + * import math + * try: # <<<<<<<<<<<<<< + * from collections import OrderedDict + * except ImportError: # handle python 2.6 and earlier + */ + } + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":7 + * try: + * from collections import OrderedDict + * except ImportError: # handle python 2.6 and earlier # <<<<<<<<<<<<<< + * from ordereddict import OrderedDict + * from cython.operator cimport dereference as deref + */ + __pyx_t_21 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_21) { + __Pyx_AddTraceback("talib._ta_lib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(1, 7, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "talib/_abstract.pxi":8 + * from collections import OrderedDict + * except ImportError: # handle python 2.6 and earlier + * from ordereddict import OrderedDict # <<<<<<<<<<<<<< + * from cython.operator cimport dereference as deref + * import numpy + */ + __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 8, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_n_s_OrderedDict); + __Pyx_GIVEREF(__pyx_n_s_OrderedDict); + PyList_SET_ITEM(__pyx_t_13, 0, __pyx_n_s_OrderedDict); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_ordereddict, __pyx_t_13, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 8, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_13) < 0) __PYX_ERR(1, 8, __pyx_L8_except_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "talib/_abstract.pxi":5 + * ''' + * import math + * try: # <<<<<<<<<<<<<< + * from collections import OrderedDict + * except ImportError: # handle python 2.6 and earlier + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + __pyx_L13_try_end:; + } + + /* "talib/_abstract.pxi":10 + * from ordereddict import OrderedDict + * from cython.operator cimport dereference as deref + * import numpy # <<<<<<<<<<<<<< + * import sys + * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_2) < 0) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":11 + * from cython.operator cimport dereference as deref + * import numpy + * import sys # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":17 + * # NOTE: _ta_check_success, MA_Type is defined in _common.pxi + * + * lib.TA_Initialize() # <<<<<<<<<<<<<< + * + * + */ + TA_Initialize(); + + /* "talib/_abstract.pxi":20 + * + * + * __INPUT_ARRAYS_DEFAULTS = {'open': None, # <<<<<<<<<<<<<< + * 'high': None, + * 'low': None, + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_open, Py_None) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + + /* "talib/_abstract.pxi":21 + * + * __INPUT_ARRAYS_DEFAULTS = {'open': None, + * 'high': None, # <<<<<<<<<<<<<< + * 'low': None, + * 'close': None, + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_high, Py_None) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + + /* "talib/_abstract.pxi":22 + * __INPUT_ARRAYS_DEFAULTS = {'open': None, + * 'high': None, + * 'low': None, # <<<<<<<<<<<<<< + * 'close': None, + * 'volume': None, + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_low, Py_None) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + + /* "talib/_abstract.pxi":23 + * 'high': None, + * 'low': None, + * 'close': None, # <<<<<<<<<<<<<< + * 'volume': None, + * } + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_close, Py_None) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + + /* "talib/_abstract.pxi":24 + * 'low': None, + * 'close': None, + * 'volume': None, # <<<<<<<<<<<<<< + * } + * + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_volume, Py_None) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_DEFAULTS, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":28 + * + * # lookup for TALIB input parameters which don't define expected price series inputs + * __INPUT_PRICE_SERIES_DEFAULTS = {'price': 'close', # <<<<<<<<<<<<<< + * 'price0': 'high', + * 'price1': 'low', + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_price, __pyx_n_s_close) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_price0, __pyx_n_s_high) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_price1, __pyx_n_s_low) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_periods, __pyx_n_s_periods) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS, __pyx_t_2) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":35 + * + * # allow use of pandas.DataFrame for input arrays + * try: # <<<<<<<<<<<<<< + * import pandas + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_18); + /*try:*/ { + + /* "talib/_abstract.pxi":36 + * # allow use of pandas.DataFrame for input arrays + * try: + * import pandas # <<<<<<<<<<<<<< + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + * __PANDAS_DATAFRAME = pandas.DataFrame + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":37 + * try: + * import pandas + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) # <<<<<<<<<<<<<< + * __PANDAS_DATAFRAME = pandas.DataFrame + * __PANDAS_SERIES = pandas.Series + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyDict_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyDict_Type))); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":38 + * import pandas + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + * __PANDAS_DATAFRAME = pandas.DataFrame # <<<<<<<<<<<<<< + * __PANDAS_SERIES = pandas.Series + * except ImportError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 38, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_DATAFRAME, __pyx_t_3) < 0) __PYX_ERR(1, 38, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "talib/_abstract.pxi":39 + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + * __PANDAS_DATAFRAME = pandas.DataFrame + * __PANDAS_SERIES = pandas.Series # <<<<<<<<<<<<<< + * except ImportError: + * __INPUT_ARRAYS_TYPES = (dict,) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 39, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Series); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_SERIES, __pyx_t_2) < 0) __PYX_ERR(1, 39, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":35 + * + * # allow use of pandas.DataFrame for input arrays + * try: # <<<<<<<<<<<<<< + * import pandas + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + */ + } + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L23_try_end; + __pyx_L16_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "talib/_abstract.pxi":40 + * __PANDAS_DATAFRAME = pandas.DataFrame + * __PANDAS_SERIES = pandas.Series + * except ImportError: # <<<<<<<<<<<<<< + * __INPUT_ARRAYS_TYPES = (dict,) + * __PANDAS_DATAFRAME = None + */ + __pyx_t_21 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_21) { + __Pyx_AddTraceback("talib._ta_lib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(1, 40, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + + /* "talib/_abstract.pxi":41 + * __PANDAS_SERIES = pandas.Series + * except ImportError: + * __INPUT_ARRAYS_TYPES = (dict,) # <<<<<<<<<<<<<< + * __PANDAS_DATAFRAME = None + * __PANDAS_SERIES = None + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 41, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)(&PyDict_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyDict_Type))); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_t_4) < 0) __PYX_ERR(1, 41, __pyx_L18_except_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":42 + * except ImportError: + * __INPUT_ARRAYS_TYPES = (dict,) + * __PANDAS_DATAFRAME = None # <<<<<<<<<<<<<< + * __PANDAS_SERIES = None + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_DATAFRAME, Py_None) < 0) __PYX_ERR(1, 42, __pyx_L18_except_error) + + /* "talib/_abstract.pxi":43 + * __INPUT_ARRAYS_TYPES = (dict,) + * __PANDAS_DATAFRAME = None + * __PANDAS_SERIES = None # <<<<<<<<<<<<<< + * + * if sys.version >= '3': + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_SERIES, Py_None) < 0) __PYX_ERR(1, 43, __pyx_L18_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L17_exception_handled; + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + + /* "talib/_abstract.pxi":35 + * + * # allow use of pandas.DataFrame for input arrays + * try: # <<<<<<<<<<<<<< + * import pandas + * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); + goto __pyx_L1_error; + __pyx_L17_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); + __pyx_L23_try_end:; + } + + /* "talib/_abstract.pxi":45 + * __PANDAS_SERIES = None + * + * if sys.version >= '3': # <<<<<<<<<<<<<< + * + * def str2bytes(s): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_kp_s_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_22 < 0)) __PYX_ERR(1, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_22) { + + /* "talib/_abstract.pxi":47 + * if sys.version >= '3': + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return bytes(s, 'ascii') + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_327str2bytes, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2bytes, __pyx_t_1) < 0) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":50 + * return bytes(s, 'ascii') + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b.decode('ascii') + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_329bytes2str, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes2str, __pyx_t_1) < 0) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":45 + * __PANDAS_SERIES = None + * + * if sys.version >= '3': # <<<<<<<<<<<<<< + * + * def str2bytes(s): + */ + goto __pyx_L26; + } + + /* "talib/_abstract.pxi":55 + * else: + * + * def str2bytes(s): # <<<<<<<<<<<<<< + * return s + * + */ + /*else*/ { + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_331str2bytes, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2bytes, __pyx_t_1) < 0) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":58 + * return s + * + * def bytes2str(b): # <<<<<<<<<<<<<< + * return b + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_333bytes2str, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes2str, __pyx_t_1) < 0) __PYX_ERR(1, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L26:; + + /* "talib/_abstract.pxi":61 + * return b + * + * class Function(object): # <<<<<<<<<<<<<< + * """ + * This is a pythonic wrapper around TALIB's abstract interface. It is + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_Function, __pyx_n_s_Function, (PyObject *) NULL, __pyx_n_s_talib__ta_lib, __pyx_kp_s_This_is_a_pythonic_wrapper_arou); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "talib/_abstract.pxi":90 + * """ + * + * def __init__(self, function_name, func_object, *args, **kwargs): # <<<<<<<<<<<<<< + * # make sure the function_name is valid and define all of our variables + * self.__name = function_name.upper() + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_1__init__, 0, __pyx_n_s_Function___init, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2610)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":109 + * self.func_object = func_object + * + * def __initialize_function_info(self): # <<<<<<<<<<<<<< + * # function info + * self.__info = _ta_getFuncInfo(self.__name) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_3__initialize_function_info, 0, __pyx_n_s_Function___initialize_function_i, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2612)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_Function__initialize_function_i, __pyx_t_4) < 0) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":139 + * + * @property + * def info(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the function's info dict. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_5info, 0, __pyx_n_s_Function_info, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2614)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":138 + * self.__info['output_names'] = self.output_names + * + * @property # <<<<<<<<<<<<<< + * def info(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_info, __pyx_t_4) < 0) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":146 + * + * @property + * def function_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns any function flags defined for this indicator function. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_7function_flags, 0, __pyx_n_s_Function_function_flags, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2616)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":145 + * return self.__info.copy() + * + * @property # <<<<<<<<<<<<<< + * def function_flags(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_function_flags, __pyx_t_4) < 0) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":153 + * + * @property + * def output_flags(self): # <<<<<<<<<<<<<< + * """ + * Returns the flags for each output for this indicator function. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_9output_flags, 0, __pyx_n_s_Function_output_flags, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2618)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":152 + * return self.__info['function_flags'] + * + * @property # <<<<<<<<<<<<<< + * def output_flags(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_output_flags, __pyx_t_4) < 0) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":159 + * return self.__info['output_flags'].copy() + * + * def get_input_names(self): # <<<<<<<<<<<<<< + * """ + * Returns the dict of input price series names that specifies which + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_11get_input_names, 0, __pyx_n_s_Function_get_input_names, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2620)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_input_names, __pyx_t_4) < 0) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":169 + * return ret + * + * def set_input_names(self, input_names): # <<<<<<<<<<<<<< + * """ + * Sets the input price series names to use. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_13set_input_names, 0, __pyx_n_s_Function_set_input_names, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2622)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_set_input_names, __pyx_t_4) < 0) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":178 + * self.__outputs_valid = False + * + * input_names = property(get_input_names, set_input_names) # <<<<<<<<<<<<<< + * + * def get_input_arrays(self): + */ + __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_get_input_names); + if (unlikely(!__pyx_t_4)) { + PyErr_Clear(); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_input_names); + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_set_input_names); + if (unlikely(!__pyx_t_13)) { + PyErr_Clear(); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_input_names); + } + if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13); + __pyx_t_4 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_input_names, __pyx_t_13) < 0) __PYX_ERR(1, 178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "talib/_abstract.pxi":180 + * input_names = property(get_input_names, set_input_names) + * + * def get_input_arrays(self): # <<<<<<<<<<<<<< + * """ + * Returns a copy of the dict of input arrays in use. + */ + __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_15get_input_arrays, 0, __pyx_n_s_Function_get_input_arrays, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2624)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_input_arrays, __pyx_t_13) < 0) __PYX_ERR(1, 180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "talib/_abstract.pxi":186 + * return self.__input_arrays.copy() + * + * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< + * """ + * Sets the dict of input_arrays to use. Returns True/False for + */ + __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_17set_input_arrays, 0, __pyx_n_s_Function_set_input_arrays, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2626)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_set_input_arrays, __pyx_t_13) < 0) __PYX_ERR(1, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "talib/_abstract.pxi":227 + * return False + * + * input_arrays = property(get_input_arrays, set_input_arrays) # <<<<<<<<<<<<<< + * + * def get_parameters(self): + */ + __pyx_t_13 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_get_input_arrays); + if (unlikely(!__pyx_t_13)) { + PyErr_Clear(); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_input_arrays); + } + if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_set_input_arrays); + if (unlikely(!__pyx_t_12)) { + PyErr_Clear(); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_input_arrays); + } + if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12); + __pyx_t_13 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_input_arrays, __pyx_t_12) < 0) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "talib/_abstract.pxi":229 + * input_arrays = property(get_input_arrays, set_input_arrays) + * + * def get_parameters(self): # <<<<<<<<<<<<<< + * """ + * Returns the function's optional parameters and their default values. + */ + __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_19get_parameters, 0, __pyx_n_s_Function_get_parameters, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2628)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_parameters, __pyx_t_12) < 0) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "talib/_abstract.pxi":238 + * return ret + * + * def set_parameters(self, parameters): # <<<<<<<<<<<<<< + * """ + * Sets the function parameter values. + */ + __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_21set_parameters, 0, __pyx_n_s_Function_set_parameters, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2630)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_set_parameters, __pyx_t_12) < 0) __PYX_ERR(1, 238, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "talib/_abstract.pxi":247 + * self.__info['parameters'] = self.parameters + * + * parameters = property(get_parameters, set_parameters) # <<<<<<<<<<<<<< + * + * def set_function_args(self, *args, **kwargs): + */ + __pyx_t_12 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_get_parameters); + if (unlikely(!__pyx_t_12)) { + PyErr_Clear(); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_parameters); + } + if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_set_parameters); + if (unlikely(!__pyx_t_4)) { + PyErr_Clear(); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_parameters); + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4); + __pyx_t_12 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_parameters, __pyx_t_4) < 0) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":249 + * parameters = property(get_parameters, set_parameters) + * + * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_23set_function_args, 0, __pyx_n_s_Function_set_function_args, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2632)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_set_function_args, __pyx_t_4) < 0) __PYX_ERR(1, 249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":281 + * + * @property + * def lookback(self): # <<<<<<<<<<<<<< + * """ + * Returns the lookback window size for the function with the parameter + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_25lookback, 0, __pyx_n_s_Function_lookback, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2634)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":280 + * self.__outputs_valid = False + * + * @property # <<<<<<<<<<<<<< + * def lookback(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_lookback, __pyx_t_4) < 0) __PYX_ERR(1, 281, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":301 + * + * @property + * def output_names(self): # <<<<<<<<<<<<<< + * """ + * Returns a list of the output names returned by this function. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_27output_names, 0, __pyx_n_s_Function_output_names, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2636)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":300 + * return lookback + * + * @property # <<<<<<<<<<<<<< + * def output_names(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_output_names, __pyx_t_4) < 0) __PYX_ERR(1, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":311 + * + * @property + * def outputs(self): # <<<<<<<<<<<<<< + * """ + * Returns the TA function values for the currently set input_arrays and + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_29outputs, 0, __pyx_n_s_Function_outputs, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2638)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "talib/_abstract.pxi":310 + * return ret + * + * @property # <<<<<<<<<<<<<< + * def outputs(self): + * """ + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_outputs, __pyx_t_4) < 0) __PYX_ERR(1, 311, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":334 + * return ret[0] if len(ret) == 1 else ret + * + * def run(self, input_arrays=None): # <<<<<<<<<<<<<< + * """ + * run([input_arrays=None]) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_31run, 0, __pyx_n_s_Function_run, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2640)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__2641); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_run, __pyx_t_4) < 0) __PYX_ERR(1, 334, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":346 + * return self.outputs + * + * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_33__call__, 0, __pyx_n_s_Function___call, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2643)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(1, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":358 + * + * # figure out which price series names we're using for inputs + * def __input_price_series_names(self): # <<<<<<<<<<<<<< + * input_price_series_names = [] + * for input_name in self.__input_names: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_35__input_price_series_names, 0, __pyx_n_s_Function___input_price_series_na, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2645)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_Function__input_price_series_na, __pyx_t_4) < 0) __PYX_ERR(1, 358, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":369 + * return input_price_series_names + * + * def __call_function(self): # <<<<<<<<<<<<<< + * input_price_series_names = self.__input_price_series_names() + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_37__call_function, 0, __pyx_n_s_Function___call_function, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2647)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_Function__call_function, __pyx_t_4) < 0) __PYX_ERR(1, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":396 + * self.__outputs_valid = True + * + * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< + * """ + * Returns the user-set value if there is one, otherwise the default. + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_39__get_opt_input_value, 0, __pyx_n_s_Function___get_opt_input_value, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2649)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_Function__get_opt_input_value, __pyx_t_4) < 0) __PYX_ERR(1, 396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":405 + * return value + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '%s' % self.info + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_41__repr__, 0, __pyx_n_s_Function___repr, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2651)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(1, 405, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":408 + * return '%s' % self.info + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * return unicode(self.__str__()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_43__unicode__, 0, __pyx_n_s_Function___unicode, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2653)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_unicode, __pyx_t_4) < 0) __PYX_ERR(1, 408, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":411 + * return unicode(self.__str__()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_8Function_45__str__, 0, __pyx_n_s_Function___str, NULL, __pyx_n_s_talib__ta_lib, __pyx_d, ((PyObject *)__pyx_codeobj__2655)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(1, 411, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "talib/_abstract.pxi":61 + * return b + * + * class Function(object): # <<<<<<<<<<<<<< + * """ + * This is a pythonic wrapper around TALIB's abstract interface. It is + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Function, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Function, __pyx_t_4) < 0) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":425 + * # therefore recommended over using these functions directly. + * + * def _ta_getGroupTable(): # <<<<<<<<<<<<<< + * """ + * Returns the list of available TALIB function group names. *slow* + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_335_ta_getGroupTable, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getGroupTable, __pyx_t_1) < 0) __PYX_ERR(1, 425, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":437 + * return groups + * + * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< + * """ + * Returns a list of the functions for the specified group name. *slow* + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_337_ta_getFuncTable, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getFuncTable, __pyx_t_1) < 0) __PYX_ERR(1, 437, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":449 + * return functions + * + * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< + * """ + * TA-LIB provides hints for multiple flags as a bitwise-ORed int. + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_339__get_flags, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_flags, __pyx_t_1) < 0) __PYX_ERR(1, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":475 + * + * TA_FUNC_FLAGS = { + * 16777216: 'Output scale same as input', # <<<<<<<<<<<<<< + * 67108864: 'Output is over volume', + * 134217728: 'Function has an unstable period', + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_int_16777216, __pyx_kp_s_Output_scale_same_as_input) < 0) __PYX_ERR(1, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_67108864, __pyx_kp_s_Output_is_over_volume) < 0) __PYX_ERR(1, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_134217728, __pyx_kp_s_Function_has_an_unstable_period) < 0) __PYX_ERR(1, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_268435456, __pyx_kp_s_Output_is_a_candlestick) < 0) __PYX_ERR(1, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_FUNC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(1, 474, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":483 + * # when flag is 0, the function (should) work on any reasonable input ndarray + * TA_INPUT_FLAGS = { + * 1: 'open', # <<<<<<<<<<<<<< + * 2: 'high', + * 4: 'low', + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_n_s_open) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, __pyx_n_s_high) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_n_s_low) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_s_close) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, __pyx_n_s_volume) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_32, __pyx_n_s_openInterest) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_64, __pyx_n_s_timeStamp) < 0) __PYX_ERR(1, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_INPUT_FLAGS, __pyx_t_1) < 0) __PYX_ERR(1, 482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":493 + * + * TA_OUTPUT_FLAGS = { + * 1: 'Line', # <<<<<<<<<<<<<< + * 2: 'Dotted Line', + * 4: 'Dashed Line', + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_n_s_Line) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, __pyx_kp_s_Dotted_Line) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_kp_s_Dashed_Line) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_s_Dot) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, __pyx_n_s_Histogram) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_32, __pyx_kp_s_Pattern_Bool) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_64, __pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_128, __pyx_kp_s_Strength_Pattern_200_100_Bearish) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_256, __pyx_kp_s_Output_can_be_positive) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_512, __pyx_kp_s_Output_can_be_negative) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_1024, __pyx_kp_s_Output_can_be_zero) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_2048, __pyx_kp_s_Values_represent_an_upper_limit) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_4096, __pyx_kp_s_Values_represent_a_lower_limit) < 0) __PYX_ERR(1, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_OUTPUT_FLAGS, __pyx_t_1) < 0) __PYX_ERR(1, 492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":508 + * } + * + * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< + * """ + * Returns the info dict for the function. It has the following keys: name, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_341_ta_getFuncInfo, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getFuncInfo, __pyx_t_1) < 0) __PYX_ERR(1, 508, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":527 + * } + * + * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's input info dict for the given index. It has two + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_343_ta_getInputParameterInfo, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getInputParameterInfo, __pyx_t_1) < 0) __PYX_ERR(1, 527, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":548 + * } + * + * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's opt_input info dict for the given index. It has the + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_345_ta_getOptInputParameterInfo, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getOptInputParameterInfo, __pyx_t_1) < 0) __PYX_ERR(1, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":572 + * } + * + * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< + * """ + * Returns the function's output info dict for the given index. It has two + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_347_ta_getOutputParameterInfo, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getOutputParameterInfo, __pyx_t_1) < 0) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_abstract.pxi":592 + * } + * + * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< + * """ + * Returns a tuple with two outputs: defaults, a dict of parameter defaults, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_349_get_defaults_and_docs, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_defaults_and_docs, __pyx_t_1) < 0) __PYX_ERR(1, 592, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":10 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ACOS(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_351stream_ACOS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ACOS, __pyx_t_1) < 0) __PYX_ERR(3, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":44 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ AD(high, low, close, volume) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_353stream_AD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_AD, __pyx_t_1) < 0) __PYX_ERR(3, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ ADD(real0, real1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_355stream_ADD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ADD, __pyx_t_1) < 0) __PYX_ERR(3, 108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":153 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_357stream_ADOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ADOSC, __pyx_t_1) < 0) __PYX_ERR(3, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":220 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADX(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_359stream_ADX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ADX, __pyx_t_1) < 0) __PYX_ERR(3, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":276 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ADXR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_361stream_ADXR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ADXR, __pyx_t_1) < 0) __PYX_ERR(3, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":332 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_363stream_APO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_APO, __pyx_t_1) < 0) __PYX_ERR(3, 332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":370 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROON(high, low[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_365stream_AROON, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_AROON, __pyx_t_1) < 0) __PYX_ERR(3, 370, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ AROONOSC(high, low[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_367stream_AROONOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_AROONOSC, __pyx_t_1) < 0) __PYX_ERR(3, 419, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":465 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ASIN(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_369stream_ASIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ASIN, __pyx_t_1) < 0) __PYX_ERR(3, 465, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":499 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ ATAN(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_371stream_ATAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ATAN, __pyx_t_1) < 0) __PYX_ERR(3, 499, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":533 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_373stream_ATR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ATR, __pyx_t_1) < 0) __PYX_ERR(3, 533, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":589 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ AVGPRICE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_375stream_AVGPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_AVGPRICE, __pyx_t_1) < 0) __PYX_ERR(3, 589, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":653 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< + * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_377stream_BBANDS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_BBANDS, __pyx_t_1) < 0) __PYX_ERR(3, 653, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":698 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ BETA(real0, real1[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_379stream_BETA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_BETA, __pyx_t_1) < 0) __PYX_ERR(3, 698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":745 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ BOP(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_381stream_BOP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_BOP, __pyx_t_1) < 0) __PYX_ERR(3, 745, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":809 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CCI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_383stream_CCI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CCI, __pyx_t_1) < 0) __PYX_ERR(3, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":865 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL2CROWS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_385stream_CDL2CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL2CROWS, __pyx_t_1) < 0) __PYX_ERR(3, 865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":929 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3BLACKCROWS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_387stream_CDL3BLACKCROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3BLACKCROWS, __pyx_t_1) < 0) __PYX_ERR(3, 929, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":993 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3INSIDE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_389stream_CDL3INSIDE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3INSIDE, __pyx_t_1) < 0) __PYX_ERR(3, 993, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1057 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3LINESTRIKE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_391stream_CDL3LINESTRIKE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3LINESTRIKE, __pyx_t_1) < 0) __PYX_ERR(3, 1057, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1121 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3OUTSIDE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_393stream_CDL3OUTSIDE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3OUTSIDE, __pyx_t_1) < 0) __PYX_ERR(3, 1121, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1185 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3STARSINSOUTH(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_395stream_CDL3STARSINSOUTH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3STARSINSOUTH, __pyx_t_1) < 0) __PYX_ERR(3, 1185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1249 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDL3WHITESOLDIERS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_397stream_CDL3WHITESOLDIERS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDL3WHITESOLDIERS, __pyx_t_1) < 0) __PYX_ERR(3, 1249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1313 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_399stream_CDLABANDONEDBABY, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLABANDONEDBABY, __pyx_t_1) < 0) __PYX_ERR(3, 1313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1379 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLADVANCEBLOCK(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_401stream_CDLADVANCEBLOCK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLADVANCEBLOCK, __pyx_t_1) < 0) __PYX_ERR(3, 1379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1443 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBELTHOLD(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_403stream_CDLBELTHOLD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLBELTHOLD, __pyx_t_1) < 0) __PYX_ERR(3, 1443, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1507 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLBREAKAWAY(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_405stream_CDLBREAKAWAY, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLBREAKAWAY, __pyx_t_1) < 0) __PYX_ERR(3, 1507, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCLOSINGMARUBOZU(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_407stream_CDLCLOSINGMARUBOZU, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLCLOSINGMARUBOZU, __pyx_t_1) < 0) __PYX_ERR(3, 1571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1635 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCONCEALBABYSWALL(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_409stream_CDLCONCEALBABYSWALL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLCONCEALBABYSWALL, __pyx_t_1) < 0) __PYX_ERR(3, 1635, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1699 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLCOUNTERATTACK(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_411stream_CDLCOUNTERATTACK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLCOUNTERATTACK, __pyx_t_1) < 0) __PYX_ERR(3, 1699, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1763 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_413stream_CDLDARKCLOUDCOVER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLDARKCLOUDCOVER, __pyx_t_1) < 0) __PYX_ERR(3, 1763, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1829 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_415stream_CDLDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLDOJI, __pyx_t_1) < 0) __PYX_ERR(3, 1829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1893 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDOJISTAR(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_417stream_CDLDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLDOJISTAR, __pyx_t_1) < 0) __PYX_ERR(3, 1893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":1957 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLDRAGONFLYDOJI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_419stream_CDLDRAGONFLYDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLDRAGONFLYDOJI, __pyx_t_1) < 0) __PYX_ERR(3, 1957, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2021 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLENGULFING(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_421stream_CDLENGULFING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLENGULFING, __pyx_t_1) < 0) __PYX_ERR(3, 2021, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2085 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_423stream_CDLEVENINGDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLEVENINGDOJISTAR, __pyx_t_1) < 0) __PYX_ERR(3, 2085, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2151 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_425stream_CDLEVENINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLEVENINGSTAR, __pyx_t_1) < 0) __PYX_ERR(3, 2151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2217 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGAPSIDESIDEWHITE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_427stream_CDLGAPSIDESIDEWHITE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLGAPSIDESIDEWHITE, __pyx_t_1) < 0) __PYX_ERR(3, 2217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2281 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLGRAVESTONEDOJI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_429stream_CDLGRAVESTONEDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLGRAVESTONEDOJI, __pyx_t_1) < 0) __PYX_ERR(3, 2281, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2345 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHAMMER(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_431stream_CDLHAMMER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHAMMER, __pyx_t_1) < 0) __PYX_ERR(3, 2345, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2409 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHANGINGMAN(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_433stream_CDLHANGINGMAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHANGINGMAN, __pyx_t_1) < 0) __PYX_ERR(3, 2409, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2473 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_435stream_CDLHARAMI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHARAMI, __pyx_t_1) < 0) __PYX_ERR(3, 2473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHARAMICROSS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_437stream_CDLHARAMICROSS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHARAMICROSS, __pyx_t_1) < 0) __PYX_ERR(3, 2537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2601 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIGHWAVE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_439stream_CDLHIGHWAVE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHIGHWAVE, __pyx_t_1) < 0) __PYX_ERR(3, 2601, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2665 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_441stream_CDLHIKKAKE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHIKKAKE, __pyx_t_1) < 0) __PYX_ERR(3, 2665, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2729 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHIKKAKEMOD(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_443stream_CDLHIKKAKEMOD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHIKKAKEMOD, __pyx_t_1) < 0) __PYX_ERR(3, 2729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2793 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLHOMINGPIGEON(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_445stream_CDLHOMINGPIGEON, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLHOMINGPIGEON, __pyx_t_1) < 0) __PYX_ERR(3, 2793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2857 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLIDENTICAL3CROWS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_447stream_CDLIDENTICAL3CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLIDENTICAL3CROWS, __pyx_t_1) < 0) __PYX_ERR(3, 2857, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2921 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINNECK(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_449stream_CDLINNECK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLINNECK, __pyx_t_1) < 0) __PYX_ERR(3, 2921, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":2985 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLINVERTEDHAMMER(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_451stream_CDLINVERTEDHAMMER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLINVERTEDHAMMER, __pyx_t_1) < 0) __PYX_ERR(3, 2985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKING(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_453stream_CDLKICKING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLKICKING, __pyx_t_1) < 0) __PYX_ERR(3, 3049, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3113 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLKICKINGBYLENGTH(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_455stream_CDLKICKINGBYLENGTH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLKICKINGBYLENGTH, __pyx_t_1) < 0) __PYX_ERR(3, 3113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3177 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLADDERBOTTOM(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_457stream_CDLLADDERBOTTOM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLLADDERBOTTOM, __pyx_t_1) < 0) __PYX_ERR(3, 3177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3241 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLEGGEDDOJI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_459stream_CDLLONGLEGGEDDOJI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLLONGLEGGEDDOJI, __pyx_t_1) < 0) __PYX_ERR(3, 3241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3305 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLLONGLINE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_461stream_CDLLONGLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLLONGLINE, __pyx_t_1) < 0) __PYX_ERR(3, 3305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3369 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMARUBOZU(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_463stream_CDLMARUBOZU, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLMARUBOZU, __pyx_t_1) < 0) __PYX_ERR(3, 3369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3433 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLMATCHINGLOW(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_465stream_CDLMATCHINGLOW, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLMATCHINGLOW, __pyx_t_1) < 0) __PYX_ERR(3, 3433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3497 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< + * """ CDLMATHOLD(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_467stream_CDLMATHOLD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLMATHOLD, __pyx_t_1) < 0) __PYX_ERR(3, 3497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_469stream_CDLMORNINGDOJISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLMORNINGDOJISTAR, __pyx_t_1) < 0) __PYX_ERR(3, 3563, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3629 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< + * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_471stream_CDLMORNINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLMORNINGSTAR, __pyx_t_1) < 0) __PYX_ERR(3, 3629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3695 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLONNECK(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_473stream_CDLONNECK, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLONNECK, __pyx_t_1) < 0) __PYX_ERR(3, 3695, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3759 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLPIERCING(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_475stream_CDLPIERCING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLPIERCING, __pyx_t_1) < 0) __PYX_ERR(3, 3759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRICKSHAWMAN(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_477stream_CDLRICKSHAWMAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLRICKSHAWMAN, __pyx_t_1) < 0) __PYX_ERR(3, 3823, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3887 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLRISEFALL3METHODS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_479stream_CDLRISEFALL3METHODS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLRISEFALL3METHODS, __pyx_t_1) < 0) __PYX_ERR(3, 3887, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":3951 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSEPARATINGLINES(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_481stream_CDLSEPARATINGLINES, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSEPARATINGLINES, __pyx_t_1) < 0) __PYX_ERR(3, 3951, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4015 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHOOTINGSTAR(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_483stream_CDLSHOOTINGSTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSHOOTINGSTAR, __pyx_t_1) < 0) __PYX_ERR(3, 4015, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4079 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSHORTLINE(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_485stream_CDLSHORTLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSHORTLINE, __pyx_t_1) < 0) __PYX_ERR(3, 4079, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4143 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSPINNINGTOP(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_487stream_CDLSPINNINGTOP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSPINNINGTOP, __pyx_t_1) < 0) __PYX_ERR(3, 4143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4207 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTALLEDPATTERN(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_489stream_CDLSTALLEDPATTERN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSTALLEDPATTERN, __pyx_t_1) < 0) __PYX_ERR(3, 4207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4271 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLSTICKSANDWICH(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_491stream_CDLSTICKSANDWICH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLSTICKSANDWICH, __pyx_t_1) < 0) __PYX_ERR(3, 4271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4335 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTAKURI(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_493stream_CDLTAKURI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLTAKURI, __pyx_t_1) < 0) __PYX_ERR(3, 4335, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4399 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTASUKIGAP(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_495stream_CDLTASUKIGAP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLTASUKIGAP, __pyx_t_1) < 0) __PYX_ERR(3, 4399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4463 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTHRUSTING(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_497stream_CDLTHRUSTING, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLTHRUSTING, __pyx_t_1) < 0) __PYX_ERR(3, 4463, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLTRISTAR(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_499stream_CDLTRISTAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLTRISTAR, __pyx_t_1) < 0) __PYX_ERR(3, 4527, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4591 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUNIQUE3RIVER(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_501stream_CDLUNIQUE3RIVER, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLUNIQUE3RIVER, __pyx_t_1) < 0) __PYX_ERR(3, 4591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4655 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLUPSIDEGAP2CROWS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_503stream_CDLUPSIDEGAP2CROWS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLUPSIDEGAP2CROWS, __pyx_t_1) < 0) __PYX_ERR(3, 4655, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4719 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ CDLXSIDEGAP3METHODS(open, high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_505stream_CDLXSIDEGAP3METHODS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CDLXSIDEGAP3METHODS, __pyx_t_1) < 0) __PYX_ERR(3, 4719, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4783 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ CEIL(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_507stream_CEIL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CEIL, __pyx_t_1) < 0) __PYX_ERR(3, 4783, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4817 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CMO(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_509stream_CMO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CMO, __pyx_t_1) < 0) __PYX_ERR(3, 4817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4853 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ CORREL(real0, real1[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_511stream_CORREL, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_CORREL, __pyx_t_1) < 0) __PYX_ERR(3, 4853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4900 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COS( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COS(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_513stream_COS, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_COS, __pyx_t_1) < 0) __PYX_ERR(3, 4900, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4934 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ COSH(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_515stream_COSH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_COSH, __pyx_t_1) < 0) __PYX_ERR(3, 4934, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":4968 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DEMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_517stream_DEMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_DEMA, __pyx_t_1) < 0) __PYX_ERR(3, 4968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5004 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ DIV(real0, real1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_519stream_DIV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_DIV, __pyx_t_1) < 0) __PYX_ERR(3, 5004, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5049 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ DX(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_521stream_DX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_DX, __pyx_t_1) < 0) __PYX_ERR(3, 5049, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5105 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ EMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_523stream_EMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_EMA, __pyx_t_1) < 0) __PYX_ERR(3, 5105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5141 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ EXP(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_525stream_EXP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_EXP, __pyx_t_1) < 0) __PYX_ERR(3, 5141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5175 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ FLOOR(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_527stream_FLOOR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_FLOOR, __pyx_t_1) < 0) __PYX_ERR(3, 5175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5209 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPERIOD(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_529stream_HT_DCPERIOD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_DCPERIOD, __pyx_t_1) < 0) __PYX_ERR(3, 5209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5243 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_DCPHASE(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_531stream_HT_DCPHASE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_DCPHASE, __pyx_t_1) < 0) __PYX_ERR(3, 5243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5277 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_PHASOR(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_533stream_HT_PHASOR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_PHASOR, __pyx_t_1) < 0) __PYX_ERR(3, 5277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5314 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_SINE(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_535stream_HT_SINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_SINE, __pyx_t_1) < 0) __PYX_ERR(3, 5314, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5351 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDLINE(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_537stream_HT_TRENDLINE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_TRENDLINE, __pyx_t_1) < 0) __PYX_ERR(3, 5351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ HT_TRENDMODE(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_539stream_HT_TRENDMODE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_HT_TRENDMODE, __pyx_t_1) < 0) __PYX_ERR(3, 5385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5419 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ KAMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_541stream_KAMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_KAMA, __pyx_t_1) < 0) __PYX_ERR(3, 5419, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5455 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_543stream_LINEARREG, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LINEARREG, __pyx_t_1) < 0) __PYX_ERR(3, 5455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5491 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_ANGLE(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_545stream_LINEARREG_ANGLE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LINEARREG_ANGLE, __pyx_t_1) < 0) __PYX_ERR(3, 5491, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5527 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_547stream_LINEARREG_INTERCEPT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LINEARREG_INTERCEPT, __pyx_t_1) < 0) __PYX_ERR(3, 5527, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5563 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ LINEARREG_SLOPE(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_549stream_LINEARREG_SLOPE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LINEARREG_SLOPE, __pyx_t_1) < 0) __PYX_ERR(3, 5563, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5599 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LN(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_551stream_LN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LN, __pyx_t_1) < 0) __PYX_ERR(3, 5599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5633 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ LOG10(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_553stream_LOG10, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_LOG10, __pyx_t_1) < 0) __PYX_ERR(3, 5633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5667 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MA(real[, timeperiod=?, matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_555stream_MA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MA, __pyx_t_1) < 0) __PYX_ERR(3, 5667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5704 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_557stream_MACD, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MACD, __pyx_t_1) < 0) __PYX_ERR(3, 5704, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5748 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< + * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_559stream_MACDEXT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MACDEXT, __pyx_t_1) < 0) __PYX_ERR(3, 5748, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5795 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MACDFIX(real[, signalperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_561stream_MACDFIX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MACDFIX, __pyx_t_1) < 0) __PYX_ERR(3, 5795, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5837 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< + * """ MAMA(real[, fastlimit=?, slowlimit=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_563stream_MAMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MAMA, __pyx_t_1) < 0) __PYX_ERR(3, 5837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5877 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_565stream_MAVP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MAVP, __pyx_t_1) < 0) __PYX_ERR(3, 5877, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5926 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_567stream_MAX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MAX, __pyx_t_1) < 0) __PYX_ERR(3, 5926, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5962 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_569stream_MAXINDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MAXINDEX, __pyx_t_1) < 0) __PYX_ERR(3, 5962, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":5998 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< + * """ MEDPRICE(high, low) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_571stream_MEDPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MEDPRICE, __pyx_t_1) < 0) __PYX_ERR(3, 5998, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6042 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MFI(high, low, close, volume[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_573stream_MFI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MFI, __pyx_t_1) < 0) __PYX_ERR(3, 6042, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6108 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPOINT(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_575stream_MIDPOINT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MIDPOINT, __pyx_t_1) < 0) __PYX_ERR(3, 6108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6144 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIDPRICE(high, low[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_577stream_MIDPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MIDPRICE, __pyx_t_1) < 0) __PYX_ERR(3, 6144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6190 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MIN(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_579stream_MIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MIN, __pyx_t_1) < 0) __PYX_ERR(3, 6190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6226 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MININDEX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_581stream_MININDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MININDEX, __pyx_t_1) < 0) __PYX_ERR(3, 6226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6262 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_583stream_MINMAX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MINMAX, __pyx_t_1) < 0) __PYX_ERR(3, 6262, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6301 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINMAXINDEX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_585stream_MINMAXINDEX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MINMAXINDEX, __pyx_t_1) < 0) __PYX_ERR(3, 6301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6340 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_587stream_MINUS_DI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MINUS_DI, __pyx_t_1) < 0) __PYX_ERR(3, 6340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6396 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MINUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_589stream_MINUS_DM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MINUS_DM, __pyx_t_1) < 0) __PYX_ERR(3, 6396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6442 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ MOM(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_591stream_MOM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MOM, __pyx_t_1) < 0) __PYX_ERR(3, 6442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6478 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ MULT(real0, real1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_593stream_MULT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_MULT, __pyx_t_1) < 0) __PYX_ERR(3, 6478, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6523 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ NATR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_595stream_NATR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_NATR, __pyx_t_1) < 0) __PYX_ERR(3, 6523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6579 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< + * """ OBV(real, volume) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_597stream_OBV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_OBV, __pyx_t_1) < 0) __PYX_ERR(3, 6579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6624 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DI(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_599stream_PLUS_DI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_PLUS_DI, __pyx_t_1) < 0) __PYX_ERR(3, 6624, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6680 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ PLUS_DM(high, low[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_601stream_PLUS_DM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_PLUS_DM, __pyx_t_1) < 0) __PYX_ERR(3, 6680, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6726 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< + * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_603stream_PPO, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_PPO, __pyx_t_1) < 0) __PYX_ERR(3, 6726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6764 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROC(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_605stream_ROC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ROC, __pyx_t_1) < 0) __PYX_ERR(3, 6764, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6800 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCP(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_607stream_ROCP, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ROCP, __pyx_t_1) < 0) __PYX_ERR(3, 6800, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6836 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_609stream_ROCR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ROCR, __pyx_t_1) < 0) __PYX_ERR(3, 6836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6872 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ ROCR100(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_611stream_ROCR100, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ROCR100, __pyx_t_1) < 0) __PYX_ERR(3, 6872, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6908 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ RSI(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_613stream_RSI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_RSI, __pyx_t_1) < 0) __PYX_ERR(3, 6908, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6944 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< + * """ SAR(high, low[, acceleration=?, maximum=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_615stream_SAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SAR, __pyx_t_1) < 0) __PYX_ERR(3, 6944, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":6991 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< + * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_617stream_SAREXT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SAREXT, __pyx_t_1) < 0) __PYX_ERR(3, 6991, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7044 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SIN(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_619stream_SIN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SIN, __pyx_t_1) < 0) __PYX_ERR(3, 7044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7078 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SINH(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_621stream_SINH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SINH, __pyx_t_1) < 0) __PYX_ERR(3, 7078, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7112 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_623stream_SMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SMA, __pyx_t_1) < 0) __PYX_ERR(3, 7112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7148 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ SQRT(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_625stream_SQRT, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SQRT, __pyx_t_1) < 0) __PYX_ERR(3, 7148, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7182 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ STDDEV(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_627stream_STDDEV, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_STDDEV, __pyx_t_1) < 0) __PYX_ERR(3, 7182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7219 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_629stream_STOCH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_STOCH, __pyx_t_1) < 0) __PYX_ERR(3, 7219, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7282 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_631stream_STOCHF, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_STOCHF, __pyx_t_1) < 0) __PYX_ERR(3, 7282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7343 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< + * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_633stream_STOCHRSI, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_STOCHRSI, __pyx_t_1) < 0) __PYX_ERR(3, 7343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7385 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< + * """ SUB(real0, real1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_635stream_SUB, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SUB, __pyx_t_1) < 0) __PYX_ERR(3, 7385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7430 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ SUM(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_637stream_SUM, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_SUM, __pyx_t_1) < 0) __PYX_ERR(3, 7430, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7466 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< + * """ T3(real[, timeperiod=?, vfactor=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_639stream_T3, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_T3, __pyx_t_1) < 0) __PYX_ERR(3, 7466, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7503 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TAN(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_641stream_TAN, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TAN, __pyx_t_1) < 0) __PYX_ERR(3, 7503, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7537 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< + * """ TANH(real) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_643stream_TANH, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TANH, __pyx_t_1) < 0) __PYX_ERR(3, 7537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7571 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TEMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_645stream_TEMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TEMA, __pyx_t_1) < 0) __PYX_ERR(3, 7571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7607 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TRANGE(high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_647stream_TRANGE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TRANGE, __pyx_t_1) < 0) __PYX_ERR(3, 7607, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7661 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_649stream_TRIMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TRIMA, __pyx_t_1) < 0) __PYX_ERR(3, 7661, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7697 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TRIX(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_651stream_TRIX, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TRIX, __pyx_t_1) < 0) __PYX_ERR(3, 7697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7733 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ TSF(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_653stream_TSF, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TSF, __pyx_t_1) < 0) __PYX_ERR(3, 7733, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7769 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ TYPPRICE(high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_655stream_TYPPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_TYPPRICE, __pyx_t_1) < 0) __PYX_ERR(3, 7769, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7823 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< + * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_657stream_ULTOSC, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_ULTOSC, __pyx_t_1) < 0) __PYX_ERR(3, 7823, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7881 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< + * """ VAR(real[, timeperiod=?, nbdev=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_659stream_VAR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_VAR, __pyx_t_1) < 0) __PYX_ERR(3, 7881, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7918 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< + * """ WCLPRICE(high, low, close) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_661stream_WCLPRICE, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_WCLPRICE, __pyx_t_1) < 0) __PYX_ERR(3, 7918, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":7972 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WILLR(high, low, close[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_663stream_WILLR, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_WILLR, __pyx_t_1) < 0) __PYX_ERR(3, 7972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_stream.pxi":8028 + * @wraparound(False) # turn off relative indexing from end of lists + * @boundscheck(False) # turn off bounds-checking for entire function + * def stream_WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< + * """ WMA(real[, timeperiod=?]) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_7_ta_lib_665stream_WMA, NULL, __pyx_n_s_talib__ta_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stream_WMA, __pyx_t_1) < 0) __PYX_ERR(3, 8028, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "talib/_ta_lib.pyx":1 + * include "_common.pxi" # <<<<<<<<<<<<<< + * include "_func.pxi" + * include "_abstract.pxi" + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init talib._ta_lib", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init talib._ta_lib"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseArgTupleInvalid */ + static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ + static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ + static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ + static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* StringJoin */ + #if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyObjectCallMethod0 */ + static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method, *result = NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyMethod_Check(method))) { + PyObject *self = PyMethod_GET_SELF(method); + if (likely(self)) { + PyObject *function = PyMethod_GET_FUNCTION(method); + result = __Pyx_PyObject_CallOneArg(function, self); + Py_DECREF(method); + return result; + } + } +#endif + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ + static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ + static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ + static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyIntBinop */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* UnpackUnboundCMethod */ + static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS); + } +#endif + return 0; +} + +/* CallUnboundCMethod0 */ + static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* py_dict_keys */ + static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + if (PY_MAJOR_VERSION >= 3) + return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); + else + return PyDict_Keys(d); +} + +/* PyNumberPow2 */ + static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) { +#if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t shiftby; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(exp))) { + shiftby = PyInt_AS_LONG(exp); + } else +#endif + if (likely(PyLong_CheckExact(exp))) { + #if CYTHON_USE_PYLONG_INTERNALS + const Py_ssize_t size = Py_SIZE(exp); + if (likely(size == 1)) { + shiftby = ((PyLongObject*)exp)->ob_digit[0]; + } else if (size == 0) { + return PyInt_FromLong(1L); + } else if (unlikely(size < 0)) { + goto fallback; + } else { + shiftby = PyLong_AsSsize_t(exp); + } + #else + shiftby = PyLong_AsSsize_t(exp); + #endif + } else { + goto fallback; + } + if (likely(shiftby >= 0)) { + if ((size_t)shiftby <= sizeof(long) * 8 - 2) { + long value = 1L << shiftby; + return PyInt_FromLong(value); + } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) { + unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby; + return PyLong_FromUnsignedLongLong(value); + } else { + PyObject *one = PyInt_FromLong(1L); + if (unlikely(!one)) return NULL; + return PyNumber_Lshift(one, exp); + } + } else if (shiftby == -1 && PyErr_Occurred()) { + PyErr_Clear(); + } +fallback: +#endif + return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none); +} + +/* SliceObject */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +/* PyIntBinop */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + if (op1 == op2) { + Py_RETURN_TRUE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a == b) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a; + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 + default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); + #else + default: Py_RETURN_FALSE; + #endif + } + } + if (a == b) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a == (double)b) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } + return PyObject_RichCompare(op1, op2, Py_EQ); +} +#endif + +/* PyIntBinop */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = a % b; + x += ((x != 0) & ((x ^ b) < 0)) * b; + return PyInt_FromLong(x); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + } + default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2); + } + } + x = a % b; + x += ((x != 0) & ((x ^ b) < 0)) * b; + return PyLong_FromLong(x); + long_long: + llx = lla % llb; + llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb; + return PyLong_FromLongLong(llx); + } + #endif + return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); +} +#endif + +/* BytesEquals */ + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ + static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* SetItemInt */ + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, + CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return -1; + PyErr_Clear(); + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* CalculateMetaclass */ + static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* FetchCommonType */ + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ + static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_COMPILING_IN_CPYTHON + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + PyObject *self = f->m_self; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0 = PySequence_ITEM(arg, 0); + if (unlikely(!arg0)) return NULL; + result = (*meth)(self, arg0); + Py_DECREF(arg0); + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_Call, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Py3ClassCreate */ + static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* SaveResetException */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value) { + const TA_RetCode neg_one = (TA_RetCode) -1, const_zero = (TA_RetCode) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(TA_RetCode) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_RetCode) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(TA_RetCode) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(TA_RetCode) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_RetCode) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(TA_RetCode), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInputParameterType value) { + const TA_OptInputParameterType neg_one = (TA_OptInputParameterType) -1, const_zero = (TA_OptInputParameterType) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(TA_OptInputParameterType) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_OptInputParameterType) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(TA_OptInputParameterType) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(TA_OptInputParameterType) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_OptInputParameterType) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(TA_OptInputParameterType), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_FuncFlags(TA_FuncFlags value) { + const TA_FuncFlags neg_one = (TA_FuncFlags) -1, const_zero = (TA_FuncFlags) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(TA_FuncFlags) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_FuncFlags) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(TA_FuncFlags) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(TA_FuncFlags) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_FuncFlags) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(TA_FuncFlags), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_InputFlags(TA_InputFlags value) { + const TA_InputFlags neg_one = (TA_InputFlags) -1, const_zero = (TA_InputFlags) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(TA_InputFlags) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_InputFlags) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(TA_InputFlags) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(TA_InputFlags) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_InputFlags) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(TA_InputFlags), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OutputFlags(TA_OutputFlags value) { + const TA_OutputFlags neg_one = (TA_OutputFlags) -1, const_zero = (TA_OutputFlags) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(TA_OutputFlags) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_OutputFlags) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(TA_OutputFlags) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(TA_OutputFlags) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(TA_OutputFlags) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(TA_OutputFlags), + little, !is_unsigned); + } +} + +/* None */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* None */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* None */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* None */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum NPY_TYPES) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(enum NPY_TYPES) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE TA_RetCode __Pyx_PyInt_As_TA_RetCode(PyObject *x) { + const TA_RetCode neg_one = (TA_RetCode) -1, const_zero = (TA_RetCode) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(TA_RetCode) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (TA_RetCode) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (TA_RetCode) 0; + case 1: __PYX_VERIFY_RETURN_INT(TA_RetCode, digit, digits[0]) + case 2: + if (8 * sizeof(TA_RetCode) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) >= 2 * PyLong_SHIFT) { + return (TA_RetCode) (((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(TA_RetCode) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) >= 3 * PyLong_SHIFT) { + return (TA_RetCode) (((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(TA_RetCode) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) >= 4 * PyLong_SHIFT) { + return (TA_RetCode) (((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (TA_RetCode) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(TA_RetCode) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, unsigned long, PyLong_AsUnsignedLong(x)) + } else if (sizeof(TA_RetCode) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (TA_RetCode) 0; + case -1: __PYX_VERIFY_RETURN_INT(TA_RetCode, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(TA_RetCode, digit, +digits[0]) + case -2: + if (8 * sizeof(TA_RetCode) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { + return (TA_RetCode) (((TA_RetCode)-1)*(((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(TA_RetCode) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { + return (TA_RetCode) ((((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { + return (TA_RetCode) (((TA_RetCode)-1)*(((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(TA_RetCode) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { + return (TA_RetCode) ((((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 4 * PyLong_SHIFT) { + return (TA_RetCode) (((TA_RetCode)-1)*(((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(TA_RetCode) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_RetCode) - 1 > 4 * PyLong_SHIFT) { + return (TA_RetCode) ((((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); + } + } + break; + } +#endif + if (sizeof(TA_RetCode) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, long, PyLong_AsLong(x)) + } else if (sizeof(TA_RetCode) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + TA_RetCode val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (TA_RetCode) -1; + } + } else { + TA_RetCode val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (TA_RetCode) -1; + val = __Pyx_PyInt_As_TA_RetCode(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to TA_RetCode"); + return (TA_RetCode) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to TA_RetCode"); + return (TA_RetCode) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE TA_FuncUnstId __Pyx_PyInt_As_TA_FuncUnstId(PyObject *x) { + const TA_FuncUnstId neg_one = (TA_FuncUnstId) -1, const_zero = (TA_FuncUnstId) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(TA_FuncUnstId) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (TA_FuncUnstId) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (TA_FuncUnstId) 0; + case 1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, digit, digits[0]) + case 2: + if (8 * sizeof(TA_FuncUnstId) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) >= 2 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(TA_FuncUnstId) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) >= 3 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(TA_FuncUnstId) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) >= 4 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (TA_FuncUnstId) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(TA_FuncUnstId) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, unsigned long, PyLong_AsUnsignedLong(x)) + } else if (sizeof(TA_FuncUnstId) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (TA_FuncUnstId) 0; + case -1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, digit, +digits[0]) + case -2: + if (8 * sizeof(TA_FuncUnstId) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(TA_FuncUnstId) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { + return (TA_FuncUnstId) ((((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(TA_FuncUnstId) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { + return (TA_FuncUnstId) ((((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 4 * PyLong_SHIFT) { + return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(TA_FuncUnstId) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(TA_FuncUnstId) - 1 > 4 * PyLong_SHIFT) { + return (TA_FuncUnstId) ((((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); + } + } + break; + } +#endif + if (sizeof(TA_FuncUnstId) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, long, PyLong_AsLong(x)) + } else if (sizeof(TA_FuncUnstId) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + TA_FuncUnstId val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (TA_FuncUnstId) -1; + } + } else { + TA_FuncUnstId val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (TA_FuncUnstId) -1; + val = __Pyx_PyInt_As_TA_FuncUnstId(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to TA_FuncUnstId"); + return (TA_FuncUnstId) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to TA_FuncUnstId"); + return (TA_FuncUnstId) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* ModuleImport */ + #ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return __Pyx_NewRef(x); + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/talib/abstract.c b/talib/abstract.c deleted file mode 100644 index 7e248582c..000000000 --- a/talib/abstract.c +++ /dev/null @@ -1,20518 +0,0 @@ -/* Generated by Cython 0.23.4 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_23_4" -#include -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) -#define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__talib__abstract -#define __PYX_HAVE_API__talib__abstract -#include "string.h" -#include "stdio.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#if defined(WIN32) || defined(MS_WINDOWS) -#include "ta_libc.h" -#else -#include "ta-lib/ta_defs.h" -#include "ta-lib/ta_common.h" -#include "ta-lib/ta_abstract.h" -#include "ta-lib/ta_func.h" -#endif -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - - -static const char *__pyx_f[] = { - "talib/abstract.pyx", - "__init__.pxd", - "type.pxd", -}; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - - -/*--- Type declarations ---*/ - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- Runtime support code (head) --- */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyString_Join __Pyx_PyBytes_Join -#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) -#else -#define __Pyx_PyString_Join PyUnicode_Join -#define __Pyx_PyBaseString_Join PyUnicode_Join -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION < 3 - #define __Pyx_PyBytes_Join _PyString_Join - #else - #define __Pyx_PyBytes_Join _PyBytes_Join - #endif -#else -static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); -#endif - -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, - int is_tuple, int has_known_size, int decref_tuple); - -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_is_dict); -static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); - -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); -#else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ - (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) -#endif - -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); - -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CallUnboundCMethod0(cfunc, self)\ - ((likely((cfunc)->func)) ?\ - (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ - (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ - ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\ - __Pyx__CallUnboundCMethod0(cfunc, self)) -#else -#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) -#endif - -#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1) -#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0) -static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace); - -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( - PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** py_start, PyObject** py_stop, PyObject** py_slice, - int has_cstart, int has_cstop, int wraparound); - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); -#else -#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ - PyObject_RichCompare(op1, op2, Py_EQ) - #endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace); -#else -#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace)\ - (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) -#endif - -#include - -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals -#else -#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals -#endif - -#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ - __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) -static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, - int is_list, int wraparound, int boundscheck); - -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); - -static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); - -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); - -#define __Pyx_CyFunction_USED 1 -#include -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { - PyCFunctionObject func; -#if PY_VERSION_HEX < 0x030500A0 - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; - PyObject *func_classobj; - void *defaults; - int defaults_pyobjects; - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; -} __pyx_CyFunctionObject; -static PyTypeObject *__pyx_CyFunctionType = 0; -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) -static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *self, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(void); - -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, - PyObject *mkw, PyObject *modname, PyObject *doc); -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, - PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); - -static PyObject* __Pyx_Globals(void); - -static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInputParameterType value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_FuncFlags(TA_FuncFlags value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_InputFlags(TA_InputFlags value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OutputFlags(TA_OutputFlags value); - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -static int __Pyx_check_binary_version(void); - -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -static PyObject *__Pyx_ImportModule(const char *name); - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'talib.libta_lib' */ - -/* Module declarations from 'talib.abstract' */ -static TA_FuncHandle *__pyx_f_5talib_8abstract___ta_getFuncHandle(char *); /*proto*/ -static TA_ParamHolder *__pyx_f_5talib_8abstract___ta_paramHolderAlloc(char *); /*proto*/ -static int __pyx_f_5talib_8abstract___ta_paramHolderFree(TA_ParamHolder *); /*proto*/ -static int __pyx_f_5talib_8abstract___ta_setOptInputParamInteger(TA_ParamHolder *, int, int); /*proto*/ -static int __pyx_f_5talib_8abstract___ta_setOptInputParamReal(TA_ParamHolder *, int, int); /*proto*/ -static int __pyx_f_5talib_8abstract___ta_getLookback(TA_ParamHolder *); /*proto*/ -#define __Pyx_MODULE_NAME "talib.abstract" -int __pyx_module_is_main_talib__abstract = 0; - -/* Implementation of 'talib.abstract' */ -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_object; -static PyObject *__pyx_builtin_property; -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_xrange; -static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_min; -static PyObject *__pyx_builtin_max; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_3[] = "3"; -static char __pyx_k_B[] = "B"; -static char __pyx_k_H[] = "H"; -static char __pyx_k_I[] = "I"; -static char __pyx_k_L[] = "L"; -static char __pyx_k_O[] = "O"; -static char __pyx_k_Q[] = "Q"; -static char __pyx_k_b[] = "b"; -static char __pyx_k_d[] = "d"; -static char __pyx_k_f[] = "f"; -static char __pyx_k_g[] = "g"; -static char __pyx_k_h[] = "h"; -static char __pyx_k_i[] = "i"; -static char __pyx_k_l[] = "l"; -static char __pyx_k_q[] = "q"; -static char __pyx_k_s[] = "s"; -static char __pyx_k_Zd[] = "Zd"; -static char __pyx_k_Zf[] = "Zf"; -static char __pyx_k_Zg[] = "Zg"; -static char __pyx_k__5[] = ""; -static char __pyx_k__6[] = ", "; -static char __pyx_k__8[] = "("; -static char __pyx_k__9[] = " "; -static char __pyx_k_in[] = "in"; -static char __pyx_k_Dot[] = "Dot"; -static char __pyx_k__10[] = ")\n"; -static char __pyx_k__11[] = "\n"; -static char __pyx_k_all[] = "__all__"; -static char __pyx_k_doc[] = "__doc__"; -static char __pyx_k_idx[] = "idx"; -static char __pyx_k_key[] = "key"; -static char __pyx_k_log[] = "log"; -static char __pyx_k_low[] = "low"; -static char __pyx_k_max[] = "max"; -static char __pyx_k_min[] = "min"; -static char __pyx_k_out[] = "out"; -static char __pyx_k_pop[] = "pop"; -static char __pyx_k_ret[] = "ret"; -static char __pyx_k_run[] = "run"; -static char __pyx_k_s_2[] = "%s"; -static char __pyx_k_s_3[] = "(%s)"; -static char __pyx_k_s_4[] = " %s"; -static char __pyx_k_s_s[] = " %s: %s"; -static char __pyx_k_str[] = "__str__"; -static char __pyx_k_sys[] = "sys"; -static char __pyx_k_Line[] = "Line"; -static char __pyx_k_args[] = "args"; -static char __pyx_k_call[] = "__call__"; -static char __pyx_k_copy[] = "copy"; -static char __pyx_k_docs[] = "docs"; -static char __pyx_k_flag[] = "flag"; -static char __pyx_k_func[] = "func"; -static char __pyx_k_help[] = "help"; -static char __pyx_k_high[] = "high"; -static char __pyx_k_info[] = "info"; -static char __pyx_k_init[] = "__init__"; -static char __pyx_k_join[] = "join"; -static char __pyx_k_keys[] = "keys"; -static char __pyx_k_main[] = "__main__"; -static char __pyx_k_math[] = "math"; -static char __pyx_k_name[] = "name"; -static char __pyx_k_open[] = "open"; -static char __pyx_k_real[] = "real"; -static char __pyx_k_repr[] = "__repr__"; -static char __pyx_k_self[] = "self"; -static char __pyx_k_test[] = "__test__"; -static char __pyx_k_type[] = "type"; -static char __pyx_k_ascii[] = "ascii"; -static char __pyx_k_close[] = "close"; -static char __pyx_k_flags[] = "flags"; -static char __pyx_k_group[] = "group"; -static char __pyx_k_index[] = "index"; -static char __pyx_k_items[] = "items"; -static char __pyx_k_lower[] = "lower"; -static char __pyx_k_numpy[] = "numpy"; -static char __pyx_k_optIn[] = "optIn"; -static char __pyx_k_param[] = "param"; -static char __pyx_k_price[] = "price"; -static char __pyx_k_range[] = "range"; -static char __pyx_k_real0[] = "real0"; -static char __pyx_k_real1[] = "real1"; -static char __pyx_k_s_s_2[] = "[%s=%s]"; -static char __pyx_k_table[] = "table"; -static char __pyx_k_upper[] = "upper"; -static char __pyx_k_value[] = "value"; -static char __pyx_k_Inputs[] = "Inputs:"; -static char __pyx_k_Series[] = "Series"; -static char __pyx_k_common[] = "common"; -static char __pyx_k_decode[] = "decode"; -static char __pyx_k_func_c[] = "func_c"; -static char __pyx_k_groups[] = "groups"; -static char __pyx_k_holder[] = "holder"; -static char __pyx_k_import[] = "__import__"; -static char __pyx_k_kwargs[] = "kwargs"; -static char __pyx_k_matype[] = "matype"; -static char __pyx_k_module[] = "__module__"; -static char __pyx_k_object[] = "object"; -static char __pyx_k_output[] = "output"; -static char __pyx_k_pandas[] = "pandas"; -static char __pyx_k_params[] = "params"; -static char __pyx_k_price0[] = "price0"; -static char __pyx_k_price1[] = "price1"; -static char __pyx_k_prices[] = "prices"; -static char __pyx_k_series[] = "series"; -static char __pyx_k_type_2[] = "type_"; -static char __pyx_k_values[] = "values"; -static char __pyx_k_volume[] = "volume"; -static char __pyx_k_xrange[] = "xrange"; -static char __pyx_k_MA_Type[] = "MA_Type"; -static char __pyx_k_Outputs[] = "Outputs:"; -static char __pyx_k_columns[] = "columns"; -static char __pyx_k_integer[] = "integer"; -static char __pyx_k_max_int[] = "max_int"; -static char __pyx_k_min_int[] = "min_int"; -static char __pyx_k_outputs[] = "outputs"; -static char __pyx_k_periods[] = "periods"; -static char __pyx_k_prepare[] = "__prepare__"; -static char __pyx_k_replace[] = "replace"; -static char __pyx_k_results[] = "results"; -static char __pyx_k_retCode[] = "retCode"; -static char __pyx_k_unicode[] = "__unicode__"; -static char __pyx_k_version[] = "version"; -static char __pyx_k_Function[] = "Function"; -static char __pyx_k_builtins[] = "__builtins__"; -static char __pyx_k_defaults[] = "defaults"; -static char __pyx_k_lookback[] = "lookback"; -static char __pyx_k_property[] = "property"; -static char __pyx_k_qualname[] = "__qualname__"; -static char __pyx_k_DataFrame[] = "DataFrame"; -static char __pyx_k_Exception[] = "Exception"; -static char __pyx_k_Histogram[] = "Histogram"; -static char __pyx_k_bytes2str[] = "bytes2str"; -static char __pyx_k_enumerate[] = "enumerate"; -static char __pyx_k_func_args[] = "func_args"; -static char __pyx_k_func_info[] = "func_info"; -static char __pyx_k_func_line[] = "func_line"; -static char __pyx_k_functions[] = "functions"; -static char __pyx_k_get_flags[] = "__get_flags"; -static char __pyx_k_metaclass[] = "__metaclass__"; -static char __pyx_k_opt_input[] = "opt_input"; -static char __pyx_k_str2bytes[] = "str2bytes"; -static char __pyx_k_timeStamp[] = "timeStamp"; -static char __pyx_k_Parameters[] = "Parameters:"; -static char __pyx_k_ValueError[] = "ValueError"; -static char __pyx_k_input_name[] = "input_name"; -static char __pyx_k_num_inputs[] = "num_inputs"; -static char __pyx_k_param_name[] = "param_name"; -static char __pyx_k_parameters[] = "parameters"; -static char __pyx_k_skip_first[] = "skip_first"; -static char __pyx_k_Dashed_Line[] = "Dashed Line"; -static char __pyx_k_Dotted_Line[] = "Dotted Line"; -static char __pyx_k_ImportError[] = "ImportError"; -static char __pyx_k_OrderedDict[] = "OrderedDict"; -static char __pyx_k_any_ndarray[] = "(any ndarray)"; -static char __pyx_k_collections[] = "collections"; -static char __pyx_k_input_names[] = "input_names"; -static char __pyx_k_num_outputs[] = "num_outputs"; -static char __pyx_k_ordereddict[] = "ordereddict"; -static char __pyx_k_output_name[] = "output_name"; -static char __pyx_k_update_info[] = "update_info"; -static char __pyx_k_value_range[] = "value_range"; -static char __pyx_k_Function_run[] = "Function.run"; -static char __pyx_k_Pattern_Bool[] = "Pattern (Bool)"; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static char __pyx_k_column_stack[] = "column_stack"; -static char __pyx_k_display_name[] = "display_name"; -static char __pyx_k_getattribute[] = "__getattribute__"; -static char __pyx_k_input_arrays[] = "input_arrays"; -static char __pyx_k_missing_keys[] = "missing_keys"; -static char __pyx_k_openInterest[] = "openInterest"; -static char __pyx_k_output_flags[] = "output_flags"; -static char __pyx_k_output_names[] = "output_names"; -static char __pyx_k_price_series[] = "price_series"; -static char __pyx_k_s_Function_s[] = "%s = Function('%s')"; -static char __pyx_k_Function_info[] = "Function.info"; -static char __pyx_k_PANDAS_SERIES[] = "__PANDAS_SERIES"; -static char __pyx_k_TA_FUNC_FLAGS[] = "TA_FUNC_FLAGS"; -static char __pyx_k_call_function[] = "__call_function"; -static char __pyx_k_default_value[] = "default_value"; -static char __pyx_k_documentation[] = "documentation"; -static char __pyx_k_function_name[] = "function_name"; -static char __pyx_k_FUNCTION_NAMES[] = "__FUNCTION_NAMES"; -static char __pyx_k_Function___str[] = "Function.__str__"; -static char __pyx_k_Function__info[] = "_Function__info"; -static char __pyx_k_Function__name[] = "_Function__name"; -static char __pyx_k_TA_GetFuncInfo[] = "TA_GetFuncInfo"; -static char __pyx_k_TA_GetLookback[] = "TA_GetLookback"; -static char __pyx_k_TA_INPUT_FLAGS[] = "TA_INPUT_FLAGS"; -static char __pyx_k_function_flags[] = "function_flags"; -static char __pyx_k_get_parameters[] = "get_parameters"; -static char __pyx_k_input_arrays_2[] = "[input_arrays]"; -static char __pyx_k_num_opt_inputs[] = "num_opt_inputs"; -static char __pyx_k_set_parameters[] = "set_parameters"; -static char __pyx_k_ta_getFuncInfo[] = "_ta_getFuncInfo"; -static char __pyx_k_talib_abstract[] = "talib.abstract"; -static char __pyx_k_Function___call[] = "Function.__call__"; -static char __pyx_k_Function___init[] = "Function.__init__"; -static char __pyx_k_Function___repr[] = "Function.__repr__"; -static char __pyx_k_TA_OUTPUT_FLAGS[] = "TA_OUTPUT_FLAGS"; -static char __pyx_k_get_input_names[] = "get_input_names"; -static char __pyx_k_set_input_names[] = "set_input_names"; -static char __pyx_k_ta_getFuncTable[] = "_ta_getFuncTable"; -static char __pyx_k_Function_outputs[] = "Function.outputs"; -static char __pyx_k_PANDAS_DATAFRAME[] = "__PANDAS_DATAFRAME"; -static char __pyx_k_TA_FuncTableFree[] = "TA_FuncTableFree"; -static char __pyx_k_TA_GetFuncHandle[] = "TA_GetFuncHandle"; -static char __pyx_k_get_input_arrays[] = "get_input_arrays"; -static char __pyx_k_set_input_arrays[] = "set_input_arrays"; -static char __pyx_k_ta_check_success[] = "_ta_check_success"; -static char __pyx_k_ta_getGroupTable[] = "_ta_getGroupTable"; -static char __pyx_k_Function__namestr[] = "_Function__namestr"; -static char __pyx_k_Function__outputs[] = "_Function__outputs"; -static char __pyx_k_Function_lookback[] = "Function.lookback"; -static char __pyx_k_TA_FuncTableAlloc[] = "TA_FuncTableAlloc"; -static char __pyx_k_TA_GroupTableFree[] = "TA_GroupTableFree"; -static char __pyx_k_flags_lookup_dict[] = "flags_lookup_dict"; -static char __pyx_k_set_function_args[] = "set_function_args"; -static char __pyx_k_Function___unicode[] = "Function.__unicode__"; -static char __pyx_k_INPUT_ARRAYS_TYPES[] = "__INPUT_ARRAYS_TYPES"; -static char __pyx_k_Output_can_be_zero[] = "Output can be zero"; -static char __pyx_k_TA_GroupTableAlloc[] = "TA_GroupTableAlloc"; -static char __pyx_k_TA_ParamHolderFree[] = "TA_ParamHolderFree"; -static char __pyx_k_TA_ParamHolderAlloc[] = "TA_ParamHolderAlloc"; -static char __pyx_k_get_opt_input_value[] = "__get_opt_input_value"; -static char __pyx_k_Function__opt_inputs[] = "_Function__opt_inputs"; -static char __pyx_k_Function__input_names[] = "_Function__input_names"; -static char __pyx_k_Function_output_flags[] = "Function.output_flags"; -static char __pyx_k_Function_output_names[] = "Function.output_names"; -static char __pyx_k_INPUT_ARRAYS_DEFAULTS[] = "__INPUT_ARRAYS_DEFAULTS"; -static char __pyx_k_Output_is_over_volume[] = "Output is over volume"; -static char __pyx_k_get_defaults_and_docs[] = "_get_defaults_and_docs"; -static char __pyx_k_Function__input_arrays[] = "_Function__input_arrays"; -static char __pyx_k_Output_can_be_negative[] = "Output can be negative"; -static char __pyx_k_Output_can_be_positive[] = "Output can be positive"; -static char __pyx_k_display_name_s_group_s[] = "%(display_name)s (%(group)s)\n"; -static char __pyx_k_Function__call_function[] = "_Function__call_function"; -static char __pyx_k_Function__outputs_valid[] = "_Function__outputs_valid"; -static char __pyx_k_Function_function_flags[] = "Function.function_flags"; -static char __pyx_k_Function_get_parameters[] = "Function.get_parameters"; -static char __pyx_k_Function_set_parameters[] = "Function.set_parameters"; -static char __pyx_k_Output_is_a_candlestick[] = "Output is a candlestick"; -static char __pyx_k_TA_SetOptInputParamReal[] = "TA_SetOptInputParamReal"; -static char __pyx_k_Function___call_function[] = "Function.__call_function"; -static char __pyx_k_Function_get_input_names[] = "Function.get_input_names"; -static char __pyx_k_Function_set_input_names[] = "Function.set_input_names"; -static char __pyx_k_TA_GetInputParameterInfo[] = "TA_GetInputParameterInfo"; -static char __pyx_k_initialize_function_info[] = "__initialize_function_info"; -static char __pyx_k_input_price_series_names[] = "input_price_series_names"; -static char __pyx_k_ta_getInputParameterInfo[] = "_ta_getInputParameterInfo"; -static char __pyx_k_Function_get_input_arrays[] = "Function.get_input_arrays"; -static char __pyx_k_Function_set_input_arrays[] = "Function.set_input_arrays"; -static char __pyx_k_TA_GetOutputParameterInfo[] = "TA_GetOutputParameterInfo"; -static char __pyx_k_s_not_supported_by_TA_LIB[] = "%s not supported by TA-LIB."; -static char __pyx_k_ta_getOutputParameterInfo[] = "_ta_getOutputParameterInfo"; -static char __pyx_k_Function_set_function_args[] = "Function.set_function_args"; -static char __pyx_k_Output_scale_same_as_input[] = "Output scale same as input"; -static char __pyx_k_TA_SetOptInputParamInteger[] = "TA_SetOptInputParamInteger"; -static char __pyx_k_input_price_series_names_2[] = "__input_price_series_names"; -static char __pyx_k_INPUT_PRICE_SERIES_DEFAULTS[] = "__INPUT_PRICE_SERIES_DEFAULTS"; -static char __pyx_k_TA_GetOptInputParameterInfo[] = "TA_GetOptInputParameterInfo"; -static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static char __pyx_k_ta_getOptInputParameterInfo[] = "_ta_getOptInputParameterInfo"; -static char __pyx_k_Function__get_opt_input_value[] = "_Function__get_opt_input_value"; -static char __pyx_k_Function___get_opt_input_value[] = "Function.__get_opt_input_value"; -static char __pyx_k_Values_represent_a_lower_limit[] = "Values represent a lower limit"; -static char __pyx_k_Function__initialize_function_i[] = "_Function__initialize_function_info"; -static char __pyx_k_Function__input_price_series_na[] = "_Function__input_price_series_names"; -static char __pyx_k_Function_has_an_unstable_period[] = "Function has an unstable period"; -static char __pyx_k_This_file_Copyright_c_2013_Bria[] = "\nThis file Copyright (c) 2013 Brian A Cappello \n"; -static char __pyx_k_This_is_a_pythonic_wrapper_arou[] = "\n This is a pythonic wrapper around TALIB's abstract interface. It is\n intended to simplify using individual TALIB functions by providing a\n unified interface for setting/controlling input data, setting function\n parameters and retrieving results. Input data consists of a ``dict`` of\n ``numpy`` arrays (or a ``pandas.DataFrame``), one array for each of open,\n high, low, close and volume. This can be set with the set_input_arrays()\n method. Which keyed array(s) are used as inputs when calling the function\n is controlled using the input_names property.\n\n This class gets initialized with a TALIB function name and optionally an\n input_arrays object. It provides the following primary functions for\n setting inputs and retrieving results:\n\n ---- input_array/TA-function-parameter set-only functions -----\n - set_input_arrays(input_arrays)\n - set_function_args([input_arrays,] [param_args_andor_kwargs])\n\n Documentation for param_args_andor_kwargs can be seen by printing the\n Function instance or programatically via the info, input_names and\n parameters properties.\n\n ----- result-returning functions -----\n - the outputs property wraps a method which ensures results are always valid\n - run([input_arrays]) # calls set_input_arrays and returns self.outputs\n - FunctionInstance([input_arrays,] [param_args_andor_kwargs]) # calls set_function_args and returns self.outputs\n "; -static char __pyx_k_Users_jbenedik_Dev_ta_lib_talib[] = "/Users/jbenedik/Dev/ta-lib/talib/abstract.pyx"; -static char __pyx_k_Values_represent_an_upper_limit[] = "Values represent an upper limit"; -static char __pyx_k_integer_values_are_100_0_or_100[] = "integer (values are -100, 0 or 100)"; -static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_Bull_Bear_Pattern_Bearish_0_Neut[] = "Bull/Bear Pattern (Bearish < 0, Neutral = 0, Bullish > 0)"; -static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_Function___initialize_function_i[] = "Function.__initialize_function_info"; -static char __pyx_k_Function___input_price_series_na[] = "Function.__input_price_series_names"; -static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static char __pyx_k_Strength_Pattern_200_100_Bearish[] = "Strength Pattern ([-200..-100] = Bearish, [-100..0] = Getting Bearish, 0 = Neutral, [0..100] = Getting Bullish, [100-200] = Bullish)"; -static char __pyx_k_input_arrays_parameter_missing_r[] = "input_arrays parameter missing required data key%s: %s"; -static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut; -static PyObject *__pyx_kp_s_Dashed_Line; -static PyObject *__pyx_n_s_DataFrame; -static PyObject *__pyx_n_s_Dot; -static PyObject *__pyx_kp_s_Dotted_Line; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_n_s_FUNCTION_NAMES; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_n_s_Function; -static PyObject *__pyx_n_s_Function___call; -static PyObject *__pyx_n_s_Function___call_function; -static PyObject *__pyx_n_s_Function___get_opt_input_value; -static PyObject *__pyx_n_s_Function___init; -static PyObject *__pyx_n_s_Function___initialize_function_i; -static PyObject *__pyx_n_s_Function___input_price_series_na; -static PyObject *__pyx_n_s_Function___repr; -static PyObject *__pyx_n_s_Function___str; -static PyObject *__pyx_n_s_Function___unicode; -static PyObject *__pyx_n_s_Function__call_function; -static PyObject *__pyx_n_s_Function__get_opt_input_value; -static PyObject *__pyx_n_s_Function__info; -static PyObject *__pyx_n_s_Function__initialize_function_i; -static PyObject *__pyx_n_s_Function__input_arrays; -static PyObject *__pyx_n_s_Function__input_names; -static PyObject *__pyx_n_s_Function__input_price_series_na; -static PyObject *__pyx_n_s_Function__name; -static PyObject *__pyx_n_s_Function__namestr; -static PyObject *__pyx_n_s_Function__opt_inputs; -static PyObject *__pyx_n_s_Function__outputs; -static PyObject *__pyx_n_s_Function__outputs_valid; -static PyObject *__pyx_n_s_Function_function_flags; -static PyObject *__pyx_n_s_Function_get_input_arrays; -static PyObject *__pyx_n_s_Function_get_input_names; -static PyObject *__pyx_n_s_Function_get_parameters; -static PyObject *__pyx_kp_s_Function_has_an_unstable_period; -static PyObject *__pyx_n_s_Function_info; -static PyObject *__pyx_n_s_Function_lookback; -static PyObject *__pyx_n_s_Function_output_flags; -static PyObject *__pyx_n_s_Function_output_names; -static PyObject *__pyx_n_s_Function_outputs; -static PyObject *__pyx_n_s_Function_run; -static PyObject *__pyx_n_s_Function_set_function_args; -static PyObject *__pyx_n_s_Function_set_input_arrays; -static PyObject *__pyx_n_s_Function_set_input_names; -static PyObject *__pyx_n_s_Function_set_parameters; -static PyObject *__pyx_n_s_Histogram; -static PyObject *__pyx_n_s_INPUT_ARRAYS_DEFAULTS; -static PyObject *__pyx_n_s_INPUT_ARRAYS_TYPES; -static PyObject *__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS; -static PyObject *__pyx_n_s_ImportError; -static PyObject *__pyx_kp_s_Inputs; -static PyObject *__pyx_n_s_Line; -static PyObject *__pyx_n_s_MA_Type; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_OrderedDict; -static PyObject *__pyx_kp_s_Output_can_be_negative; -static PyObject *__pyx_kp_s_Output_can_be_positive; -static PyObject *__pyx_kp_s_Output_can_be_zero; -static PyObject *__pyx_kp_s_Output_is_a_candlestick; -static PyObject *__pyx_kp_s_Output_is_over_volume; -static PyObject *__pyx_kp_s_Output_scale_same_as_input; -static PyObject *__pyx_kp_s_Outputs; -static PyObject *__pyx_n_s_PANDAS_DATAFRAME; -static PyObject *__pyx_n_s_PANDAS_SERIES; -static PyObject *__pyx_kp_s_Parameters; -static PyObject *__pyx_kp_s_Pattern_Bool; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_Series; -static PyObject *__pyx_kp_s_Strength_Pattern_200_100_Bearish; -static PyObject *__pyx_n_s_TA_FUNC_FLAGS; -static PyObject *__pyx_n_s_TA_FuncTableAlloc; -static PyObject *__pyx_n_s_TA_FuncTableFree; -static PyObject *__pyx_n_s_TA_GetFuncHandle; -static PyObject *__pyx_n_s_TA_GetFuncInfo; -static PyObject *__pyx_n_s_TA_GetInputParameterInfo; -static PyObject *__pyx_n_s_TA_GetLookback; -static PyObject *__pyx_n_s_TA_GetOptInputParameterInfo; -static PyObject *__pyx_n_s_TA_GetOutputParameterInfo; -static PyObject *__pyx_n_s_TA_GroupTableAlloc; -static PyObject *__pyx_n_s_TA_GroupTableFree; -static PyObject *__pyx_n_s_TA_INPUT_FLAGS; -static PyObject *__pyx_n_s_TA_OUTPUT_FLAGS; -static PyObject *__pyx_n_s_TA_ParamHolderAlloc; -static PyObject *__pyx_n_s_TA_ParamHolderFree; -static PyObject *__pyx_n_s_TA_SetOptInputParamInteger; -static PyObject *__pyx_n_s_TA_SetOptInputParamReal; -static PyObject *__pyx_kp_s_This_is_a_pythonic_wrapper_arou; -static PyObject *__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_kp_s_Values_represent_a_lower_limit; -static PyObject *__pyx_kp_s_Values_represent_an_upper_limit; -static PyObject *__pyx_kp_s__10; -static PyObject *__pyx_kp_s__11; -static PyObject *__pyx_kp_s__5; -static PyObject *__pyx_kp_s__6; -static PyObject *__pyx_kp_s__8; -static PyObject *__pyx_kp_s__9; -static PyObject *__pyx_n_s_all; -static PyObject *__pyx_kp_s_any_ndarray; -static PyObject *__pyx_n_s_args; -static PyObject *__pyx_n_s_ascii; -static PyObject *__pyx_n_s_b; -static PyObject *__pyx_n_s_builtins; -static PyObject *__pyx_n_s_bytes2str; -static PyObject *__pyx_n_s_call; -static PyObject *__pyx_n_s_call_function; -static PyObject *__pyx_n_s_close; -static PyObject *__pyx_n_s_collections; -static PyObject *__pyx_n_s_column_stack; -static PyObject *__pyx_n_s_columns; -static PyObject *__pyx_n_s_common; -static PyObject *__pyx_n_s_copy; -static PyObject *__pyx_n_s_decode; -static PyObject *__pyx_n_s_default_value; -static PyObject *__pyx_n_s_defaults; -static PyObject *__pyx_n_s_display_name; -static PyObject *__pyx_kp_s_display_name_s_group_s; -static PyObject *__pyx_n_s_doc; -static PyObject *__pyx_n_s_docs; -static PyObject *__pyx_n_s_documentation; -static PyObject *__pyx_n_s_enumerate; -static PyObject *__pyx_n_s_flag; -static PyObject *__pyx_n_s_flags; -static PyObject *__pyx_n_s_flags_lookup_dict; -static PyObject *__pyx_n_s_func; -static PyObject *__pyx_n_s_func_args; -static PyObject *__pyx_n_s_func_c; -static PyObject *__pyx_n_s_func_info; -static PyObject *__pyx_n_s_func_line; -static PyObject *__pyx_n_s_function_flags; -static PyObject *__pyx_n_s_function_name; -static PyObject *__pyx_n_s_functions; -static PyObject *__pyx_n_s_get_defaults_and_docs; -static PyObject *__pyx_n_s_get_flags; -static PyObject *__pyx_n_s_get_input_arrays; -static PyObject *__pyx_n_s_get_input_names; -static PyObject *__pyx_n_s_get_opt_input_value; -static PyObject *__pyx_n_s_get_parameters; -static PyObject *__pyx_n_s_getattribute; -static PyObject *__pyx_n_s_group; -static PyObject *__pyx_n_s_groups; -static PyObject *__pyx_n_s_help; -static PyObject *__pyx_n_s_high; -static PyObject *__pyx_n_s_holder; -static PyObject *__pyx_n_s_i; -static PyObject *__pyx_n_s_idx; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_in; -static PyObject *__pyx_n_s_index; -static PyObject *__pyx_n_s_info; -static PyObject *__pyx_n_s_init; -static PyObject *__pyx_n_s_initialize_function_info; -static PyObject *__pyx_n_s_input_arrays; -static PyObject *__pyx_kp_s_input_arrays_2; -static PyObject *__pyx_kp_s_input_arrays_parameter_missing_r; -static PyObject *__pyx_n_s_input_name; -static PyObject *__pyx_n_s_input_names; -static PyObject *__pyx_n_s_input_price_series_names; -static PyObject *__pyx_n_s_input_price_series_names_2; -static PyObject *__pyx_n_s_integer; -static PyObject *__pyx_kp_s_integer_values_are_100_0_or_100; -static PyObject *__pyx_n_s_items; -static PyObject *__pyx_n_s_join; -static PyObject *__pyx_n_s_key; -static PyObject *__pyx_n_s_keys; -static PyObject *__pyx_n_s_kwargs; -static PyObject *__pyx_n_s_log; -static PyObject *__pyx_n_s_lookback; -static PyObject *__pyx_n_s_low; -static PyObject *__pyx_n_s_lower; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_math; -static PyObject *__pyx_n_s_matype; -static PyObject *__pyx_n_s_max; -static PyObject *__pyx_n_s_max_int; -static PyObject *__pyx_n_s_metaclass; -static PyObject *__pyx_n_s_min; -static PyObject *__pyx_n_s_min_int; -static PyObject *__pyx_n_s_missing_keys; -static PyObject *__pyx_n_s_module; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_num_inputs; -static PyObject *__pyx_n_s_num_opt_inputs; -static PyObject *__pyx_n_s_num_outputs; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_object; -static PyObject *__pyx_n_s_open; -static PyObject *__pyx_n_s_openInterest; -static PyObject *__pyx_n_s_optIn; -static PyObject *__pyx_n_s_opt_input; -static PyObject *__pyx_n_s_ordereddict; -static PyObject *__pyx_n_s_out; -static PyObject *__pyx_n_s_output; -static PyObject *__pyx_n_s_output_flags; -static PyObject *__pyx_n_s_output_name; -static PyObject *__pyx_n_s_output_names; -static PyObject *__pyx_n_s_outputs; -static PyObject *__pyx_n_s_pandas; -static PyObject *__pyx_n_s_param; -static PyObject *__pyx_n_s_param_name; -static PyObject *__pyx_n_s_parameters; -static PyObject *__pyx_n_s_params; -static PyObject *__pyx_n_s_periods; -static PyObject *__pyx_n_s_pop; -static PyObject *__pyx_n_s_prepare; -static PyObject *__pyx_n_s_price; -static PyObject *__pyx_n_s_price0; -static PyObject *__pyx_n_s_price1; -static PyObject *__pyx_n_s_price_series; -static PyObject *__pyx_n_s_prices; -static PyObject *__pyx_n_s_property; -static PyObject *__pyx_n_s_qualname; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_real; -static PyObject *__pyx_n_s_real0; -static PyObject *__pyx_n_s_real1; -static PyObject *__pyx_n_s_replace; -static PyObject *__pyx_n_s_repr; -static PyObject *__pyx_n_s_results; -static PyObject *__pyx_n_s_ret; -static PyObject *__pyx_n_s_retCode; -static PyObject *__pyx_n_s_run; -static PyObject *__pyx_n_s_s; -static PyObject *__pyx_kp_s_s_2; -static PyObject *__pyx_kp_s_s_3; -static PyObject *__pyx_kp_s_s_4; -static PyObject *__pyx_kp_s_s_Function_s; -static PyObject *__pyx_kp_s_s_not_supported_by_TA_LIB; -static PyObject *__pyx_kp_s_s_s; -static PyObject *__pyx_kp_s_s_s_2; -static PyObject *__pyx_n_s_self; -static PyObject *__pyx_n_s_series; -static PyObject *__pyx_n_s_set_function_args; -static PyObject *__pyx_n_s_set_input_arrays; -static PyObject *__pyx_n_s_set_input_names; -static PyObject *__pyx_n_s_set_parameters; -static PyObject *__pyx_n_s_skip_first; -static PyObject *__pyx_n_s_str; -static PyObject *__pyx_n_s_str2bytes; -static PyObject *__pyx_n_s_sys; -static PyObject *__pyx_n_s_ta_check_success; -static PyObject *__pyx_n_s_ta_getFuncInfo; -static PyObject *__pyx_n_s_ta_getFuncTable; -static PyObject *__pyx_n_s_ta_getGroupTable; -static PyObject *__pyx_n_s_ta_getInputParameterInfo; -static PyObject *__pyx_n_s_ta_getOptInputParameterInfo; -static PyObject *__pyx_n_s_ta_getOutputParameterInfo; -static PyObject *__pyx_n_s_table; -static PyObject *__pyx_n_s_talib_abstract; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_timeStamp; -static PyObject *__pyx_n_s_type; -static PyObject *__pyx_n_s_type_2; -static PyObject *__pyx_n_s_unicode; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_update_info; -static PyObject *__pyx_n_s_upper; -static PyObject *__pyx_n_s_value; -static PyObject *__pyx_n_s_value_range; -static PyObject *__pyx_n_s_values; -static PyObject *__pyx_n_s_version; -static PyObject *__pyx_n_s_volume; -static PyObject *__pyx_n_s_xrange; -static PyObject *__pyx_pf_5talib_8abstract_str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_2bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_4str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_6bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_function_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_2__initialize_function_info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_4info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_6function_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_8output_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_10get_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_12set_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_names); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_14get_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_16set_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_18get_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_20set_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameters); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_22set_function_args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_24lookback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_26output_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_28outputs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_30run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_32__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_34__input_price_series_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_36__call_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_38__get_opt_input_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_name); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_40__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_42__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8Function_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_8_ta_getGroupTable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_10_ta_getFuncTable(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_group); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_12__get_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flag, PyObject *__pyx_v_flags_lookup_dict); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_14_ta_getFuncInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_16_ta_getInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_18_ta_getOptInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_20_ta_getOutputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx); /* proto */ -static PyObject *__pyx_pf_5talib_8abstract_22_get_defaults_and_docs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_info); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_4; -static PyObject *__pyx_int_8; -static PyObject *__pyx_int_16; -static PyObject *__pyx_int_32; -static PyObject *__pyx_int_64; -static PyObject *__pyx_int_128; -static PyObject *__pyx_int_256; -static PyObject *__pyx_int_512; -static PyObject *__pyx_int_1024; -static PyObject *__pyx_int_2048; -static PyObject *__pyx_int_4096; -static PyObject *__pyx_int_16777216; -static PyObject *__pyx_int_67108864; -static PyObject *__pyx_int_134217728; -static PyObject *__pyx_int_268435456; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__15; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__17; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__24; -static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__28; -static PyObject *__pyx_tuple__30; -static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__40; -static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_tuple__50; -static PyObject *__pyx_tuple__52; -static PyObject *__pyx_tuple__54; -static PyObject *__pyx_tuple__56; -static PyObject *__pyx_tuple__58; -static PyObject *__pyx_tuple__59; -static PyObject *__pyx_tuple__61; -static PyObject *__pyx_tuple__63; -static PyObject *__pyx_tuple__65; -static PyObject *__pyx_tuple__67; -static PyObject *__pyx_tuple__69; -static PyObject *__pyx_tuple__71; -static PyObject *__pyx_tuple__73; -static PyObject *__pyx_tuple__75; -static PyObject *__pyx_tuple__77; -static PyObject *__pyx_tuple__79; -static PyObject *__pyx_tuple__81; -static PyObject *__pyx_tuple__83; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__87; -static PyObject *__pyx_codeobj__19; -static PyObject *__pyx_codeobj__21; -static PyObject *__pyx_codeobj__23; -static PyObject *__pyx_codeobj__25; -static PyObject *__pyx_codeobj__27; -static PyObject *__pyx_codeobj__29; -static PyObject *__pyx_codeobj__31; -static PyObject *__pyx_codeobj__33; -static PyObject *__pyx_codeobj__35; -static PyObject *__pyx_codeobj__37; -static PyObject *__pyx_codeobj__39; -static PyObject *__pyx_codeobj__41; -static PyObject *__pyx_codeobj__43; -static PyObject *__pyx_codeobj__45; -static PyObject *__pyx_codeobj__47; -static PyObject *__pyx_codeobj__49; -static PyObject *__pyx_codeobj__51; -static PyObject *__pyx_codeobj__53; -static PyObject *__pyx_codeobj__55; -static PyObject *__pyx_codeobj__57; -static PyObject *__pyx_codeobj__60; -static PyObject *__pyx_codeobj__62; -static PyObject *__pyx_codeobj__64; -static PyObject *__pyx_codeobj__66; -static PyObject *__pyx_codeobj__68; -static PyObject *__pyx_codeobj__70; -static PyObject *__pyx_codeobj__72; -static PyObject *__pyx_codeobj__74; -static PyObject *__pyx_codeobj__76; -static PyObject *__pyx_codeobj__78; -static PyObject *__pyx_codeobj__80; -static PyObject *__pyx_codeobj__82; -static PyObject *__pyx_codeobj__84; -static PyObject *__pyx_codeobj__86; -static PyObject *__pyx_codeobj__88; - -/* "talib/abstract.pyx":50 - * if sys.version >= '3': - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return bytes(s, 'ascii') - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_1str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_1str2bytes = {"str2bytes", (PyCFunction)__pyx_pw_5talib_8abstract_1str2bytes, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_1str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("str2bytes (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_str2bytes(__pyx_self, ((PyObject *)__pyx_v_s)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("str2bytes", 0); - - /* "talib/abstract.pyx":51 - * - * def str2bytes(s): - * return bytes(s, 'ascii') # <<<<<<<<<<<<<< - * - * def bytes2str(b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s); - __Pyx_INCREF(__pyx_n_s_ascii); - __Pyx_GIVEREF(__pyx_n_s_ascii); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":50 - * if sys.version >= '3': - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return bytes(s, 'ascii') - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.abstract.str2bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":53 - * return bytes(s, 'ascii') - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b.decode('ascii') - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_3bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_3bytes2str = {"bytes2str", (PyCFunction)__pyx_pw_5talib_8abstract_3bytes2str, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_3bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("bytes2str (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_2bytes2str(__pyx_self, ((PyObject *)__pyx_v_b)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_2bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("bytes2str", 0); - - /* "talib/abstract.pyx":54 - * - * def bytes2str(b): - * return b.decode('ascii') # <<<<<<<<<<<<<< - * - * else: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":53 - * return bytes(s, 'ascii') - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b.decode('ascii') - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.abstract.bytes2str", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":58 - * else: - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return s - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_5str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_5str2bytes = {"str2bytes", (PyCFunction)__pyx_pw_5talib_8abstract_5str2bytes, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_5str2bytes(PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("str2bytes (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_4str2bytes(__pyx_self, ((PyObject *)__pyx_v_s)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_4str2bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("str2bytes", 0); - - /* "talib/abstract.pyx":59 - * - * def str2bytes(s): - * return s # <<<<<<<<<<<<<< - * - * def bytes2str(b): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - - /* "talib/abstract.pyx":58 - * else: - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return s - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":61 - * return s - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_7bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_7bytes2str = {"bytes2str", (PyCFunction)__pyx_pw_5talib_8abstract_7bytes2str, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_7bytes2str(PyObject *__pyx_self, PyObject *__pyx_v_b) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("bytes2str (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_6bytes2str(__pyx_self, ((PyObject *)__pyx_v_b)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_6bytes2str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("bytes2str", 0); - - /* "talib/abstract.pyx":62 - * - * def bytes2str(b): - * return b # <<<<<<<<<<<<<< - * - * class Function(object): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_b); - __pyx_r = __pyx_v_b; - goto __pyx_L0; - - /* "talib/abstract.pyx":61 - * return s - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":93 - * """ - * - * def __init__(self, function_name, *args, **kwargs): # <<<<<<<<<<<<<< - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_function_name = 0; - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); - if (unlikely(!__pyx_v_args)) { - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_v_args); - } else { - __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); - } - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_function_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - default: - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_function_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("talib.abstract.Function.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function___init__(__pyx_self, __pyx_v_self, __pyx_v_function_name, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_function_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "talib/abstract.pyx":95 - * def __init__(self, function_name, *args, **kwargs): - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() # <<<<<<<<<<<<<< - * if self.__name not in __FUNCTION_NAMES: - * raise Exception('%s not supported by TA-LIB.' % self.__name) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_function_name, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":96 - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - * if self.__name not in __FUNCTION_NAMES: # <<<<<<<<<<<<<< - * raise Exception('%s not supported by TA-LIB.' % self.__name) - * self.__namestr = self.__name - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FUNCTION_NAMES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = (__pyx_t_4 != 0); - if (__pyx_t_5) { - - /* "talib/abstract.pyx":97 - * self.__name = function_name.upper() - * if self.__name not in __FUNCTION_NAMES: - * raise Exception('%s not supported by TA-LIB.' % self.__name) # <<<<<<<<<<<<<< - * self.__namestr = self.__name - * self.__name = str2bytes(self.__name) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_not_supported_by_TA_LIB, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":96 - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - * if self.__name not in __FUNCTION_NAMES: # <<<<<<<<<<<<<< - * raise Exception('%s not supported by TA-LIB.' % self.__name) - * self.__namestr = self.__name - */ - } - - /* "talib/abstract.pyx":98 - * if self.__name not in __FUNCTION_NAMES: - * raise Exception('%s not supported by TA-LIB.' % self.__name) - * self.__namestr = self.__name # <<<<<<<<<<<<<< - * self.__name = str2bytes(self.__name) - * self.__info = None - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__namestr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":99 - * raise Exception('%s not supported by TA-LIB.' % self.__name) - * self.__namestr = self.__name - * self.__name = str2bytes(self.__name) # <<<<<<<<<<<<<< - * self.__info = None - * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_str2bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":100 - * self.__namestr = self.__name - * self.__name = str2bytes(self.__name) - * self.__info = None # <<<<<<<<<<<<<< - * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__info, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":101 - * self.__name = str2bytes(self.__name) - * self.__info = None - * self.__input_arrays = __INPUT_ARRAYS_DEFAULTS # <<<<<<<<<<<<<< - * - * # dictionaries of function args. keys are input/opt_input/output parameter names - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_ARRAYS_DEFAULTS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":104 - * - * # dictionaries of function args. keys are input/opt_input/output parameter names - * self.__input_names = OrderedDict() # <<<<<<<<<<<<<< - * self.__opt_inputs = OrderedDict() - * self.__outputs = OrderedDict() - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":105 - * # dictionaries of function args. keys are input/opt_input/output parameter names - * self.__input_names = OrderedDict() - * self.__opt_inputs = OrderedDict() # <<<<<<<<<<<<<< - * self.__outputs = OrderedDict() - * self.__outputs_valid = False - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":106 - * self.__input_names = OrderedDict() - * self.__opt_inputs = OrderedDict() - * self.__outputs = OrderedDict() # <<<<<<<<<<<<<< - * self.__outputs_valid = False - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":107 - * self.__opt_inputs = OrderedDict() - * self.__outputs = OrderedDict() - * self.__outputs_valid = False # <<<<<<<<<<<<<< - * - * # finish initializing: query the TALIB abstract interface and set arguments - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":110 - * - * # finish initializing: query the TALIB abstract interface and set arguments - * self.__initialize_function_info() # <<<<<<<<<<<<<< - * self.set_function_args(*args, **kwargs) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__initialize_function_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":111 - * # finish initializing: query the TALIB abstract interface and set arguments - * self.__initialize_function_info() - * self.set_function_args(*args, **kwargs) # <<<<<<<<<<<<<< - * - * def __initialize_function_info(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_function_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":93 - * """ - * - * def __init__(self, function_name, *args, **kwargs): # <<<<<<<<<<<<<< - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("talib.abstract.Function.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":113 - * self.set_function_args(*args, **kwargs) - * - * def __initialize_function_info(self): # <<<<<<<<<<<<<< - * # function info - * self.__info = _ta_getFuncInfo(self.__name) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_3__initialize_function_info(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_3__initialize_function_info = {"__initialize_function_info", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_3__initialize_function_info, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_3__initialize_function_info(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__initialize_function_info (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_2__initialize_function_info(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_2__initialize_function_info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_info = NULL; - PyObject *__pyx_v_input_name = NULL; - PyObject *__pyx_v_param_name = NULL; - PyObject *__pyx_v_output_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - Py_ssize_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__initialize_function_info", 0); - - /* "talib/abstract.pyx":115 - * def __initialize_function_info(self): - * # function info - * self.__info = _ta_getFuncInfo(self.__name) # <<<<<<<<<<<<<< - * - * # inputs (price series names) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getFuncInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":118 - * - * # inputs (price series names) - * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":119 - * # inputs (price series names) - * for i in xrange(self.__info.pop('num_inputs')): - * info = _ta_getInputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< - * input_name = info['name'] - * if info['price_series'] is None: - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getInputParameterInfo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_8 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); - __Pyx_INCREF(__pyx_v_i); - __Pyx_GIVEREF(__pyx_v_i); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_i); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":120 - * for i in xrange(self.__info.pop('num_inputs')): - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] # <<<<<<<<<<<<<< - * if info['price_series'] is None: - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] - */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":121 - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] - * if info['price_series'] is None: # <<<<<<<<<<<<<< - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] - * self.__input_names[input_name] = info - */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_price_series); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = (__pyx_t_1 == Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = (__pyx_t_10 != 0); - if (__pyx_t_11) { - - /* "talib/abstract.pyx":122 - * input_name = info['name'] - * if info['price_series'] is None: - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] # <<<<<<<<<<<<<< - * self.__input_names[input_name] = info - * self.__info['input_names'] = self.input_names - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_info, __pyx_n_s_price_series, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":121 - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] - * if info['price_series'] is None: # <<<<<<<<<<<<<< - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] - * self.__input_names[input_name] = info - */ - } - - /* "talib/abstract.pyx":123 - * if info['price_series'] is None: - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] - * self.__input_names[input_name] = info # <<<<<<<<<<<<<< - * self.__info['input_names'] = self.input_names - * - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_input_name, __pyx_v_info) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":118 - * - * # inputs (price series names) - * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":124 - * info['price_series'] = __INPUT_PRICE_SERIES_DEFAULTS[input_name] - * self.__input_names[input_name] = info - * self.__info['input_names'] = self.input_names # <<<<<<<<<<<<<< - * - * # optional inputs (function parameters) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_input_names, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":127 - * - * # optional inputs (function parameters) - * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getOptInputParameterInfo(self.__name, i) - * param_name = info['name'] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":128 - * # optional inputs (function parameters) - * for i in xrange(self.__info.pop('num_opt_inputs')): - * info = _ta_getOptInputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< - * param_name = info['name'] - * self.__opt_inputs[param_name] = info - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getOptInputParameterInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = NULL; - __pyx_t_8 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } - } - __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_9); - __Pyx_INCREF(__pyx_v_i); - __Pyx_GIVEREF(__pyx_v_i); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_i); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":129 - * for i in xrange(self.__info.pop('num_opt_inputs')): - * info = _ta_getOptInputParameterInfo(self.__name, i) - * param_name = info['name'] # <<<<<<<<<<<<<< - * self.__opt_inputs[param_name] = info - * self.__info['parameters'] = self.parameters - */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_param_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":130 - * info = _ta_getOptInputParameterInfo(self.__name, i) - * param_name = info['name'] - * self.__opt_inputs[param_name] = info # <<<<<<<<<<<<<< - * self.__info['parameters'] = self.parameters - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_param_name, __pyx_v_info) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":127 - * - * # optional inputs (function parameters) - * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getOptInputParameterInfo(self.__name, i) - * param_name = info['name'] - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":131 - * param_name = info['name'] - * self.__opt_inputs[param_name] = info - * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< - * - * # outputs - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_parameters, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":134 - * - * # outputs - * self.__info['output_flags'] = OrderedDict() # <<<<<<<<<<<<<< - * for i in xrange(self.__info.pop('num_outputs')): - * info = _ta_getOutputParameterInfo(self.__name, i) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_1) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_output_flags, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":135 - * # outputs - * self.__info['output_flags'] = OrderedDict() - * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< - * info = _ta_getOutputParameterInfo(self.__name, i) - * output_name = info['name'] - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - #endif - } - } else { - __pyx_t_5 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":136 - * self.__info['output_flags'] = OrderedDict() - * for i in xrange(self.__info.pop('num_outputs')): - * info = _ta_getOutputParameterInfo(self.__name, i) # <<<<<<<<<<<<<< - * output_name = info['name'] - * self.__info['output_flags'][output_name] = info['flags'] - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_getOutputParameterInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = NULL; - __pyx_t_8 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_9) { - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL; - } - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_4); - __Pyx_INCREF(__pyx_v_i); - __Pyx_GIVEREF(__pyx_v_i); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_i); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":137 - * for i in xrange(self.__info.pop('num_outputs')): - * info = _ta_getOutputParameterInfo(self.__name, i) - * output_name = info['name'] # <<<<<<<<<<<<<< - * self.__info['output_flags'][output_name] = info['flags'] - * self.__outputs[output_name] = None - */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_output_name, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":138 - * info = _ta_getOutputParameterInfo(self.__name, i) - * output_name = info['name'] - * self.__info['output_flags'][output_name] = info['flags'] # <<<<<<<<<<<<<< - * self.__outputs[output_name] = None - * self.__info['output_names'] = self.output_names - */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_info, __pyx_n_s_flags); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_output_flags); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_output_name, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":139 - * output_name = info['name'] - * self.__info['output_flags'][output_name] = info['flags'] - * self.__outputs[output_name] = None # <<<<<<<<<<<<<< - * self.__info['output_names'] = self.output_names - * - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_output_name, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":135 - * # outputs - * self.__info['output_flags'] = OrderedDict() - * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< - * info = _ta_getOutputParameterInfo(self.__name, i) - * output_name = info['name'] - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":140 - * self.__info['output_flags'][output_name] = info['flags'] - * self.__outputs[output_name] = None - * self.__info['output_names'] = self.output_names # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_output_names, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":113 - * self.set_function_args(*args, **kwargs) - * - * def __initialize_function_info(self): # <<<<<<<<<<<<<< - * # function info - * self.__info = _ta_getFuncInfo(self.__name) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("talib.abstract.Function.__initialize_function_info", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_info); - __Pyx_XDECREF(__pyx_v_input_name); - __Pyx_XDECREF(__pyx_v_param_name); - __Pyx_XDECREF(__pyx_v_output_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":143 - * - * @property - * def info(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the function's info dict. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_5info(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_4info[] = "\n Returns a copy of the function's info dict.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_5info = {"info", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_5info, METH_O, __pyx_doc_5talib_8abstract_8Function_4info}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_5info(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("info (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_4info(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_4info(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("info", 0); - - /* "talib/abstract.pyx":147 - * Returns a copy of the function's info dict. - * """ - * return self.__info.copy() # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":143 - * - * @property - * def info(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the function's info dict. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.info", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":150 - * - * @property - * def function_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns any function flags defined for this indicator function. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_7function_flags(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_6function_flags[] = "\n Returns any function flags defined for this indicator function.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_7function_flags = {"function_flags", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_7function_flags, METH_O, __pyx_doc_5talib_8abstract_8Function_6function_flags}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_7function_flags(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("function_flags (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_6function_flags(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_6function_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("function_flags", 0); - - /* "talib/abstract.pyx":154 - * Returns any function flags defined for this indicator function. - * """ - * return self.__info['function_flags'] # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_function_flags); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":150 - * - * @property - * def function_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns any function flags defined for this indicator function. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.abstract.Function.function_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":157 - * - * @property - * def output_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns the flags for each output for this indicator function. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_9output_flags(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_8output_flags[] = "\n Returns the flags for each output for this indicator function.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_9output_flags = {"output_flags", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_9output_flags, METH_O, __pyx_doc_5talib_8abstract_8Function_8output_flags}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_9output_flags(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("output_flags (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_8output_flags(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_8output_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("output_flags", 0); - - /* "talib/abstract.pyx":161 - * Returns the flags for each output for this indicator function. - * """ - * return self.__info['output_flags'].copy() # <<<<<<<<<<<<<< - * - * def get_input_names(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_output_flags); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":157 - * - * @property - * def output_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns the flags for each output for this indicator function. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.output_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":163 - * return self.__info['output_flags'].copy() - * - * def get_input_names(self): # <<<<<<<<<<<<<< - * """ - * Returns the dict of input price series names that specifies which - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_11get_input_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_10get_input_names[] = "\n Returns the dict of input price series names that specifies which\n of the ndarrays in input_arrays will be used to calculate the function.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_11get_input_names = {"get_input_names", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_11get_input_names, METH_O, __pyx_doc_5talib_8abstract_8Function_10get_input_names}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_11get_input_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_input_names (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_10get_input_names(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_10get_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_v_input_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_input_names", 0); - - /* "talib/abstract.pyx":168 - * of the ndarrays in input_arrays will be used to calculate the function. - * """ - * ret = OrderedDict() # <<<<<<<<<<<<<< - * for input_name in self.__input_names: - * ret[input_name] = self.__input_names[input_name]['price_series'] - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":169 - * """ - * ret = OrderedDict() - * for input_name in self.__input_names: # <<<<<<<<<<<<<< - * ret[input_name] = self.__input_names[input_name]['price_series'] - * return ret - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":170 - * ret = OrderedDict() - * for input_name in self.__input_names: - * ret[input_name] = self.__input_names[input_name]['price_series'] # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_price_series); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_v_input_name, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":169 - * """ - * ret = OrderedDict() - * for input_name in self.__input_names: # <<<<<<<<<<<<<< - * ret[input_name] = self.__input_names[input_name]['price_series'] - * return ret - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":171 - * for input_name in self.__input_names: - * ret[input_name] = self.__input_names[input_name]['price_series'] - * return ret # <<<<<<<<<<<<<< - * - * def set_input_names(self, input_names): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "talib/abstract.pyx":163 - * return self.__info['output_flags'].copy() - * - * def get_input_names(self): # <<<<<<<<<<<<<< - * """ - * Returns the dict of input price series names that specifies which - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.get_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_input_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":173 - * return ret - * - * def set_input_names(self, input_names): # <<<<<<<<<<<<<< - * """ - * Sets the input price series names to use. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_13set_input_names(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_12set_input_names[] = "\n Sets the input price series names to use.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_13set_input_names = {"set_input_names", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_13set_input_names, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_12set_input_names}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_13set_input_names(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_input_names = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_input_names (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_names,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_names)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_input_names", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_names") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_input_names = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_input_names", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.Function.set_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_12set_input_names(__pyx_self, __pyx_v_self, __pyx_v_input_names); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_12set_input_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_names) { - PyObject *__pyx_v_input_name = NULL; - PyObject *__pyx_v_price_series = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_input_names", 0); - - /* "talib/abstract.pyx":177 - * Sets the input price series names to use. - * """ - * for input_name, price_series in input_names.items(): # <<<<<<<<<<<<<< - * self.__input_names[input_name]['price_series'] = price_series - * self.__info['input_names'][input_name] = price_series - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_names, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L6_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_6); - __pyx_t_6 = 0; - - /* "talib/abstract.pyx":178 - * """ - * for input_name, price_series in input_names.items(): - * self.__input_names[input_name]['price_series'] = price_series # <<<<<<<<<<<<<< - * self.__info['input_names'][input_name] = price_series - * self.__outputs_valid = False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_price_series, __pyx_v_price_series) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "talib/abstract.pyx":179 - * for input_name, price_series in input_names.items(): - * self.__input_names[input_name]['price_series'] = price_series - * self.__info['input_names'][input_name] = price_series # <<<<<<<<<<<<<< - * self.__outputs_valid = False - * - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_input_names); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_input_name, __pyx_v_price_series) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":177 - * Sets the input price series names to use. - * """ - * for input_name, price_series in input_names.items(): # <<<<<<<<<<<<<< - * self.__input_names[input_name]['price_series'] = price_series - * self.__info['input_names'][input_name] = price_series - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":180 - * self.__input_names[input_name]['price_series'] = price_series - * self.__info['input_names'][input_name] = price_series - * self.__outputs_valid = False # <<<<<<<<<<<<<< - * - * input_names = property(get_input_names, set_input_names) - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":173 - * return ret - * - * def set_input_names(self, input_names): # <<<<<<<<<<<<<< - * """ - * Sets the input price series names to use. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("talib.abstract.Function.set_input_names", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_input_name); - __Pyx_XDECREF(__pyx_v_price_series); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":184 - * input_names = property(get_input_names, set_input_names) - * - * def get_input_arrays(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the dict of input arrays in use. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_15get_input_arrays(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_14get_input_arrays[] = "\n Returns a copy of the dict of input arrays in use.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_15get_input_arrays = {"get_input_arrays", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_15get_input_arrays, METH_O, __pyx_doc_5talib_8abstract_8Function_14get_input_arrays}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_15get_input_arrays(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_input_arrays (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_14get_input_arrays(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_14get_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_input_arrays", 0); - - /* "talib/abstract.pyx":188 - * Returns a copy of the dict of input arrays in use. - * """ - * return self.__input_arrays.copy() # <<<<<<<<<<<<<< - * - * def set_input_arrays(self, input_arrays): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":184 - * input_names = property(get_input_names, set_input_names) - * - * def get_input_arrays(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the dict of input arrays in use. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.get_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":190 - * return self.__input_arrays.copy() - * - * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< - * """ - * Sets the dict of input_arrays to use. Returns True/False for - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_17set_input_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_16set_input_arrays[] = "\n Sets the dict of input_arrays to use. Returns True/False for\n subclasses:\n\n If input_arrays is a dict with the keys open, high, low, close and\n volume, it is assigned as the input_array to use and this function\n returns True, returning False otherwise. If you implement your own\n data type and wish to subclass Function, you should wrap this function\n with an if-statement:\n\n class CustomFunction(Function):\n def __init__(self, function_name):\n Function.__init__(self, function_name)\n\n def set_input_arrays(self, input_data):\n if Function.set_input_arrays(self, input_data):\n return True\n elif isinstance(input_data, some_module.CustomDataType):\n input_arrays = Function.get_input_arrays(self)\n # convert input_data to input_arrays and then call the super\n Function.set_input_arrays(self, input_arrays)\n return True\n return False\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_17set_input_arrays = {"set_input_arrays", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_17set_input_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_16set_input_arrays}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_17set_input_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_input_arrays = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_input_arrays (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_arrays,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_arrays)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_input_arrays", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_arrays") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_input_arrays = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_input_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.Function.set_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_16set_input_arrays(__pyx_self, __pyx_v_self, __pyx_v_input_arrays); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_16set_input_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays) { - PyObject *__pyx_v_missing_keys = NULL; - PyObject *__pyx_v_key = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_input_arrays", 0); - - /* "talib/abstract.pyx":215 - * return False - * """ - * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): # <<<<<<<<<<<<<< - * missing_keys = [] - * for key in self.__input_price_series_names(): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INPUT_ARRAYS_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_input_arrays, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "talib/abstract.pyx":216 - * """ - * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): - * missing_keys = [] # <<<<<<<<<<<<<< - * for key in self.__input_price_series_names(): - * if key not in input_arrays: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_missing_keys = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":217 - * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): - * missing_keys = [] - * for key in self.__input_price_series_names(): # <<<<<<<<<<<<<< - * if key not in input_arrays: - * missing_keys.append(key) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_price_series_na); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":218 - * missing_keys = [] - * for key in self.__input_price_series_names(): - * if key not in input_arrays: # <<<<<<<<<<<<<< - * missing_keys.append(key) - * if len(missing_keys) == 0: - */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_input_arrays, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_3 != 0); - if (__pyx_t_2) { - - /* "talib/abstract.pyx":219 - * for key in self.__input_price_series_names(): - * if key not in input_arrays: - * missing_keys.append(key) # <<<<<<<<<<<<<< - * if len(missing_keys) == 0: - * self.__input_arrays = input_arrays - */ - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_keys, __pyx_v_key); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":218 - * missing_keys = [] - * for key in self.__input_price_series_names(): - * if key not in input_arrays: # <<<<<<<<<<<<<< - * missing_keys.append(key) - * if len(missing_keys) == 0: - */ - } - - /* "talib/abstract.pyx":217 - * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): - * missing_keys = [] - * for key in self.__input_price_series_names(): # <<<<<<<<<<<<<< - * if key not in input_arrays: - * missing_keys.append(key) - */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "talib/abstract.pyx":220 - * if key not in input_arrays: - * missing_keys.append(key) - * if len(missing_keys) == 0: # <<<<<<<<<<<<<< - * self.__input_arrays = input_arrays - * self.__outputs_valid = False - */ - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_missing_keys); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((__pyx_t_6 == 0) != 0); - if (__pyx_t_2) { - - /* "talib/abstract.pyx":221 - * missing_keys.append(key) - * if len(missing_keys) == 0: - * self.__input_arrays = input_arrays # <<<<<<<<<<<<<< - * self.__outputs_valid = False - * return True - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays, __pyx_v_input_arrays) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":222 - * if len(missing_keys) == 0: - * self.__input_arrays = input_arrays - * self.__outputs_valid = False # <<<<<<<<<<<<<< - * return True - * else: - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":223 - * self.__input_arrays = input_arrays - * self.__outputs_valid = False - * return True # <<<<<<<<<<<<<< - * else: - * raise Exception('input_arrays parameter missing required data '\ - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "talib/abstract.pyx":220 - * if key not in input_arrays: - * missing_keys.append(key) - * if len(missing_keys) == 0: # <<<<<<<<<<<<<< - * self.__input_arrays = input_arrays - * self.__outputs_valid = False - */ - } - - /* "talib/abstract.pyx":225 - * return True - * else: - * raise Exception('input_arrays parameter missing required data '\ # <<<<<<<<<<<<<< - * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ - * else '', - */ - /*else*/ { - - /* "talib/abstract.pyx":226 - * else: - * raise Exception('input_arrays parameter missing required data '\ - * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ # <<<<<<<<<<<<<< - * else '', - * ', '.join(missing_keys))) - */ - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_missing_keys); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (((__pyx_t_6 > 1) != 0)) { - __Pyx_INCREF(__pyx_n_s_s); - __pyx_t_4 = __pyx_n_s_s; - } else { - __Pyx_INCREF(__pyx_kp_s__5); - __pyx_t_4 = __pyx_kp_s__5; - } - - /* "talib/abstract.pyx":228 - * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ - * else '', - * ', '.join(missing_keys))) # <<<<<<<<<<<<<< - * return False - * - */ - __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__6, __pyx_v_missing_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "talib/abstract.pyx":226 - * else: - * raise Exception('input_arrays parameter missing required data '\ - * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ # <<<<<<<<<<<<<< - * else '', - * ', '.join(missing_keys))) - */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_input_arrays_parameter_missing_r, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":225 - * return True - * else: - * raise Exception('input_arrays parameter missing required data '\ # <<<<<<<<<<<<<< - * 'key%s: %s' % ('s' if len(missing_keys) > 1 \ - * else '', - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "talib/abstract.pyx":215 - * return False - * """ - * if isinstance(input_arrays, __INPUT_ARRAYS_TYPES): # <<<<<<<<<<<<<< - * missing_keys = [] - * for key in self.__input_price_series_names(): - */ - } - - /* "talib/abstract.pyx":229 - * else '', - * ', '.join(missing_keys))) - * return False # <<<<<<<<<<<<<< - * - * input_arrays = property(get_input_arrays, set_input_arrays) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "talib/abstract.pyx":190 - * return self.__input_arrays.copy() - * - * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< - * """ - * Sets the dict of input_arrays to use. Returns True/False for - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.abstract.Function.set_input_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_missing_keys); - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":233 - * input_arrays = property(get_input_arrays, set_input_arrays) - * - * def get_parameters(self): # <<<<<<<<<<<<<< - * """ - * Returns the function's optional parameters and their default values. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_19get_parameters(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_18get_parameters[] = "\n Returns the function's optional parameters and their default values.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_19get_parameters = {"get_parameters", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_19get_parameters, METH_O, __pyx_doc_5talib_8abstract_8Function_18get_parameters}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_19get_parameters(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_parameters (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_18get_parameters(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_18get_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_v_opt_input = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_parameters", 0); - - /* "talib/abstract.pyx":237 - * Returns the function's optional parameters and their default values. - * """ - * ret = OrderedDict() # <<<<<<<<<<<<<< - * for opt_input in self.__opt_inputs: - * ret[opt_input] = self.__get_opt_input_value(opt_input) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":238 - * """ - * ret = OrderedDict() - * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< - * ret[opt_input] = self.__get_opt_input_value(opt_input) - * return ret - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":239 - * ret = OrderedDict() - * for opt_input in self.__opt_inputs: - * ret[opt_input] = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_opt_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_v_opt_input); - __Pyx_GIVEREF(__pyx_v_opt_input); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_opt_input); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_v_opt_input, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":238 - * """ - * ret = OrderedDict() - * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< - * ret[opt_input] = self.__get_opt_input_value(opt_input) - * return ret - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":240 - * for opt_input in self.__opt_inputs: - * ret[opt_input] = self.__get_opt_input_value(opt_input) - * return ret # <<<<<<<<<<<<<< - * - * def set_parameters(self, parameters): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "talib/abstract.pyx":233 - * input_arrays = property(get_input_arrays, set_input_arrays) - * - * def get_parameters(self): # <<<<<<<<<<<<<< - * """ - * Returns the function's optional parameters and their default values. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("talib.abstract.Function.get_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_opt_input); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":242 - * return ret - * - * def set_parameters(self, parameters): # <<<<<<<<<<<<<< - * """ - * Sets the function parameter values. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_21set_parameters(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_20set_parameters[] = "\n Sets the function parameter values.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_21set_parameters = {"set_parameters", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_21set_parameters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_20set_parameters}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_21set_parameters(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_parameters = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_parameters (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parameters,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameters)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_parameters", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_parameters") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_parameters = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_parameters", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.Function.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_20set_parameters(__pyx_self, __pyx_v_self, __pyx_v_parameters); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_20set_parameters(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameters) { - PyObject *__pyx_v_param = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_parameters", 0); - - /* "talib/abstract.pyx":246 - * Sets the function parameter values. - * """ - * for param, value in parameters.items(): # <<<<<<<<<<<<<< - * self.__opt_inputs[param]['value'] = value - * self.__outputs_valid = False - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parameters, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L6_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); - __pyx_t_6 = 0; - - /* "talib/abstract.pyx":247 - * """ - * for param, value in parameters.items(): - * self.__opt_inputs[param]['value'] = value # <<<<<<<<<<<<<< - * self.__outputs_valid = False - * self.__info['parameters'] = self.parameters - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_v_param); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_value, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "talib/abstract.pyx":246 - * Sets the function parameter values. - * """ - * for param, value in parameters.items(): # <<<<<<<<<<<<<< - * self.__opt_inputs[param]['value'] = value - * self.__outputs_valid = False - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":248 - * for param, value in parameters.items(): - * self.__opt_inputs[param]['value'] = value - * self.__outputs_valid = False # <<<<<<<<<<<<<< - * self.__info['parameters'] = self.parameters - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":249 - * self.__opt_inputs[param]['value'] = value - * self.__outputs_valid = False - * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< - * - * parameters = property(get_parameters, set_parameters) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_s_parameters, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":242 - * return ret - * - * def set_parameters(self, parameters): # <<<<<<<<<<<<<< - * """ - * Sets the function parameter values. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("talib.abstract.Function.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_param); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":253 - * parameters = property(get_parameters, set_parameters) - * - * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_23set_function_args(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_22set_function_args[] = "\n optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_23set_function_args = {"set_function_args", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_23set_function_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_22set_function_args}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_23set_function_args(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_function_args (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); - if (unlikely(!__pyx_v_args)) { - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_v_args); - } else { - __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); - } - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - default: - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "set_function_args") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_function_args", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("talib.abstract.Function.set_function_args", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_22set_function_args(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_22set_function_args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - int __pyx_v_update_info; - PyObject *__pyx_v_key = NULL; - PyObject *__pyx_v_skip_first = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_param_name = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *(*__pyx_t_12)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_function_args", 0); - - /* "talib/abstract.pyx":257 - * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] - * """ - * update_info = False # <<<<<<<<<<<<<< - * - * for key in kwargs: - */ - __pyx_v_update_info = 0; - - /* "talib/abstract.pyx":259 - * update_info = False - * - * for key in kwargs: # <<<<<<<<<<<<<< - * if key in self.__opt_inputs: - * self.__opt_inputs[key]['value'] = kwargs[key] - */ - __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, ((PyObject *)NULL), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; - while (1) { - __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4); - if (unlikely(__pyx_t_6 == 0)) break; - if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":260 - * - * for key in kwargs: - * if key in self.__opt_inputs: # <<<<<<<<<<<<<< - * self.__opt_inputs[key]['value'] = kwargs[key] - * update_info = True - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = (__pyx_t_7 != 0); - if (__pyx_t_8) { - - /* "talib/abstract.pyx":261 - * for key in kwargs: - * if key in self.__opt_inputs: - * self.__opt_inputs[key]['value'] = kwargs[key] # <<<<<<<<<<<<<< - * update_info = True - * elif key in self.__input_names: - */ - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetItem(__pyx_t_9, __pyx_v_key); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_n_s_value, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":262 - * if key in self.__opt_inputs: - * self.__opt_inputs[key]['value'] = kwargs[key] - * update_info = True # <<<<<<<<<<<<<< - * elif key in self.__input_names: - * self.__input_names[key]['price_series'] = kwargs[key] - */ - __pyx_v_update_info = 1; - - /* "talib/abstract.pyx":260 - * - * for key in kwargs: - * if key in self.__opt_inputs: # <<<<<<<<<<<<<< - * self.__opt_inputs[key]['value'] = kwargs[key] - * update_info = True - */ - goto __pyx_L5; - } - - /* "talib/abstract.pyx":263 - * self.__opt_inputs[key]['value'] = kwargs[key] - * update_info = True - * elif key in self.__input_names: # <<<<<<<<<<<<<< - * self.__input_names[key]['price_series'] = kwargs[key] - * self.__info['input_names'][key] = kwargs[key] - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = (__pyx_t_8 != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":264 - * update_info = True - * elif key in self.__input_names: - * self.__input_names[key]['price_series'] = kwargs[key] # <<<<<<<<<<<<<< - * self.__info['input_names'][key] = kwargs[key] - * - */ - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyObject_GetItem(__pyx_t_10, __pyx_v_key); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_n_s_price_series, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":265 - * elif key in self.__input_names: - * self.__input_names[key]['price_series'] = kwargs[key] - * self.__info['input_names'][key] = kwargs[key] # <<<<<<<<<<<<<< - * - * if args: - */ - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetItem(__pyx_t_9, __pyx_n_s_input_names); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_v_key, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":263 - * self.__opt_inputs[key]['value'] = kwargs[key] - * update_info = True - * elif key in self.__input_names: # <<<<<<<<<<<<<< - * self.__input_names[key]['price_series'] = kwargs[key] - * self.__info['input_names'][key] = kwargs[key] - */ - } - __pyx_L5:; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":267 - * self.__info['input_names'][key] = kwargs[key] - * - * if args: # <<<<<<<<<<<<<< - * skip_first = 0 - * if self.set_input_arrays(args[0]): - */ - __pyx_t_7 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":268 - * - * if args: - * skip_first = 0 # <<<<<<<<<<<<<< - * if self.set_input_arrays(args[0]): - * skip_first = 1 - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_skip_first = __pyx_int_0; - - /* "talib/abstract.pyx":269 - * if args: - * skip_first = 0 - * if self.set_input_arrays(args[0]): # <<<<<<<<<<<<<< - * skip_first = 1 - * if len(args) > skip_first: - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_input_arrays); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_9) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":270 - * skip_first = 0 - * if self.set_input_arrays(args[0]): - * skip_first = 1 # <<<<<<<<<<<<<< - * if len(args) > skip_first: - * for i, param_name in enumerate(self.__opt_inputs): - */ - __Pyx_INCREF(__pyx_int_1); - __Pyx_DECREF_SET(__pyx_v_skip_first, __pyx_int_1); - - /* "talib/abstract.pyx":269 - * if args: - * skip_first = 0 - * if self.set_input_arrays(args[0]): # <<<<<<<<<<<<<< - * skip_first = 1 - * if len(args) > skip_first: - */ - } - - /* "talib/abstract.pyx":271 - * if self.set_input_arrays(args[0]): - * skip_first = 1 - * if len(args) > skip_first: # <<<<<<<<<<<<<< - * for i, param_name in enumerate(self.__opt_inputs): - * i += skip_first - */ - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_skip_first, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":272 - * skip_first = 1 - * if len(args) > skip_first: - * for i, param_name in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< - * i += skip_first - * if i < len(args): - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_t_5 = __pyx_int_0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_3 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_11)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_11)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_11); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_param_name, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_INCREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); - __pyx_t_5 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":273 - * if len(args) > skip_first: - * for i, param_name in enumerate(self.__opt_inputs): - * i += skip_first # <<<<<<<<<<<<<< - * if i < len(args): - * value = args[i] - */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_v_skip_first); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":274 - * for i, param_name in enumerate(self.__opt_inputs): - * i += skip_first - * if i < len(args): # <<<<<<<<<<<<<< - * value = args[i] - * self.__opt_inputs[param_name]['value'] = value - */ - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyObject_RichCompare(__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":275 - * i += skip_first - * if i < len(args): - * value = args[i] # <<<<<<<<<<<<<< - * self.__opt_inputs[param_name]['value'] = value - * update_info = True - */ - __pyx_t_10 = PyObject_GetItem(__pyx_v_args, __pyx_v_i); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10); - __pyx_t_10 = 0; - - /* "talib/abstract.pyx":276 - * if i < len(args): - * value = args[i] - * self.__opt_inputs[param_name]['value'] = value # <<<<<<<<<<<<<< - * update_info = True - * - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyObject_GetItem(__pyx_t_10, __pyx_v_param_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_value, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":277 - * value = args[i] - * self.__opt_inputs[param_name]['value'] = value - * update_info = True # <<<<<<<<<<<<<< - * - * if args or kwargs: - */ - __pyx_v_update_info = 1; - - /* "talib/abstract.pyx":274 - * for i, param_name in enumerate(self.__opt_inputs): - * i += skip_first - * if i < len(args): # <<<<<<<<<<<<<< - * value = args[i] - * self.__opt_inputs[param_name]['value'] = value - */ - } - - /* "talib/abstract.pyx":272 - * skip_first = 1 - * if len(args) > skip_first: - * for i, param_name in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< - * i += skip_first - * if i < len(args): - */ - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":271 - * if self.set_input_arrays(args[0]): - * skip_first = 1 - * if len(args) > skip_first: # <<<<<<<<<<<<<< - * for i, param_name in enumerate(self.__opt_inputs): - * i += skip_first - */ - } - - /* "talib/abstract.pyx":267 - * self.__info['input_names'][key] = kwargs[key] - * - * if args: # <<<<<<<<<<<<<< - * skip_first = 0 - * if self.set_input_arrays(args[0]): - */ - } - - /* "talib/abstract.pyx":279 - * update_info = True - * - * if args or kwargs: # <<<<<<<<<<<<<< - * if update_info: - * self.__info['parameters'] = self.parameters - */ - __pyx_t_8 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0); - if (!__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L13_bool_binop_done; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __pyx_t_8; - __pyx_L13_bool_binop_done:; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":280 - * - * if args or kwargs: - * if update_info: # <<<<<<<<<<<<<< - * self.__info['parameters'] = self.parameters - * self.__outputs_valid = False - */ - __pyx_t_7 = (__pyx_v_update_info != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":281 - * if args or kwargs: - * if update_info: - * self.__info['parameters'] = self.parameters # <<<<<<<<<<<<<< - * self.__outputs_valid = False - * - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parameters); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_n_s_parameters, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":280 - * - * if args or kwargs: - * if update_info: # <<<<<<<<<<<<<< - * self.__info['parameters'] = self.parameters - * self.__outputs_valid = False - */ - } - - /* "talib/abstract.pyx":282 - * if update_info: - * self.__info['parameters'] = self.parameters - * self.__outputs_valid = False # <<<<<<<<<<<<<< - * - * @property - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":279 - * update_info = True - * - * if args or kwargs: # <<<<<<<<<<<<<< - * if update_info: - * self.__info['parameters'] = self.parameters - */ - } - - /* "talib/abstract.pyx":253 - * parameters = property(get_parameters, set_parameters) - * - * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("talib.abstract.Function.set_function_args", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_skip_first); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_param_name); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":285 - * - * @property - * def lookback(self): # <<<<<<<<<<<<<< - * """ - * Returns the lookback window size for the function with the parameter - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_25lookback(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_24lookback[] = "\n Returns the lookback window size for the function with the parameter\n values that are currently set.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_25lookback = {"lookback", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_25lookback, METH_O, __pyx_doc_5talib_8abstract_8Function_24lookback}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_25lookback(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lookback (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_24lookback(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_24lookback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - TA_ParamHolder *__pyx_v_holder; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_opt_input = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_type_ = NULL; - int __pyx_v_lookback; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char *__pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - int __pyx_t_13; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lookback", 0); - - /* "talib/abstract.pyx":291 - * """ - * cdef lib.TA_ParamHolder *holder - * holder = __ta_paramHolderAlloc(self.__name) # <<<<<<<<<<<<<< - * for i, opt_input in enumerate(self.__opt_inputs): - * value = self.__get_opt_input_value(opt_input) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_holder = __pyx_f_5talib_8abstract___ta_paramHolderAlloc(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":292 - * cdef lib.TA_ParamHolder *holder - * holder = __ta_paramHolderAlloc(self.__name) - * for i, opt_input in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< - * value = self.__get_opt_input_value(opt_input) - * type_ = self.__opt_inputs[opt_input]['type'] - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_t_1 = __pyx_int_0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - - /* "talib/abstract.pyx":293 - * holder = __ta_paramHolderAlloc(self.__name) - * for i, opt_input in enumerate(self.__opt_inputs): - * value = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< - * type_ = self.__opt_inputs[opt_input]['type'] - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_8) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_opt_input); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_v_opt_input); - __Pyx_GIVEREF(__pyx_v_opt_input); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_opt_input); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; - - /* "talib/abstract.pyx":294 - * for i, opt_input in enumerate(self.__opt_inputs): - * value = self.__get_opt_input_value(opt_input) - * type_ = self.__opt_inputs[opt_input]['type'] # <<<<<<<<<<<<<< - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: - * __ta_setOptInputParamReal(holder, i, value) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_opt_input); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_type); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_3); - __pyx_t_3 = 0; - - /* "talib/abstract.pyx":295 - * value = self.__get_opt_input_value(opt_input) - * type_ = self.__opt_inputs[opt_input]['type'] - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: # <<<<<<<<<<<<<< - * __ta_setOptInputParamReal(holder, i, value) - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: - */ - __pyx_t_3 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_RealRange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_RealList); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __pyx_t_11; - __pyx_L6_bool_binop_done:; - if (__pyx_t_10) { - - /* "talib/abstract.pyx":296 - * type_ = self.__opt_inputs[opt_input]['type'] - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: - * __ta_setOptInputParamReal(holder, i, value) # <<<<<<<<<<<<<< - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: - * __ta_setOptInputParamInteger(holder, i, value) - */ - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_f_5talib_8abstract___ta_setOptInputParamReal(__pyx_v_holder, __pyx_t_12, __pyx_t_13); - - /* "talib/abstract.pyx":295 - * value = self.__get_opt_input_value(opt_input) - * type_ = self.__opt_inputs[opt_input]['type'] - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: # <<<<<<<<<<<<<< - * __ta_setOptInputParamReal(holder, i, value) - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: - */ - goto __pyx_L5; - } - - /* "talib/abstract.pyx":297 - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: - * __ta_setOptInputParamReal(holder, i, value) - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: # <<<<<<<<<<<<<< - * __ta_setOptInputParamInteger(holder, i, value) - * - */ - __pyx_t_3 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_IntegerRange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInput_IntegerList); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_type_, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __pyx_t_11; - __pyx_L8_bool_binop_done:; - if (__pyx_t_10) { - - /* "talib/abstract.pyx":298 - * __ta_setOptInputParamReal(holder, i, value) - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: - * __ta_setOptInputParamInteger(holder, i, value) # <<<<<<<<<<<<<< - * - * lookback = __ta_getLookback(holder) - */ - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_f_5talib_8abstract___ta_setOptInputParamInteger(__pyx_v_holder, __pyx_t_13, __pyx_t_12); - - /* "talib/abstract.pyx":297 - * if type_ == lib.TA_OptInput_RealRange or type_ == lib.TA_OptInput_RealList: - * __ta_setOptInputParamReal(holder, i, value) - * elif type_ == lib.TA_OptInput_IntegerRange or type_ == lib.TA_OptInput_IntegerList: # <<<<<<<<<<<<<< - * __ta_setOptInputParamInteger(holder, i, value) - * - */ - } - __pyx_L5:; - - /* "talib/abstract.pyx":292 - * cdef lib.TA_ParamHolder *holder - * holder = __ta_paramHolderAlloc(self.__name) - * for i, opt_input in enumerate(self.__opt_inputs): # <<<<<<<<<<<<<< - * value = self.__get_opt_input_value(opt_input) - * type_ = self.__opt_inputs[opt_input]['type'] - */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":300 - * __ta_setOptInputParamInteger(holder, i, value) - * - * lookback = __ta_getLookback(holder) # <<<<<<<<<<<<<< - * __ta_paramHolderFree(holder) - * return lookback - */ - __pyx_v_lookback = __pyx_f_5talib_8abstract___ta_getLookback(__pyx_v_holder); - - /* "talib/abstract.pyx":301 - * - * lookback = __ta_getLookback(holder) - * __ta_paramHolderFree(holder) # <<<<<<<<<<<<<< - * return lookback - * - */ - __pyx_f_5talib_8abstract___ta_paramHolderFree(__pyx_v_holder); - - /* "talib/abstract.pyx":302 - * lookback = __ta_getLookback(holder) - * __ta_paramHolderFree(holder) - * return lookback # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_lookback); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":285 - * - * @property - * def lookback(self): # <<<<<<<<<<<<<< - * """ - * Returns the lookback window size for the function with the parameter - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("talib.abstract.Function.lookback", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_opt_input); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_type_); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":305 - * - * @property - * def output_names(self): # <<<<<<<<<<<<<< - * """ - * Returns a list of the output names returned by this function. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_27output_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_26output_names[] = "\n Returns a list of the output names returned by this function.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_27output_names = {"output_names", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_27output_names, METH_O, __pyx_doc_5talib_8abstract_8Function_26output_names}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_27output_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("output_names (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_26output_names(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_26output_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("output_names", 0); - - /* "talib/abstract.pyx":309 - * Returns a list of the output names returned by this function. - * """ - * ret = self.__outputs.keys() # <<<<<<<<<<<<<< - * if not isinstance(ret, list): - * ret = list(ret) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":310 - * """ - * ret = self.__outputs.keys() - * if not isinstance(ret, list): # <<<<<<<<<<<<<< - * ret = list(ret) - * return ret - */ - __pyx_t_4 = PyList_Check(__pyx_v_ret); - __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); - if (__pyx_t_5) { - - /* "talib/abstract.pyx":311 - * ret = self.__outputs.keys() - * if not isinstance(ret, list): - * ret = list(ret) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_1 = PySequence_List(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":310 - * """ - * ret = self.__outputs.keys() - * if not isinstance(ret, list): # <<<<<<<<<<<<<< - * ret = list(ret) - * return ret - */ - } - - /* "talib/abstract.pyx":312 - * if not isinstance(ret, list): - * ret = list(ret) - * return ret # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "talib/abstract.pyx":305 - * - * @property - * def output_names(self): # <<<<<<<<<<<<<< - * """ - * Returns a list of the output names returned by this function. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.output_names", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":315 - * - * @property - * def outputs(self): # <<<<<<<<<<<<<< - * """ - * Returns the TA function values for the currently set input_arrays and - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_29outputs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_28outputs[] = "\n Returns the TA function values for the currently set input_arrays and\n parameters. Returned values are a ndarray if there is only one output\n or a list of ndarrays for more than one output.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_29outputs = {"outputs", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_29outputs, METH_O, __pyx_doc_5talib_8abstract_8Function_28outputs}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_29outputs(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("outputs (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_28outputs(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_28outputs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_v_index = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("outputs", 0); - - /* "talib/abstract.pyx":321 - * or a list of ndarrays for more than one output. - * """ - * if not self.__outputs_valid: # <<<<<<<<<<<<<< - * self.__call_function() - * ret = self.__outputs.values() - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = ((!__pyx_t_2) != 0); - if (__pyx_t_3) { - - /* "talib/abstract.pyx":322 - * """ - * if not self.__outputs_valid: - * self.__call_function() # <<<<<<<<<<<<<< - * ret = self.__outputs.values() - * if not isinstance(ret, list): - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":321 - * or a list of ndarrays for more than one output. - * """ - * if not self.__outputs_valid: # <<<<<<<<<<<<<< - * self.__call_function() - * ret = self.__outputs.values() - */ - } - - /* "talib/abstract.pyx":323 - * if not self.__outputs_valid: - * self.__call_function() - * ret = self.__outputs.values() # <<<<<<<<<<<<<< - * if not isinstance(ret, list): - * ret = list(ret) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":324 - * self.__call_function() - * ret = self.__outputs.values() - * if not isinstance(ret, list): # <<<<<<<<<<<<<< - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ - */ - __pyx_t_3 = PyList_Check(__pyx_v_ret); - __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); - if (__pyx_t_2) { - - /* "talib/abstract.pyx":325 - * ret = self.__outputs.values() - * if not isinstance(ret, list): - * ret = list(ret) # <<<<<<<<<<<<<< - * if __PANDAS_DATAFRAME is not None and \ - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - */ - __pyx_t_1 = PySequence_List(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":324 - * self.__call_function() - * ret = self.__outputs.values() - * if not isinstance(ret, list): # <<<<<<<<<<<<<< - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ - */ - } - - /* "talib/abstract.pyx":326 - * if not isinstance(ret, list): - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__pyx_t_1 != Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = (__pyx_t_3 != 0); - if (__pyx_t_6) { - } else { - __pyx_t_2 = __pyx_t_6; - goto __pyx_L6_bool_binop_done; - } - - /* "talib/abstract.pyx":327 - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): # <<<<<<<<<<<<<< - * index = self.__input_arrays.index - * if len(ret) == 1: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_IsInstance(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__pyx_t_6 != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L6_bool_binop_done:; - - /* "talib/abstract.pyx":326 - * if not isinstance(ret, list): - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index - */ - if (__pyx_t_2) { - - /* "talib/abstract.pyx":328 - * if __PANDAS_DATAFRAME is not None and \ - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index # <<<<<<<<<<<<<< - * if len(ret) == 1: - * return __PANDAS_SERIES(ret[0], index=index) - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_index = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":329 - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index - * if len(ret) == 1: # <<<<<<<<<<<<<< - * return __PANDAS_SERIES(ret[0], index=index) - * else: - */ - __pyx_t_7 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((__pyx_t_7 == 1) != 0); - if (__pyx_t_2) { - - /* "talib/abstract.pyx":330 - * index = self.__input_arrays.index - * if len(ret) == 1: - * return __PANDAS_SERIES(ret[0], index=index) # <<<<<<<<<<<<<< - * else: - * return __PANDAS_DATAFRAME(numpy.column_stack(ret), - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":329 - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index - * if len(ret) == 1: # <<<<<<<<<<<<<< - * return __PANDAS_SERIES(ret[0], index=index) - * else: - */ - } - - /* "talib/abstract.pyx":332 - * return __PANDAS_SERIES(ret[0], index=index) - * else: - * return __PANDAS_DATAFRAME(numpy.column_stack(ret), # <<<<<<<<<<<<<< - * index=index, - * columns=self.output_names) - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_DATAFRAME); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_column_stack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_4) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_v_ret); - __Pyx_GIVEREF(__pyx_v_ret); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_ret); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":333 - * else: - * return __PANDAS_DATAFRAME(numpy.column_stack(ret), - * index=index, # <<<<<<<<<<<<<< - * columns=self.output_names) - * else: - */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":334 - * return __PANDAS_DATAFRAME(numpy.column_stack(ret), - * index=index, - * columns=self.output_names) # <<<<<<<<<<<<<< - * else: - * return ret[0] if len(ret) == 1 else ret - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_names); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_columns, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":332 - * return __PANDAS_SERIES(ret[0], index=index) - * else: - * return __PANDAS_DATAFRAME(numpy.column_stack(ret), # <<<<<<<<<<<<<< - * index=index, - * columns=self.output_names) - */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - } - - /* "talib/abstract.pyx":326 - * if not isinstance(ret, list): - * ret = list(ret) - * if __PANDAS_DATAFRAME is not None and \ # <<<<<<<<<<<<<< - * isinstance(self.__input_arrays, __PANDAS_DATAFRAME): - * index = self.__input_arrays.index - */ - } - - /* "talib/abstract.pyx":336 - * columns=self.output_names) - * else: - * return ret[0] if len(ret) == 1 else ret # <<<<<<<<<<<<<< - * - * def run(self, input_arrays=None): - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (((__pyx_t_7 == 1) != 0)) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __pyx_t_5; - __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_v_ret); - __pyx_t_9 = __pyx_v_ret; - } - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - } - - /* "talib/abstract.pyx":315 - * - * @property - * def outputs(self): # <<<<<<<<<<<<<< - * """ - * Returns the TA function values for the currently set input_arrays and - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("talib.abstract.Function.outputs", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_index); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":338 - * return ret[0] if len(ret) == 1 else ret - * - * def run(self, input_arrays=None): # <<<<<<<<<<<<<< - * """ - * run([input_arrays=None]) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_31run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_30run[] = "\n run([input_arrays=None])\n\n This is a shortcut to the outputs property that also allows setting\n the input_arrays dict.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_31run = {"run", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_31run, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_30run}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_31run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_input_arrays = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("run (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_arrays,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)((PyObject *)Py_None)); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_arrays); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_input_arrays = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("run", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.Function.run", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_30run(__pyx_self, __pyx_v_self, __pyx_v_input_arrays); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_30run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_arrays) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("run", 0); - - /* "talib/abstract.pyx":345 - * the input_arrays dict. - * """ - * if input_arrays: # <<<<<<<<<<<<<< - * self.set_input_arrays(input_arrays) - * self.__call_function() - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_input_arrays); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_1) { - - /* "talib/abstract.pyx":346 - * """ - * if input_arrays: - * self.set_input_arrays(input_arrays) # <<<<<<<<<<<<<< - * self.__call_function() - * return self.outputs - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_input_arrays); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_input_arrays); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_v_input_arrays); - __Pyx_GIVEREF(__pyx_v_input_arrays); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_input_arrays); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":345 - * the input_arrays dict. - * """ - * if input_arrays: # <<<<<<<<<<<<<< - * self.set_input_arrays(input_arrays) - * self.__call_function() - */ - } - - /* "talib/abstract.pyx":347 - * if input_arrays: - * self.set_input_arrays(input_arrays) - * self.__call_function() # <<<<<<<<<<<<<< - * return self.outputs - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":348 - * self.set_input_arrays(input_arrays) - * self.__call_function() - * return self.outputs # <<<<<<<<<<<<<< - * - * def __call__(self, *args, **kwargs): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":338 - * return ret[0] if len(ret) == 1 else ret - * - * def run(self, input_arrays=None): # <<<<<<<<<<<<<< - * """ - * run([input_arrays=None]) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.abstract.Function.run", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":350 - * return self.outputs - * - * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_33__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_32__call__[] = "\n func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs])\n\n This is a shortcut to the outputs property that also allows setting\n the input_arrays dict and function parameters.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_33__call__ = {"__call__", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_33__call__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_32__call__}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_33__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); - if (unlikely(!__pyx_v_args)) { - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_v_args); - } else { - __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); - } - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - default: - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("talib.abstract.Function.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_32__call__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_32__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); - - /* "talib/abstract.pyx":357 - * the input_arrays dict and function parameters. - * """ - * self.set_function_args(*args, **kwargs) # <<<<<<<<<<<<<< - * self.__call_function() - * return self.outputs - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_function_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":358 - * """ - * self.set_function_args(*args, **kwargs) - * self.__call_function() # <<<<<<<<<<<<<< - * return self.outputs - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__call_function); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":359 - * self.set_function_args(*args, **kwargs) - * self.__call_function() - * return self.outputs # <<<<<<<<<<<<<< - * - * # figure out which price series names we're using for inputs - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":350 - * return self.outputs - * - * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":362 - * - * # figure out which price series names we're using for inputs - * def __input_price_series_names(self): # <<<<<<<<<<<<<< - * input_price_series_names = [] - * for input_name in self.__input_names: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_35__input_price_series_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_35__input_price_series_names = {"__input_price_series_names", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_35__input_price_series_names, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_35__input_price_series_names(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__input_price_series_names (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_34__input_price_series_names(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_34__input_price_series_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_input_price_series_names = NULL; - PyObject *__pyx_v_input_name = NULL; - PyObject *__pyx_v_price_series = NULL; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__input_price_series_names", 0); - - /* "talib/abstract.pyx":363 - * # figure out which price series names we're using for inputs - * def __input_price_series_names(self): - * input_price_series_names = [] # <<<<<<<<<<<<<< - * for input_name in self.__input_names: - * price_series = self.__input_names[input_name]['price_series'] - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_input_price_series_names = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":364 - * def __input_price_series_names(self): - * input_price_series_names = [] - * for input_name in self.__input_names: # <<<<<<<<<<<<<< - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":365 - * input_price_series_names = [] - * for input_name in self.__input_names: - * price_series = self.__input_names[input_name]['price_series'] # <<<<<<<<<<<<<< - * if isinstance(price_series, list): # TALIB-supplied input names - * for name in price_series: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_price_series); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":366 - * for input_name in self.__input_names: - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names # <<<<<<<<<<<<<< - * for name in price_series: - * input_price_series_names.append(name) - */ - __pyx_t_6 = PyList_Check(__pyx_v_price_series); - __pyx_t_7 = (__pyx_t_6 != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":367 - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names - * for name in price_series: # <<<<<<<<<<<<<< - * input_price_series_names.append(name) - * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS - */ - if (likely(PyList_CheckExact(__pyx_v_price_series)) || PyTuple_CheckExact(__pyx_v_price_series)) { - __pyx_t_1 = __pyx_v_price_series; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_price_series); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - #endif - } - } else { - __pyx_t_5 = __pyx_t_9(__pyx_t_1); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":368 - * if isinstance(price_series, list): # TALIB-supplied input names - * for name in price_series: - * input_price_series_names.append(name) # <<<<<<<<<<<<<< - * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS - * input_price_series_names.append(price_series) - */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_input_price_series_names, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":367 - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names - * for name in price_series: # <<<<<<<<<<<<<< - * input_price_series_names.append(name) - * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":366 - * for input_name in self.__input_names: - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names # <<<<<<<<<<<<<< - * for name in price_series: - * input_price_series_names.append(name) - */ - goto __pyx_L5; - } - - /* "talib/abstract.pyx":370 - * input_price_series_names.append(name) - * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS - * input_price_series_names.append(price_series) # <<<<<<<<<<<<<< - * return input_price_series_names - * - */ - /*else*/ { - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_input_price_series_names, __pyx_v_price_series); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L5:; - - /* "talib/abstract.pyx":364 - * def __input_price_series_names(self): - * input_price_series_names = [] - * for input_name in self.__input_names: # <<<<<<<<<<<<<< - * price_series = self.__input_names[input_name]['price_series'] - * if isinstance(price_series, list): # TALIB-supplied input names - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":371 - * else: # name came from __INPUT_PRICE_SERIES_DEFAULTS - * input_price_series_names.append(price_series) - * return input_price_series_names # <<<<<<<<<<<<<< - * - * def __call_function(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_input_price_series_names); - __pyx_r = __pyx_v_input_price_series_names; - goto __pyx_L0; - - /* "talib/abstract.pyx":362 - * - * # figure out which price series names we're using for inputs - * def __input_price_series_names(self): # <<<<<<<<<<<<<< - * input_price_series_names = [] - * for input_name in self.__input_names: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.abstract.Function.__input_price_series_names", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_input_price_series_names); - __Pyx_XDECREF(__pyx_v_input_name); - __Pyx_XDECREF(__pyx_v_price_series); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":373 - * return input_price_series_names - * - * def __call_function(self): # <<<<<<<<<<<<<< - * input_price_series_names = self.__input_price_series_names() - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_37__call_function(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_37__call_function = {"__call_function", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_37__call_function, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_37__call_function(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call_function (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_36__call_function(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_36__call_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_input_price_series_names = NULL; - PyObject *__pyx_v_args = NULL; - PyObject *__pyx_v_price_series = NULL; - PyObject *__pyx_v_series = NULL; - PyObject *__pyx_v_opt_input = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_results = NULL; - PyObject *__pyx_v_keys = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_output = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call_function", 0); - - /* "talib/abstract.pyx":374 - * - * def __call_function(self): - * input_price_series_names = self.__input_price_series_names() # <<<<<<<<<<<<<< - * - * # populate the ordered args we'll call the function with - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_price_series_na); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_input_price_series_names = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":377 - * - * # populate the ordered args we'll call the function with - * args = [] # <<<<<<<<<<<<<< - * for price_series in input_price_series_names: - * series = self.__input_arrays[price_series] - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_args = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":378 - * # populate the ordered args we'll call the function with - * args = [] - * for price_series in input_price_series_names: # <<<<<<<<<<<<<< - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ - */ - if (likely(PyList_CheckExact(__pyx_v_input_price_series_names)) || PyTuple_CheckExact(__pyx_v_input_price_series_names)) { - __pyx_t_1 = __pyx_v_input_price_series_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_input_price_series_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_v_price_series, __pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":379 - * args = [] - * for price_series in input_price_series_names: - * series = self.__input_arrays[price_series] # <<<<<<<<<<<<<< - * if __PANDAS_SERIES is not None and \ - * isinstance(series, __PANDAS_SERIES): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__input_arrays); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_price_series); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_series, __pyx_t_3); - __pyx_t_3 = 0; - - /* "talib/abstract.pyx":380 - * for price_series in input_price_series_names: - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< - * isinstance(series, __PANDAS_SERIES): - * series = series.values - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (__pyx_t_3 != Py_None); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = (__pyx_t_7 != 0); - if (__pyx_t_8) { - } else { - __pyx_t_6 = __pyx_t_8; - goto __pyx_L6_bool_binop_done; - } - - /* "talib/abstract.pyx":381 - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ - * isinstance(series, __PANDAS_SERIES): # <<<<<<<<<<<<<< - * series = series.values - * args.append(series) - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PANDAS_SERIES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_IsInstance(__pyx_v_series, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = (__pyx_t_8 != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L6_bool_binop_done:; - - /* "talib/abstract.pyx":380 - * for price_series in input_price_series_names: - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< - * isinstance(series, __PANDAS_SERIES): - * series = series.values - */ - if (__pyx_t_6) { - - /* "talib/abstract.pyx":382 - * if __PANDAS_SERIES is not None and \ - * isinstance(series, __PANDAS_SERIES): - * series = series.values # <<<<<<<<<<<<<< - * args.append(series) - * for opt_input in self.__opt_inputs: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_series, __pyx_t_3); - __pyx_t_3 = 0; - - /* "talib/abstract.pyx":380 - * for price_series in input_price_series_names: - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ # <<<<<<<<<<<<<< - * isinstance(series, __PANDAS_SERIES): - * series = series.values - */ - } - - /* "talib/abstract.pyx":383 - * isinstance(series, __PANDAS_SERIES): - * series = series.values - * args.append(series) # <<<<<<<<<<<<<< - * for opt_input in self.__opt_inputs: - * value = self.__get_opt_input_value(opt_input) - */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_series); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":378 - * # populate the ordered args we'll call the function with - * args = [] - * for price_series in input_price_series_names: # <<<<<<<<<<<<<< - * series = self.__input_arrays[price_series] - * if __PANDAS_SERIES is not None and \ - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":384 - * series = series.values - * args.append(series) - * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< - * value = self.__get_opt_input_value(opt_input) - * args.append(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_opt_input, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":385 - * args.append(series) - * for opt_input in self.__opt_inputs: - * value = self.__get_opt_input_value(opt_input) # <<<<<<<<<<<<<< - * args.append(value) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__get_opt_input_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_10) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_opt_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_v_opt_input); - __Pyx_GIVEREF(__pyx_v_opt_input); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_opt_input); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":386 - * for opt_input in self.__opt_inputs: - * value = self.__get_opt_input_value(opt_input) - * args.append(value) # <<<<<<<<<<<<<< - * - * # Use the func module to actually call the function. - */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_value); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":384 - * series = series.values - * args.append(series) - * for opt_input in self.__opt_inputs: # <<<<<<<<<<<<<< - * value = self.__get_opt_input_value(opt_input) - * args.append(value) - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/abstract.pyx":389 - * - * # Use the func module to actually call the function. - * results = func_c.__getattribute__(self.__namestr)(*args) # <<<<<<<<<<<<<< - * if isinstance(results, np.ndarray): - * keys = self.__outputs.keys() - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_func_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__namestr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_11) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_results = __pyx_t_10; - __pyx_t_10 = 0; - - /* "talib/abstract.pyx":390 - * # Use the func module to actually call the function. - * results = func_c.__getattribute__(self.__namestr)(*args) - * if isinstance(results, np.ndarray): # <<<<<<<<<<<<<< - * keys = self.__outputs.keys() - * if not isinstance(keys, list): - */ - __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_results, __pyx_ptype_5numpy_ndarray); - __pyx_t_7 = (__pyx_t_6 != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":391 - * results = func_c.__getattribute__(self.__namestr)(*args) - * if isinstance(results, np.ndarray): - * keys = self.__outputs.keys() # <<<<<<<<<<<<<< - * if not isinstance(keys, list): - * keys = list(keys) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_keys = __pyx_t_10; - __pyx_t_10 = 0; - - /* "talib/abstract.pyx":392 - * if isinstance(results, np.ndarray): - * keys = self.__outputs.keys() - * if not isinstance(keys, list): # <<<<<<<<<<<<<< - * keys = list(keys) - * self.__outputs[keys[0]] = results - */ - __pyx_t_7 = PyList_Check(__pyx_v_keys); - __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); - if (__pyx_t_6) { - - /* "talib/abstract.pyx":393 - * keys = self.__outputs.keys() - * if not isinstance(keys, list): - * keys = list(keys) # <<<<<<<<<<<<<< - * self.__outputs[keys[0]] = results - * else: - */ - __pyx_t_10 = PySequence_List(__pyx_v_keys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_10); - __pyx_t_10 = 0; - - /* "talib/abstract.pyx":392 - * if isinstance(results, np.ndarray): - * keys = self.__outputs.keys() - * if not isinstance(keys, list): # <<<<<<<<<<<<<< - * keys = list(keys) - * self.__outputs[keys[0]] = results - */ - } - - /* "talib/abstract.pyx":394 - * if not isinstance(keys, list): - * keys = list(keys) - * self.__outputs[keys[0]] = results # <<<<<<<<<<<<<< - * else: - * for i, output in enumerate(self.__outputs): - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_keys, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_t_3, __pyx_v_results) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/abstract.pyx":390 - * # Use the func module to actually call the function. - * results = func_c.__getattribute__(self.__namestr)(*args) - * if isinstance(results, np.ndarray): # <<<<<<<<<<<<<< - * keys = self.__outputs.keys() - * if not isinstance(keys, list): - */ - goto __pyx_L10; - } - - /* "talib/abstract.pyx":396 - * self.__outputs[keys[0]] = results - * else: - * for i, output in enumerate(self.__outputs): # <<<<<<<<<<<<<< - * self.__outputs[output] = results[i] - * self.__outputs_valid = True - */ - /*else*/ { - __Pyx_INCREF(__pyx_int_0); - __pyx_t_3 = __pyx_int_0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { - __pyx_t_2 = __pyx_t_10; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - #endif - } - } else { - __pyx_t_10 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_10)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_10); - } - __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_10); - __pyx_t_10 = 0; - __Pyx_INCREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_10; - __pyx_t_10 = 0; - - /* "talib/abstract.pyx":397 - * else: - * for i, output in enumerate(self.__outputs): - * self.__outputs[output] = results[i] # <<<<<<<<<<<<<< - * self.__outputs_valid = True - * - */ - __pyx_t_10 = PyObject_GetItem(__pyx_v_results, __pyx_v_i); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_output, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "talib/abstract.pyx":396 - * self.__outputs[keys[0]] = results - * else: - * for i, output in enumerate(self.__outputs): # <<<<<<<<<<<<<< - * self.__outputs[output] = results[i] - * self.__outputs_valid = True - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_L10:; - - /* "talib/abstract.pyx":398 - * for i, output in enumerate(self.__outputs): - * self.__outputs[output] = results[i] - * self.__outputs_valid = True # <<<<<<<<<<<<<< - * - * def __get_opt_input_value(self, input_name): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Function__outputs_valid, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":373 - * return input_price_series_names - * - * def __call_function(self): # <<<<<<<<<<<<<< - * input_price_series_names = self.__input_price_series_names() - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("talib.abstract.Function.__call_function", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_input_price_series_names); - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_price_series); - __Pyx_XDECREF(__pyx_v_series); - __Pyx_XDECREF(__pyx_v_opt_input); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_results); - __Pyx_XDECREF(__pyx_v_keys); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_output); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":400 - * self.__outputs_valid = True - * - * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< - * """ - * Returns the user-set value if there is one, otherwise the default. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_39__get_opt_input_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_8Function_38__get_opt_input_value[] = "\n Returns the user-set value if there is one, otherwise the default.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_39__get_opt_input_value = {"__get_opt_input_value", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_39__get_opt_input_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_8Function_38__get_opt_input_value}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_39__get_opt_input_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_input_name = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get_opt_input_value (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_input_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__get_opt_input_value", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get_opt_input_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_input_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__get_opt_input_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.Function.__get_opt_input_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_8Function_38__get_opt_input_value(__pyx_self, __pyx_v_self, __pyx_v_input_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_38__get_opt_input_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_name) { - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get_opt_input_value", 0); - - /* "talib/abstract.pyx":404 - * Returns the user-set value if there is one, otherwise the default. - * """ - * value = self.__opt_inputs[input_name]['value'] # <<<<<<<<<<<<<< - * if value is None: - * value = self.__opt_inputs[input_name]['default_value'] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_value); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_value = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":405 - * """ - * value = self.__opt_inputs[input_name]['value'] - * if value is None: # <<<<<<<<<<<<<< - * value = self.__opt_inputs[input_name]['default_value'] - * return value - */ - __pyx_t_3 = (__pyx_v_value == Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "talib/abstract.pyx":406 - * value = self.__opt_inputs[input_name]['value'] - * if value is None: - * value = self.__opt_inputs[input_name]['default_value'] # <<<<<<<<<<<<<< - * return value - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Function__opt_inputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_input_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_default_value); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":405 - * """ - * value = self.__opt_inputs[input_name]['value'] - * if value is None: # <<<<<<<<<<<<<< - * value = self.__opt_inputs[input_name]['default_value'] - * return value - */ - } - - /* "talib/abstract.pyx":407 - * if value is None: - * value = self.__opt_inputs[input_name]['default_value'] - * return value # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_value); - __pyx_r = __pyx_v_value; - goto __pyx_L0; - - /* "talib/abstract.pyx":400 - * self.__outputs_valid = True - * - * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< - * """ - * Returns the user-set value if there is one, otherwise the default. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.abstract.Function.__get_opt_input_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":409 - * return value - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return '%s' % self.info - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_41__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_41__repr__ = {"__repr__", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_41__repr__, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_41__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_40__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_40__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - - /* "talib/abstract.pyx":410 - * - * def __repr__(self): - * return '%s' % self.info # <<<<<<<<<<<<<< - * - * def __unicode__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":409 - * return value - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return '%s' % self.info - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.abstract.Function.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":412 - * return '%s' % self.info - * - * def __unicode__(self): # <<<<<<<<<<<<<< - * return unicode(self.__str__()) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_43__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_43__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_43__unicode__, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_43__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_42__unicode__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_42__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__unicode__", 0); - - /* "talib/abstract.pyx":413 - * - * def __unicode__(self): - * return unicode(self.__str__()) # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":412 - * return '%s' % self.info - * - * def __unicode__(self): # <<<<<<<<<<<<<< - * return unicode(self.__str__()) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.abstract.Function.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":415 - * return unicode(self.__str__()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_8Function_45__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_8abstract_8Function_45__str__ = {"__str__", (PyCFunction)__pyx_pw_5talib_8abstract_8Function_45__str__, METH_O, 0}; -static PyObject *__pyx_pw_5talib_8abstract_8Function_45__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8Function_44__str__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8Function_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 0); - - /* "talib/abstract.pyx":416 - * - * def __str__(self): - * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_defaults_and_docs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":415 - * return unicode(self.__str__()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.abstract.Function.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":429 - * # therefore recommended over using these functions directly. - * - * def _ta_getGroupTable(): # <<<<<<<<<<<<<< - * """ - * Returns the list of available TALIB function group names. *slow* - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_9_ta_getGroupTable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5talib_8abstract_8_ta_getGroupTable[] = "\n Returns the list of available TALIB function group names. *slow*\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_9_ta_getGroupTable = {"_ta_getGroupTable", (PyCFunction)__pyx_pw_5talib_8abstract_9_ta_getGroupTable, METH_NOARGS, __pyx_doc_5talib_8abstract_8_ta_getGroupTable}; -static PyObject *__pyx_pw_5talib_8abstract_9_ta_getGroupTable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getGroupTable (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_8_ta_getGroupTable(__pyx_self); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_8_ta_getGroupTable(CYTHON_UNUSED PyObject *__pyx_self) { - TA_StringTable *__pyx_v_table; - PyObject *__pyx_v_groups = NULL; - unsigned int __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - unsigned int __pyx_t_8; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getGroupTable", 0); - - /* "talib/abstract.pyx":434 - * """ - * cdef lib.TA_StringTable *table - * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) # <<<<<<<<<<<<<< - * groups = [] - * for i in xrange(table.size): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(TA_GroupTableAlloc((&__pyx_v_table))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GroupTableAlloc); - __Pyx_GIVEREF(__pyx_n_s_TA_GroupTableAlloc); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GroupTableAlloc); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":435 - * cdef lib.TA_StringTable *table - * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) - * groups = [] # <<<<<<<<<<<<<< - * for i in xrange(table.size): - * groups.append(deref(&table.string[i])) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_groups = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":436 - * _ta_check_success('TA_GroupTableAlloc', lib.TA_GroupTableAlloc(&table)) - * groups = [] - * for i in xrange(table.size): # <<<<<<<<<<<<<< - * groups.append(deref(&table.string[i])) - * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) - */ - __pyx_t_7 = __pyx_v_table->size; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - - /* "talib/abstract.pyx":437 - * groups = [] - * for i in xrange(table.size): - * groups.append(deref(&table.string[i])) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) - * return groups - */ - __pyx_t_1 = __Pyx_PyBytes_FromString((*(&(__pyx_v_table->string[__pyx_v_i])))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_groups, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "talib/abstract.pyx":438 - * for i in xrange(table.size): - * groups.append(deref(&table.string[i])) - * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) # <<<<<<<<<<<<<< - * return groups - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_TA_RetCode(TA_GroupTableFree(__pyx_v_table)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GroupTableFree); - __Pyx_GIVEREF(__pyx_n_s_TA_GroupTableFree); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_n_s_TA_GroupTableFree); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":439 - * groups.append(deref(&table.string[i])) - * _ta_check_success('TA_GroupTableFree', lib.TA_GroupTableFree(table)) - * return groups # <<<<<<<<<<<<<< - * - * def _ta_getFuncTable(char *group): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_groups); - __pyx_r = __pyx_v_groups; - goto __pyx_L0; - - /* "talib/abstract.pyx":429 - * # therefore recommended over using these functions directly. - * - * def _ta_getGroupTable(): # <<<<<<<<<<<<<< - * """ - * Returns the list of available TALIB function group names. *slow* - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("talib.abstract._ta_getGroupTable", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_groups); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":441 - * return groups - * - * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< - * """ - * Returns a list of the functions for the specified group name. *slow* - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_11_ta_getFuncTable(PyObject *__pyx_self, PyObject *__pyx_arg_group); /*proto*/ -static char __pyx_doc_5talib_8abstract_10_ta_getFuncTable[] = "\n Returns a list of the functions for the specified group name. *slow*\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_11_ta_getFuncTable = {"_ta_getFuncTable", (PyCFunction)__pyx_pw_5talib_8abstract_11_ta_getFuncTable, METH_O, __pyx_doc_5talib_8abstract_10_ta_getFuncTable}; -static PyObject *__pyx_pw_5talib_8abstract_11_ta_getFuncTable(PyObject *__pyx_self, PyObject *__pyx_arg_group) { - char *__pyx_v_group; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getFuncTable (wrapper)", 0); - assert(__pyx_arg_group); { - __pyx_v_group = __Pyx_PyObject_AsString(__pyx_arg_group); if (unlikely((!__pyx_v_group) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract._ta_getFuncTable", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_10_ta_getFuncTable(__pyx_self, ((char *)__pyx_v_group)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_10_ta_getFuncTable(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_group) { - TA_StringTable *__pyx_v_table; - PyObject *__pyx_v_functions = NULL; - unsigned int __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - unsigned int __pyx_t_8; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getFuncTable", 0); - - /* "talib/abstract.pyx":446 - * """ - * cdef lib.TA_StringTable *table - * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) # <<<<<<<<<<<<<< - * functions = [] - * for i in xrange(table.size): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(TA_FuncTableAlloc(__pyx_v_group, (&__pyx_v_table))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_FuncTableAlloc); - __Pyx_GIVEREF(__pyx_n_s_TA_FuncTableAlloc); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_FuncTableAlloc); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":447 - * cdef lib.TA_StringTable *table - * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) - * functions = [] # <<<<<<<<<<<<<< - * for i in xrange(table.size): - * functions.append(deref(&table.string[i])) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_functions = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":448 - * _ta_check_success('TA_FuncTableAlloc', lib.TA_FuncTableAlloc(group, &table)) - * functions = [] - * for i in xrange(table.size): # <<<<<<<<<<<<<< - * functions.append(deref(&table.string[i])) - * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) - */ - __pyx_t_7 = __pyx_v_table->size; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - - /* "talib/abstract.pyx":449 - * functions = [] - * for i in xrange(table.size): - * functions.append(deref(&table.string[i])) # <<<<<<<<<<<<<< - * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) - * return functions - */ - __pyx_t_1 = __Pyx_PyBytes_FromString((*(&(__pyx_v_table->string[__pyx_v_i])))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_functions, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "talib/abstract.pyx":450 - * for i in xrange(table.size): - * functions.append(deref(&table.string[i])) - * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) # <<<<<<<<<<<<<< - * return functions - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_TA_RetCode(TA_FuncTableFree(__pyx_v_table)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_FuncTableFree); - __Pyx_GIVEREF(__pyx_n_s_TA_FuncTableFree); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_n_s_TA_FuncTableFree); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":451 - * functions.append(deref(&table.string[i])) - * _ta_check_success('TA_FuncTableFree', lib.TA_FuncTableFree(table)) - * return functions # <<<<<<<<<<<<<< - * - * def __get_flags(int flag, dict flags_lookup_dict): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_functions); - __pyx_r = __pyx_v_functions; - goto __pyx_L0; - - /* "talib/abstract.pyx":441 - * return groups - * - * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< - * """ - * Returns a list of the functions for the specified group name. *slow* - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("talib.abstract._ta_getFuncTable", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_functions); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":453 - * return functions - * - * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< - * """ - * TA-LIB provides hints for multiple flags as a bitwise-ORed int. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_13__get_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_12__get_flags[] = "\n TA-LIB provides hints for multiple flags as a bitwise-ORed int.\n This function returns the flags from flag found in the provided\n flags_lookup_dict.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_13__get_flags = {"__get_flags", (PyCFunction)__pyx_pw_5talib_8abstract_13__get_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_12__get_flags}; -static PyObject *__pyx_pw_5talib_8abstract_13__get_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_v_flag; - PyObject *__pyx_v_flags_lookup_dict = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get_flags (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_flags_lookup_dict,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags_lookup_dict)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__get_flags", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get_flags") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_flag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_flags_lookup_dict = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__get_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract.__get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flags_lookup_dict), (&PyDict_Type), 1, "flags_lookup_dict", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_5talib_8abstract_12__get_flags(__pyx_self, __pyx_v_flag, __pyx_v_flags_lookup_dict); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_12__get_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flag, PyObject *__pyx_v_flags_lookup_dict) { - PyObject *__pyx_v_value_range = NULL; - PyObject *__pyx_v_min_int = NULL; - PyObject *__pyx_v_max_int = NULL; - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get_flags", 0); - - /* "talib/abstract.pyx":459 - * flags_lookup_dict. - * """ - * value_range = flags_lookup_dict.keys() # <<<<<<<<<<<<<< - * if not isinstance(value_range, list): - * value_range = list(value_range) - */ - if (unlikely(__pyx_v_flags_lookup_dict == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_flags_lookup_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_value_range = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":460 - * """ - * value_range = flags_lookup_dict.keys() - * if not isinstance(value_range, list): # <<<<<<<<<<<<<< - * value_range = list(value_range) - * min_int = int(math.log(min(value_range), 2)) - */ - __pyx_t_2 = PyList_Check(__pyx_v_value_range); - __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); - if (__pyx_t_3) { - - /* "talib/abstract.pyx":461 - * value_range = flags_lookup_dict.keys() - * if not isinstance(value_range, list): - * value_range = list(value_range) # <<<<<<<<<<<<<< - * min_int = int(math.log(min(value_range), 2)) - * max_int = int(math.log(max(value_range), 2)) - */ - __pyx_t_1 = PySequence_List(__pyx_v_value_range); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_value_range, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":460 - * """ - * value_range = flags_lookup_dict.keys() - * if not isinstance(value_range, list): # <<<<<<<<<<<<<< - * value_range = list(value_range) - * min_int = int(math.log(min(value_range), 2)) - */ - } - - /* "talib/abstract.pyx":462 - * if not isinstance(value_range, list): - * value_range = list(value_range) - * min_int = int(math.log(min(value_range), 2)) # <<<<<<<<<<<<<< - * max_int = int(math.log(max(value_range), 2)) - * - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_value_range); - __Pyx_GIVEREF(__pyx_v_value_range); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value_range); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_6); - __Pyx_INCREF(__pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_2); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_min_int = __pyx_t_5; - __pyx_t_5 = 0; - - /* "talib/abstract.pyx":463 - * value_range = list(value_range) - * min_int = int(math.log(min(value_range), 2)) - * max_int = int(math.log(max(value_range), 2)) # <<<<<<<<<<<<<< - * - * # if the flag we got is out-of-range, it just means no extra info provided - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_log); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_value_range); - __Pyx_GIVEREF(__pyx_v_value_range); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value_range); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } - } - __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_1) { - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_6); - __Pyx_INCREF(__pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_int_2); - __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_max_int = __pyx_t_8; - __pyx_t_8 = 0; - - /* "talib/abstract.pyx":466 - * - * # if the flag we got is out-of-range, it just means no extra info provided - * if flag < 1 or flag > 2**max_int: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_2 = ((__pyx_v_flag < 1) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_3 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_max_int, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __pyx_t_2; - __pyx_L5_bool_binop_done:; - if (__pyx_t_3) { - - /* "talib/abstract.pyx":467 - * # if the flag we got is out-of-range, it just means no extra info provided - * if flag < 1 or flag > 2**max_int: - * return None # <<<<<<<<<<<<<< - * - * # In this loop, i is essentially the bit-position, which represents an - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "talib/abstract.pyx":466 - * - * # if the flag we got is out-of-range, it just means no extra info provided - * if flag < 1 or flag > 2**max_int: # <<<<<<<<<<<<<< - * return None - * - */ - } - - /* "talib/abstract.pyx":472 - * # input from flags_lookup_dict. We loop through as many flags_lookup_dict - * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. - * ret = [] # <<<<<<<<<<<<<< - * for i in xrange(min_int, max_int+1): - * if 2**i & flag: - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_ret = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "talib/abstract.pyx":473 - * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. - * ret = [] - * for i in xrange(min_int, max_int+1): # <<<<<<<<<<<<<< - * if 2**i & flag: - * ret.append(flags_lookup_dict[2**i]) - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_max_int, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_min_int); - __Pyx_GIVEREF(__pyx_v_min_int); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_min_int); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_9(__pyx_t_5); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); - __pyx_t_4 = 0; - - /* "talib/abstract.pyx":474 - * ret = [] - * for i in xrange(min_int, max_int+1): - * if 2**i & flag: # <<<<<<<<<<<<<< - * ret.append(flags_lookup_dict[2**i]) - * return ret - */ - __pyx_t_4 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_And(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { - - /* "talib/abstract.pyx":475 - * for i in xrange(min_int, max_int+1): - * if 2**i & flag: - * ret.append(flags_lookup_dict[2**i]) # <<<<<<<<<<<<<< - * return ret - * - */ - if (unlikely(__pyx_v_flags_lookup_dict == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_6 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_flags_lookup_dict, __pyx_t_6); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":474 - * ret = [] - * for i in xrange(min_int, max_int+1): - * if 2**i & flag: # <<<<<<<<<<<<<< - * ret.append(flags_lookup_dict[2**i]) - * return ret - */ - } - - /* "talib/abstract.pyx":473 - * # bit-positions as we need to check, bitwise-ANDing each with flag for a hit. - * ret = [] - * for i in xrange(min_int, max_int+1): # <<<<<<<<<<<<<< - * if 2**i & flag: - * ret.append(flags_lookup_dict[2**i]) - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "talib/abstract.pyx":476 - * if 2**i & flag: - * ret.append(flags_lookup_dict[2**i]) - * return ret # <<<<<<<<<<<<<< - * - * TA_FUNC_FLAGS = { - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "talib/abstract.pyx":453 - * return functions - * - * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< - * """ - * TA-LIB provides hints for multiple flags as a bitwise-ORed int. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("talib.abstract.__get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_value_range); - __Pyx_XDECREF(__pyx_v_min_int); - __Pyx_XDECREF(__pyx_v_max_int); - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":512 - * } - * - * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns the info dict for the function. It has the following keys: name, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_15_ta_getFuncInfo(PyObject *__pyx_self, PyObject *__pyx_arg_function_name); /*proto*/ -static char __pyx_doc_5talib_8abstract_14_ta_getFuncInfo[] = "\n Returns the info dict for the function. It has the following keys: name,\n group, help, flags, num_inputs, num_opt_inputs and num_outputs.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_15_ta_getFuncInfo = {"_ta_getFuncInfo", (PyCFunction)__pyx_pw_5talib_8abstract_15_ta_getFuncInfo, METH_O, __pyx_doc_5talib_8abstract_14_ta_getFuncInfo}; -static PyObject *__pyx_pw_5talib_8abstract_15_ta_getFuncInfo(PyObject *__pyx_self, PyObject *__pyx_arg_function_name) { - char *__pyx_v_function_name; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getFuncInfo (wrapper)", 0); - assert(__pyx_arg_function_name); { - __pyx_v_function_name = __Pyx_PyObject_AsString(__pyx_arg_function_name); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract._ta_getFuncInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_14_ta_getFuncInfo(__pyx_self, ((char *)__pyx_v_function_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_14_ta_getFuncInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name) { - TA_FuncInfo *__pyx_v_info; - TA_RetCode __pyx_v_retCode; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getFuncInfo", 0); - - /* "talib/abstract.pyx":518 - * """ - * cdef lib.TA_FuncInfo *info - * retCode = lib.TA_GetFuncInfo(__ta_getFuncHandle(function_name), &info) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GetFuncInfo', retCode) - * - */ - __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_8abstract___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info)); - - /* "talib/abstract.pyx":519 - * cdef lib.TA_FuncInfo *info - * retCode = lib.TA_GetFuncInfo(__ta_getFuncHandle(function_name), &info) - * _ta_check_success('TA_GetFuncInfo', retCode) # <<<<<<<<<<<<<< - * - * return { - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetFuncInfo); - __Pyx_GIVEREF(__pyx_n_s_TA_GetFuncInfo); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetFuncInfo); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":521 - * _ta_check_success('TA_GetFuncInfo', retCode) - * - * return { # <<<<<<<<<<<<<< - * 'name': bytes2str(info.name), - * 'group': bytes2str(info.group), - */ - __Pyx_XDECREF(__pyx_r); - - /* "talib/abstract.pyx":522 - * - * return { - * 'name': bytes2str(info.name), # <<<<<<<<<<<<<< - * 'group': bytes2str(info.group), - * 'display_name': bytes2str(info.hint), - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":523 - * return { - * 'name': bytes2str(info.name), - * 'group': bytes2str(info.group), # <<<<<<<<<<<<<< - * 'display_name': bytes2str(info.hint), - * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_info->group); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_group, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":524 - * 'name': bytes2str(info.name), - * 'group': bytes2str(info.group), - * 'display_name': bytes2str(info.hint), # <<<<<<<<<<<<<< - * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), - * 'num_inputs': int(info.nbInput), - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_info->hint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_display_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":525 - * 'group': bytes2str(info.group), - * 'display_name': bytes2str(info.hint), - * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), # <<<<<<<<<<<<<< - * 'num_inputs': int(info.nbInput), - * 'num_opt_inputs': int(info.nbOptInput), - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyInt_From_TA_FuncFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_FUNC_FLAGS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_5 = 1; - } - } - __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_function_flags, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":526 - * 'display_name': bytes2str(info.hint), - * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), - * 'num_inputs': int(info.nbInput), # <<<<<<<<<<<<<< - * 'num_opt_inputs': int(info.nbOptInput), - * 'num_outputs': int(info.nbOutput) - */ - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbInput); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_inputs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":527 - * 'function_flags': __get_flags(info.flags, TA_FUNC_FLAGS), - * 'num_inputs': int(info.nbInput), - * 'num_opt_inputs': int(info.nbOptInput), # <<<<<<<<<<<<<< - * 'num_outputs': int(info.nbOutput) - * } - */ - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbOptInput); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_opt_inputs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":528 - * 'num_inputs': int(info.nbInput), - * 'num_opt_inputs': int(info.nbOptInput), - * 'num_outputs': int(info.nbOutput) # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_info->nbOutput); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_outputs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":512 - * } - * - * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns the info dict for the function. It has the following keys: name, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("talib.abstract._ta_getFuncInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":531 - * } - * - * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's input info dict for the given index. It has two - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_17_ta_getInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_16_ta_getInputParameterInfo[] = "\n Returns the function's input info dict for the given index. It has two\n keys: name and flags.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_17_ta_getInputParameterInfo = {"_ta_getInputParameterInfo", (PyCFunction)__pyx_pw_5talib_8abstract_17_ta_getInputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_16_ta_getInputParameterInfo}; -static PyObject *__pyx_pw_5talib_8abstract_17_ta_getInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - char *__pyx_v_function_name; - int __pyx_v_idx; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getInputParameterInfo (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_ta_getInputParameterInfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getInputParameterInfo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ta_getInputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract._ta_getInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_16_ta_getInputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_16_ta_getInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { - TA_InputParameterInfo *__pyx_v_info; - TA_RetCode __pyx_v_retCode; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getInputParameterInfo", 0); - - /* "talib/abstract.pyx":537 - * """ - * cdef lib.TA_InputParameterInfo *info - * retCode = lib.TA_GetInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GetInputParameterInfo', retCode) - * - */ - __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_8abstract___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); - - /* "talib/abstract.pyx":538 - * cdef lib.TA_InputParameterInfo *info - * retCode = lib.TA_GetInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) - * _ta_check_success('TA_GetInputParameterInfo', retCode) # <<<<<<<<<<<<<< - * - * name = bytes2str(info.paramName) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetInputParameterInfo); - __Pyx_GIVEREF(__pyx_n_s_TA_GetInputParameterInfo); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetInputParameterInfo); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":540 - * _ta_check_success('TA_GetInputParameterInfo', retCode) - * - * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< - * name = name[len('in'):].lower() - * if 'real' in name: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_name = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":541 - * - * name = bytes2str(info.paramName) - * name = name[len('in'):].lower() # <<<<<<<<<<<<<< - * if 'real' in name: - * name = name.replace('real', 'price') - */ - __pyx_t_5 = PyObject_Length(__pyx_n_s_in); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_5, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":542 - * name = bytes2str(info.paramName) - * name = name[len('in'):].lower() - * if 'real' in name: # <<<<<<<<<<<<<< - * name = name.replace('real', 'price') - * elif 'price' in name: - */ - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_real, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = (__pyx_t_7 != 0); - if (__pyx_t_8) { - - /* "talib/abstract.pyx":543 - * name = name[len('in'):].lower() - * if 'real' in name: - * name = name.replace('real', 'price') # <<<<<<<<<<<<<< - * elif 'price' in name: - * name = 'prices' - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); - __pyx_t_4 = 0; - - /* "talib/abstract.pyx":542 - * name = bytes2str(info.paramName) - * name = name[len('in'):].lower() - * if 'real' in name: # <<<<<<<<<<<<<< - * name = name.replace('real', 'price') - * elif 'price' in name: - */ - goto __pyx_L3; - } - - /* "talib/abstract.pyx":544 - * if 'real' in name: - * name = name.replace('real', 'price') - * elif 'price' in name: # <<<<<<<<<<<<<< - * name = 'prices' - * - */ - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_price, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = (__pyx_t_8 != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":545 - * name = name.replace('real', 'price') - * elif 'price' in name: - * name = 'prices' # <<<<<<<<<<<<<< - * - * return { - */ - __Pyx_INCREF(__pyx_n_s_prices); - __Pyx_DECREF_SET(__pyx_v_name, __pyx_n_s_prices); - - /* "talib/abstract.pyx":544 - * if 'real' in name: - * name = name.replace('real', 'price') - * elif 'price' in name: # <<<<<<<<<<<<<< - * name = 'prices' - * - */ - } - __pyx_L3:; - - /* "talib/abstract.pyx":547 - * name = 'prices' - * - * return { # <<<<<<<<<<<<<< - * 'name': name, - * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) - */ - __Pyx_XDECREF(__pyx_r); - - /* "talib/abstract.pyx":548 - * - * return { - * 'name': name, # <<<<<<<<<<<<<< - * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) - * } - */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":549 - * return { - * 'name': name, - * 'price_series': __get_flags(info.flags, TA_INPUT_FLAGS) # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_TA_InputFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_INPUT_FLAGS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_9) { - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_price_series, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":531 - * } - * - * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's input info dict for the given index. It has two - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("talib.abstract._ta_getInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":552 - * } - * - * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's opt_input info dict for the given index. It has the - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_19_ta_getOptInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_18_ta_getOptInputParameterInfo[] = "\n Returns the function's opt_input info dict for the given index. It has the\n following keys: name, display_name, type, help, default_value and value.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_19_ta_getOptInputParameterInfo = {"_ta_getOptInputParameterInfo", (PyCFunction)__pyx_pw_5talib_8abstract_19_ta_getOptInputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_18_ta_getOptInputParameterInfo}; -static PyObject *__pyx_pw_5talib_8abstract_19_ta_getOptInputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - char *__pyx_v_function_name; - int __pyx_v_idx; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getOptInputParameterInfo (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_ta_getOptInputParameterInfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getOptInputParameterInfo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ta_getOptInputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract._ta_getOptInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_18_ta_getOptInputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_18_ta_getOptInputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { - TA_OptInputParameterInfo *__pyx_v_info; - TA_RetCode __pyx_v_retCode; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_v_default_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getOptInputParameterInfo", 0); - - /* "talib/abstract.pyx":558 - * """ - * cdef lib.TA_OptInputParameterInfo *info - * retCode = lib.TA_GetOptInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GetOptInputParameterInfo', retCode) - * - */ - __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_8abstract___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); - - /* "talib/abstract.pyx":559 - * cdef lib.TA_OptInputParameterInfo *info - * retCode = lib.TA_GetOptInputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) - * _ta_check_success('TA_GetOptInputParameterInfo', retCode) # <<<<<<<<<<<<<< - * - * name = bytes2str(info.paramName) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetOptInputParameterInfo); - __Pyx_GIVEREF(__pyx_n_s_TA_GetOptInputParameterInfo); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetOptInputParameterInfo); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":561 - * _ta_check_success('TA_GetOptInputParameterInfo', retCode) - * - * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< - * name = name[len('optIn'):].lower() - * default_value = info.defaultValue - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_name = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":562 - * - * name = bytes2str(info.paramName) - * name = name[len('optIn'):].lower() # <<<<<<<<<<<<<< - * default_value = info.defaultValue - * if default_value % 1 == 0: - */ - __pyx_t_5 = PyObject_Length(__pyx_n_s_optIn); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_5, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":563 - * name = bytes2str(info.paramName) - * name = name[len('optIn'):].lower() - * default_value = info.defaultValue # <<<<<<<<<<<<<< - * if default_value % 1 == 0: - * default_value = int(default_value) - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_info->defaultValue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_default_value = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":564 - * name = name[len('optIn'):].lower() - * default_value = info.defaultValue - * if default_value % 1 == 0: # <<<<<<<<<<<<<< - * default_value = int(default_value) - * - */ - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_default_value, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":565 - * default_value = info.defaultValue - * if default_value % 1 == 0: - * default_value = int(default_value) # <<<<<<<<<<<<<< - * - * return { - */ - __pyx_t_4 = PyNumber_Int(__pyx_v_default_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_default_value, __pyx_t_4); - __pyx_t_4 = 0; - - /* "talib/abstract.pyx":564 - * name = name[len('optIn'):].lower() - * default_value = info.defaultValue - * if default_value % 1 == 0: # <<<<<<<<<<<<<< - * default_value = int(default_value) - * - */ - } - - /* "talib/abstract.pyx":567 - * default_value = int(default_value) - * - * return { # <<<<<<<<<<<<<< - * 'name': name, - * 'display_name': bytes2str(info.displayName), - */ - __Pyx_XDECREF(__pyx_r); - - /* "talib/abstract.pyx":568 - * - * return { - * 'name': name, # <<<<<<<<<<<<<< - * 'display_name': bytes2str(info.displayName), - * 'type': info.type, - */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":569 - * return { - * 'name': name, - * 'display_name': bytes2str(info.displayName), # <<<<<<<<<<<<<< - * 'type': info.type, - * 'help': bytes2str(info.hint), - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_info->displayName); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_display_name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":570 - * 'name': name, - * 'display_name': bytes2str(info.displayName), - * 'type': info.type, # <<<<<<<<<<<<<< - * 'help': bytes2str(info.hint), - * 'default_value': default_value, - */ - __pyx_t_1 = __Pyx_PyInt_From_TA_OptInputParameterType(__pyx_v_info->type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":571 - * 'display_name': bytes2str(info.displayName), - * 'type': info.type, - * 'help': bytes2str(info.hint), # <<<<<<<<<<<<<< - * 'default_value': default_value, - * 'value': None - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_info->hint); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_help, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":572 - * 'type': info.type, - * 'help': bytes2str(info.hint), - * 'default_value': default_value, # <<<<<<<<<<<<<< - * 'value': None - * } - */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default_value, __pyx_v_default_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":573 - * 'help': bytes2str(info.hint), - * 'default_value': default_value, - * 'value': None # <<<<<<<<<<<<<< - * } - * - */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":552 - * } - * - * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's opt_input info dict for the given index. It has the - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("talib.abstract._ta_getOptInputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_default_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":576 - * } - * - * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's output info dict for the given index. It has two - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_21_ta_getOutputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_8abstract_20_ta_getOutputParameterInfo[] = "\n Returns the function's output info dict for the given index. It has two\n keys: name and flags.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_21_ta_getOutputParameterInfo = {"_ta_getOutputParameterInfo", (PyCFunction)__pyx_pw_5talib_8abstract_21_ta_getOutputParameterInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_8abstract_20_ta_getOutputParameterInfo}; -static PyObject *__pyx_pw_5talib_8abstract_21_ta_getOutputParameterInfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - char *__pyx_v_function_name; - int __pyx_v_idx; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_getOutputParameterInfo (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_idx,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_ta_getOutputParameterInfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_getOutputParameterInfo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_function_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_function_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_idx = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ta_getOutputParameterInfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.abstract._ta_getOutputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_8abstract_20_ta_getOutputParameterInfo(__pyx_self, __pyx_v_function_name, __pyx_v_idx); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_20_ta_getOutputParameterInfo(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_function_name, int __pyx_v_idx) { - TA_OutputParameterInfo *__pyx_v_info; - TA_RetCode __pyx_v_retCode; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_getOutputParameterInfo", 0); - - /* "talib/abstract.pyx":582 - * """ - * cdef lib.TA_OutputParameterInfo *info - * retCode = lib.TA_GetOutputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GetOutputParameterInfo', retCode) - * - */ - __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_8abstract___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); - - /* "talib/abstract.pyx":583 - * cdef lib.TA_OutputParameterInfo *info - * retCode = lib.TA_GetOutputParameterInfo(__ta_getFuncHandle(function_name), idx, &info) - * _ta_check_success('TA_GetOutputParameterInfo', retCode) # <<<<<<<<<<<<<< - * - * name = bytes2str(info.paramName) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetOutputParameterInfo); - __Pyx_GIVEREF(__pyx_n_s_TA_GetOutputParameterInfo); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetOutputParameterInfo); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":585 - * _ta_check_success('TA_GetOutputParameterInfo', retCode) - * - * name = bytes2str(info.paramName) # <<<<<<<<<<<<<< - * name = name[len('out'):].lower() - * # chop off leading 'real' if a descriptive name follows - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes2str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_info->paramName); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_name = __pyx_t_1; - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":586 - * - * name = bytes2str(info.paramName) - * name = name[len('out'):].lower() # <<<<<<<<<<<<<< - * # chop off leading 'real' if a descriptive name follows - * if 'real' in name and name not in ['real', 'real0', 'real1']: - */ - __pyx_t_5 = PyObject_Length(__pyx_n_s_out); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_5, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":588 - * name = name[len('out'):].lower() - * # chop off leading 'real' if a descriptive name follows - * if 'real' in name and name not in ['real', 'real0', 'real1']: # <<<<<<<<<<<<<< - * name = name[len('real'):] - * - */ - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_real, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - } else { - __pyx_t_7 = __pyx_t_9; - goto __pyx_L4_bool_binop_done; - } - __Pyx_INCREF(__pyx_v_name); - __pyx_t_1 = __pyx_v_name; - __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_8) { - } else { - __pyx_t_9 = __pyx_t_8; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real0, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_8) { - } else { - __pyx_t_9 = __pyx_t_8; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_real1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __pyx_t_8; - __pyx_L6_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (__pyx_t_9 != 0); - __pyx_t_7 = __pyx_t_8; - __pyx_L4_bool_binop_done:; - if (__pyx_t_7) { - - /* "talib/abstract.pyx":589 - * # chop off leading 'real' if a descriptive name follows - * if 'real' in name and name not in ['real', 'real0', 'real1']: - * name = name[len('real'):] # <<<<<<<<<<<<<< - * - * return { - */ - __pyx_t_5 = PyObject_Length(__pyx_n_s_real); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_name, __pyx_t_5, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":588 - * name = name[len('out'):].lower() - * # chop off leading 'real' if a descriptive name follows - * if 'real' in name and name not in ['real', 'real0', 'real1']: # <<<<<<<<<<<<<< - * name = name[len('real'):] - * - */ - } - - /* "talib/abstract.pyx":591 - * name = name[len('real'):] - * - * return { # <<<<<<<<<<<<<< - * 'name': name, - * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) - */ - __Pyx_XDECREF(__pyx_r); - - /* "talib/abstract.pyx":592 - * - * return { - * 'name': name, # <<<<<<<<<<<<<< - * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) - * } - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":593 - * return { - * 'name': name, - * 'flags': __get_flags(info.flags, TA_OUTPUT_FLAGS) # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_TA_OutputFlags(__pyx_v_info->flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TA_OUTPUT_FLAGS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_10) { - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flags, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":576 - * } - * - * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's output info dict for the given index. It has two - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("talib.abstract._ta_getOutputParameterInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":596 - * } - * - * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< - * """ - * Returns a tuple with two outputs: defaults, a dict of parameter defaults, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_8abstract_23_get_defaults_and_docs(PyObject *__pyx_self, PyObject *__pyx_v_func_info); /*proto*/ -static char __pyx_doc_5talib_8abstract_22_get_defaults_and_docs[] = "\n Returns a tuple with two outputs: defaults, a dict of parameter defaults,\n and documentation, a formatted docstring for the function.\n .. Note: func_info should come from Function.info, *not* _ta_getFuncInfo.\n "; -static PyMethodDef __pyx_mdef_5talib_8abstract_23_get_defaults_and_docs = {"_get_defaults_and_docs", (PyCFunction)__pyx_pw_5talib_8abstract_23_get_defaults_and_docs, METH_O, __pyx_doc_5talib_8abstract_22_get_defaults_and_docs}; -static PyObject *__pyx_pw_5talib_8abstract_23_get_defaults_and_docs(PyObject *__pyx_self, PyObject *__pyx_v_func_info) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_defaults_and_docs (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_8abstract_22_get_defaults_and_docs(__pyx_self, ((PyObject *)__pyx_v_func_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_8abstract_22_get_defaults_and_docs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_info) { - PyObject *__pyx_v_defaults = NULL; - PyObject *__pyx_v_func_line = NULL; - PyObject *__pyx_v_func_args = NULL; - PyObject *__pyx_v_docs = NULL; - PyObject *__pyx_v_input_names = NULL; - PyObject *__pyx_v_input_name = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_params = NULL; - PyObject *__pyx_v_param = NULL; - PyObject *__pyx_v_outputs = NULL; - PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_documentation = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_defaults_and_docs", 0); - - /* "talib/abstract.pyx":602 - * .. Note: func_info should come from Function.info, *not* _ta_getFuncInfo. - * """ - * defaults = {} # <<<<<<<<<<<<<< - * func_line = [func_info['name'], '('] - * func_args = ['[input_arrays]'] - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_defaults = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":603 - * """ - * defaults = {} - * func_line = [func_info['name'], '('] # <<<<<<<<<<<<<< - * func_args = ['[input_arrays]'] - * docs = [] - */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_kp_s__8); - __Pyx_GIVEREF(__pyx_kp_s__8); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s__8); - __pyx_t_1 = 0; - __pyx_v_func_line = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":604 - * defaults = {} - * func_line = [func_info['name'], '('] - * func_args = ['[input_arrays]'] # <<<<<<<<<<<<<< - * docs = [] - * docs.append('%(display_name)s (%(group)s)\n' % func_info) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_kp_s_input_arrays_2); - __Pyx_GIVEREF(__pyx_kp_s_input_arrays_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_input_arrays_2); - __pyx_v_func_args = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":605 - * func_line = [func_info['name'], '('] - * func_args = ['[input_arrays]'] - * docs = [] # <<<<<<<<<<<<<< - * docs.append('%(display_name)s (%(group)s)\n' % func_info) - * - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_docs = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":606 - * func_args = ['[input_arrays]'] - * docs = [] - * docs.append('%(display_name)s (%(group)s)\n' % func_info) # <<<<<<<<<<<<<< - * - * input_names = func_info['input_names'] - */ - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_display_name_s_group_s, __pyx_v_func_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":608 - * docs.append('%(display_name)s (%(group)s)\n' % func_info) - * - * input_names = func_info['input_names'] # <<<<<<<<<<<<<< - * docs.append('Inputs:') - * for input_name in input_names: - */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_input_names); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_input_names = __pyx_t_2; - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":609 - * - * input_names = func_info['input_names'] - * docs.append('Inputs:') # <<<<<<<<<<<<<< - * for input_name in input_names: - * value = input_names[input_name] - */ - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Inputs); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":610 - * input_names = func_info['input_names'] - * docs.append('Inputs:') - * for input_name in input_names: # <<<<<<<<<<<<<< - * value = input_names[input_name] - * if not isinstance(value, list): - */ - if (likely(PyList_CheckExact(__pyx_v_input_names)) || PyTuple_CheckExact(__pyx_v_input_names)) { - __pyx_t_2 = __pyx_v_input_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_input_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_input_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":611 - * docs.append('Inputs:') - * for input_name in input_names: - * value = input_names[input_name] # <<<<<<<<<<<<<< - * if not isinstance(value, list): - * value = '(any ndarray)' - */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_input_names, __pyx_v_input_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "talib/abstract.pyx":612 - * for input_name in input_names: - * value = input_names[input_name] - * if not isinstance(value, list): # <<<<<<<<<<<<<< - * value = '(any ndarray)' - * docs.append(' %s: %s' % (input_name, value)) - */ - __pyx_t_6 = PyList_Check(__pyx_v_value); - __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0); - if (__pyx_t_7) { - - /* "talib/abstract.pyx":613 - * value = input_names[input_name] - * if not isinstance(value, list): - * value = '(any ndarray)' # <<<<<<<<<<<<<< - * docs.append(' %s: %s' % (input_name, value)) - * - */ - __Pyx_INCREF(__pyx_kp_s_any_ndarray); - __Pyx_DECREF_SET(__pyx_v_value, __pyx_kp_s_any_ndarray); - - /* "talib/abstract.pyx":612 - * for input_name in input_names: - * value = input_names[input_name] - * if not isinstance(value, list): # <<<<<<<<<<<<<< - * value = '(any ndarray)' - * docs.append(' %s: %s' % (input_name, value)) - */ - } - - /* "talib/abstract.pyx":614 - * if not isinstance(value, list): - * value = '(any ndarray)' - * docs.append(' %s: %s' % (input_name, value)) # <<<<<<<<<<<<<< - * - * params = func_info['parameters'] - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_input_name); - __Pyx_GIVEREF(__pyx_v_input_name); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_input_name); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":610 - * input_names = func_info['input_names'] - * docs.append('Inputs:') - * for input_name in input_names: # <<<<<<<<<<<<<< - * value = input_names[input_name] - * if not isinstance(value, list): - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":616 - * docs.append(' %s: %s' % (input_name, value)) - * - * params = func_info['parameters'] # <<<<<<<<<<<<<< - * if params: - * docs.append('Parameters:') - */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_parameters); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_params = __pyx_t_2; - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":617 - * - * params = func_info['parameters'] - * if params: # <<<<<<<<<<<<<< - * docs.append('Parameters:') - * for param in params: - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_params); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_7) { - - /* "talib/abstract.pyx":618 - * params = func_info['parameters'] - * if params: - * docs.append('Parameters:') # <<<<<<<<<<<<<< - * for param in params: - * docs.append(' %s: %s' % (param, params[param])) - */ - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Parameters); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":617 - * - * params = func_info['parameters'] - * if params: # <<<<<<<<<<<<<< - * docs.append('Parameters:') - * for param in params: - */ - } - - /* "talib/abstract.pyx":619 - * if params: - * docs.append('Parameters:') - * for param in params: # <<<<<<<<<<<<<< - * docs.append(' %s: %s' % (param, params[param])) - * func_args.append('[%s=%s]' % (param, params[param])) - */ - if (likely(PyList_CheckExact(__pyx_v_params)) || PyTuple_CheckExact(__pyx_v_params)) { - __pyx_t_2 = __pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - #endif - } - } else { - __pyx_t_8 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_8); - } - __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_8); - __pyx_t_8 = 0; - - /* "talib/abstract.pyx":620 - * docs.append('Parameters:') - * for param in params: - * docs.append(' %s: %s' % (param, params[param])) # <<<<<<<<<<<<<< - * func_args.append('[%s=%s]' % (param, params[param])) - * defaults[param] = params[param] - */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_param); - __Pyx_GIVEREF(__pyx_v_param); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_param); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":621 - * for param in params: - * docs.append(' %s: %s' % (param, params[param])) - * func_args.append('[%s=%s]' % (param, params[param])) # <<<<<<<<<<<<<< - * defaults[param] = params[param] - * if param == 'matype': - */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_param); - __Pyx_GIVEREF(__pyx_v_param); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_param); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_args, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":622 - * docs.append(' %s: %s' % (param, params[param])) - * func_args.append('[%s=%s]' % (param, params[param])) - * defaults[param] = params[param] # <<<<<<<<<<<<<< - * if param == 'matype': - * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) - */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_defaults, __pyx_v_param, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":623 - * func_args.append('[%s=%s]' % (param, params[param])) - * defaults[param] = params[param] - * if param == 'matype': # <<<<<<<<<<<<<< - * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) - * - */ - __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_param, __pyx_n_s_matype, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_7) { - - /* "talib/abstract.pyx":624 - * defaults[param] = params[param] - * if param == 'matype': - * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) # <<<<<<<<<<<<<< - * - * outputs = func_info['output_names'] - */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_docs, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetItem(__pyx_t_1, __pyx_t_9); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_8); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(__Pyx_SetItemInt(__pyx_v_docs, -1L, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":623 - * func_args.append('[%s=%s]' % (param, params[param])) - * defaults[param] = params[param] - * if param == 'matype': # <<<<<<<<<<<<<< - * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) - * - */ - } - - /* "talib/abstract.pyx":619 - * if params: - * docs.append('Parameters:') - * for param in params: # <<<<<<<<<<<<<< - * docs.append(' %s: %s' % (param, params[param])) - * func_args.append('[%s=%s]' % (param, params[param])) - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":626 - * docs[-1] = ' '.join([docs[-1], '(%s)' % MA_Type[params[param]]]) - * - * outputs = func_info['output_names'] # <<<<<<<<<<<<<< - * docs.append('Outputs:') - * for output in outputs: - */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_func_info, __pyx_n_s_output_names); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_outputs = __pyx_t_2; - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":627 - * - * outputs = func_info['output_names'] - * docs.append('Outputs:') # <<<<<<<<<<<<<< - * for output in outputs: - * if output == 'integer': - */ - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_kp_s_Outputs); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":628 - * outputs = func_info['output_names'] - * docs.append('Outputs:') - * for output in outputs: # <<<<<<<<<<<<<< - * if output == 'integer': - * output = 'integer (values are -100, 0 or 100)' - */ - if (likely(PyList_CheckExact(__pyx_v_outputs)) || PyTuple_CheckExact(__pyx_v_outputs)) { - __pyx_t_2 = __pyx_v_outputs; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_outputs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - #endif - } - } else { - __pyx_t_9 = __pyx_t_5(__pyx_t_2); - if (unlikely(!__pyx_t_9)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_9); - } - __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_9); - __pyx_t_9 = 0; - - /* "talib/abstract.pyx":629 - * docs.append('Outputs:') - * for output in outputs: - * if output == 'integer': # <<<<<<<<<<<<<< - * output = 'integer (values are -100, 0 or 100)' - * docs.append(' %s' % output) - */ - __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_output, __pyx_n_s_integer, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_7) { - - /* "talib/abstract.pyx":630 - * for output in outputs: - * if output == 'integer': - * output = 'integer (values are -100, 0 or 100)' # <<<<<<<<<<<<<< - * docs.append(' %s' % output) - * - */ - __Pyx_INCREF(__pyx_kp_s_integer_values_are_100_0_or_100); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_kp_s_integer_values_are_100_0_or_100); - - /* "talib/abstract.pyx":629 - * docs.append('Outputs:') - * for output in outputs: - * if output == 'integer': # <<<<<<<<<<<<<< - * output = 'integer (values are -100, 0 or 100)' - * docs.append(' %s' % output) - */ - } - - /* "talib/abstract.pyx":631 - * if output == 'integer': - * output = 'integer (values are -100, 0 or 100)' - * docs.append(' %s' % output) # <<<<<<<<<<<<<< - * - * func_line.append(', '.join(func_args)) - */ - __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_v_output); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_docs, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":628 - * outputs = func_info['output_names'] - * docs.append('Outputs:') - * for output in outputs: # <<<<<<<<<<<<<< - * if output == 'integer': - * output = 'integer (values are -100, 0 or 100)' - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":633 - * docs.append(' %s' % output) - * - * func_line.append(', '.join(func_args)) # <<<<<<<<<<<<<< - * func_line.append(')\n') - * docs.insert(0, ''.join(func_line)) - */ - __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__6, __pyx_v_func_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_line, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":634 - * - * func_line.append(', '.join(func_args)) - * func_line.append(')\n') # <<<<<<<<<<<<<< - * docs.insert(0, ''.join(func_line)) - * documentation = '\n'.join(docs) - */ - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_func_line, __pyx_kp_s__10); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":635 - * func_line.append(', '.join(func_args)) - * func_line.append(')\n') - * docs.insert(0, ''.join(func_line)) # <<<<<<<<<<<<<< - * documentation = '\n'.join(docs) - * return defaults, documentation - */ - __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_v_func_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_Insert(__pyx_v_docs, 0, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":636 - * func_line.append(')\n') - * docs.insert(0, ''.join(func_line)) - * documentation = '\n'.join(docs) # <<<<<<<<<<<<<< - * return defaults, documentation - * - */ - __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__11, __pyx_v_docs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_documentation = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/abstract.pyx":637 - * docs.insert(0, ''.join(func_line)) - * documentation = '\n'.join(docs) - * return defaults, documentation # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_defaults); - __Pyx_GIVEREF(__pyx_v_defaults); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_defaults); - __Pyx_INCREF(__pyx_v_documentation); - __Pyx_GIVEREF(__pyx_v_documentation); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_documentation); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/abstract.pyx":596 - * } - * - * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< - * """ - * Returns a tuple with two outputs: defaults, a dict of parameter defaults, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("talib.abstract._get_defaults_and_docs", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_defaults); - __Pyx_XDECREF(__pyx_v_func_line); - __Pyx_XDECREF(__pyx_v_func_args); - __Pyx_XDECREF(__pyx_v_docs); - __Pyx_XDECREF(__pyx_v_input_names); - __Pyx_XDECREF(__pyx_v_input_name); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_params); - __Pyx_XDECREF(__pyx_v_param); - __Pyx_XDECREF(__pyx_v_outputs); - __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_documentation); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":648 - * # - Setting TALIB paramholder optInput values and calling the lookback function - * - * cdef lib.TA_FuncHandle* __ta_getFuncHandle(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns a pointer to a function handle for the given function name - */ - -static TA_FuncHandle *__pyx_f_5talib_8abstract___ta_getFuncHandle(char *__pyx_v_function_name) { - TA_FuncHandle *__pyx_v_handle; - TA_FuncHandle *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_getFuncHandle", 0); - - /* "talib/abstract.pyx":653 - * """ - * cdef lib.TA_FuncHandle *handle - * _ta_check_success('TA_GetFuncHandle', lib.TA_GetFuncHandle(function_name, &handle)) # <<<<<<<<<<<<<< - * return handle - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetFuncHandle); - __Pyx_GIVEREF(__pyx_n_s_TA_GetFuncHandle); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetFuncHandle); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":654 - * cdef lib.TA_FuncHandle *handle - * _ta_check_success('TA_GetFuncHandle', lib.TA_GetFuncHandle(function_name, &handle)) - * return handle # <<<<<<<<<<<<<< - * - * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): - */ - __pyx_r = __pyx_v_handle; - goto __pyx_L0; - - /* "talib/abstract.pyx":648 - * # - Setting TALIB paramholder optInput values and calling the lookback function - * - * cdef lib.TA_FuncHandle* __ta_getFuncHandle(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns a pointer to a function handle for the given function name - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_getFuncHandle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":656 - * return handle - * - * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns a pointer to a parameter holder for the given function name - */ - -static TA_ParamHolder *__pyx_f_5talib_8abstract___ta_paramHolderAlloc(char *__pyx_v_function_name) { - TA_ParamHolder *__pyx_v_holder; - TA_RetCode __pyx_v_retCode; - TA_ParamHolder *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_paramHolderAlloc", 0); - - /* "talib/abstract.pyx":661 - * """ - * cdef lib.TA_ParamHolder *holder - * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) # <<<<<<<<<<<<<< - * _ta_check_success('TA_ParamHolderAlloc', retCode) - * return holder - */ - __pyx_v_retCode = TA_ParamHolderAlloc(__pyx_f_5talib_8abstract___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_holder)); - - /* "talib/abstract.pyx":662 - * cdef lib.TA_ParamHolder *holder - * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) - * _ta_check_success('TA_ParamHolderAlloc', retCode) # <<<<<<<<<<<<<< - * return holder - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_ParamHolderAlloc); - __Pyx_GIVEREF(__pyx_n_s_TA_ParamHolderAlloc); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_ParamHolderAlloc); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":663 - * retCode = lib.TA_ParamHolderAlloc(__ta_getFuncHandle(function_name), &holder) - * _ta_check_success('TA_ParamHolderAlloc', retCode) - * return holder # <<<<<<<<<<<<<< - * - * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): - */ - __pyx_r = __pyx_v_holder; - goto __pyx_L0; - - /* "talib/abstract.pyx":656 - * return handle - * - * cdef lib.TA_ParamHolder* __ta_paramHolderAlloc(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns a pointer to a parameter holder for the given function name - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_paramHolderAlloc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":665 - * return holder - * - * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): # <<<<<<<<<<<<<< - * """ - * Frees the memory allocated by __ta_paramHolderAlloc (call when done with the parameter holder) - */ - -static int __pyx_f_5talib_8abstract___ta_paramHolderFree(TA_ParamHolder *__pyx_v_params) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_paramHolderFree", 0); - - /* "talib/abstract.pyx":670 - * WARNING: Not properly calling this function will cause memory leaks! - * """ - * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) # <<<<<<<<<<<<<< - * - * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(TA_ParamHolderFree(__pyx_v_params)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_ParamHolderFree); - __Pyx_GIVEREF(__pyx_n_s_TA_ParamHolderFree); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_ParamHolderFree); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":665 - * return holder - * - * cdef int __ta_paramHolderFree(lib.TA_ParamHolder *params): # <<<<<<<<<<<<<< - * """ - * Frees the memory allocated by __ta_paramHolderAlloc (call when done with the parameter holder) - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_paramHolderFree", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":672 - * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) - * - * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< - * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamInteger', retCode) - */ - -static int __pyx_f_5talib_8abstract___ta_setOptInputParamInteger(TA_ParamHolder *__pyx_v_holder, int __pyx_v_idx, int __pyx_v_value) { - TA_RetCode __pyx_v_retCode; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_setOptInputParamInteger", 0); - - /* "talib/abstract.pyx":673 - * - * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): - * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) # <<<<<<<<<<<<<< - * _ta_check_success('TA_SetOptInputParamInteger', retCode) - * - */ - __pyx_v_retCode = TA_SetOptInputParamInteger(__pyx_v_holder, __pyx_v_idx, __pyx_v_value); - - /* "talib/abstract.pyx":674 - * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): - * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamInteger', retCode) # <<<<<<<<<<<<<< - * - * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_SetOptInputParamInteger); - __Pyx_GIVEREF(__pyx_n_s_TA_SetOptInputParamInteger); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_SetOptInputParamInteger); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":672 - * _ta_check_success('TA_ParamHolderFree', lib.TA_ParamHolderFree(params)) - * - * cdef int __ta_setOptInputParamInteger(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< - * retCode = lib.TA_SetOptInputParamInteger(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamInteger', retCode) - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_setOptInputParamInteger", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":676 - * _ta_check_success('TA_SetOptInputParamInteger', retCode) - * - * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< - * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamReal', retCode) - */ - -static int __pyx_f_5talib_8abstract___ta_setOptInputParamReal(TA_ParamHolder *__pyx_v_holder, int __pyx_v_idx, int __pyx_v_value) { - TA_RetCode __pyx_v_retCode; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_setOptInputParamReal", 0); - - /* "talib/abstract.pyx":677 - * - * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): - * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) # <<<<<<<<<<<<<< - * _ta_check_success('TA_SetOptInputParamReal', retCode) - * - */ - __pyx_v_retCode = TA_SetOptInputParamReal(__pyx_v_holder, __pyx_v_idx, __pyx_v_value); - - /* "talib/abstract.pyx":678 - * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): - * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamReal', retCode) # <<<<<<<<<<<<<< - * - * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_SetOptInputParamReal); - __Pyx_GIVEREF(__pyx_n_s_TA_SetOptInputParamReal); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_SetOptInputParamReal); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":676 - * _ta_check_success('TA_SetOptInputParamInteger', retCode) - * - * cdef int __ta_setOptInputParamReal(lib.TA_ParamHolder *holder, int idx, int value): # <<<<<<<<<<<<<< - * retCode = lib.TA_SetOptInputParamReal(holder, idx, value) - * _ta_check_success('TA_SetOptInputParamReal', retCode) - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_setOptInputParamReal", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/abstract.pyx":680 - * _ta_check_success('TA_SetOptInputParamReal', retCode) - * - * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): # <<<<<<<<<<<<<< - * cdef int lookback - * retCode = lib.TA_GetLookback(holder, &lookback) - */ - -static int __pyx_f_5talib_8abstract___ta_getLookback(TA_ParamHolder *__pyx_v_holder) { - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__ta_getLookback", 0); - - /* "talib/abstract.pyx":682 - * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): - * cdef int lookback - * retCode = lib.TA_GetLookback(holder, &lookback) # <<<<<<<<<<<<<< - * _ta_check_success('TA_GetLookback', retCode) - * return lookback - */ - __pyx_v_retCode = TA_GetLookback(__pyx_v_holder, (&__pyx_v_lookback)); - - /* "talib/abstract.pyx":683 - * cdef int lookback - * retCode = lib.TA_GetLookback(holder, &lookback) - * _ta_check_success('TA_GetLookback', retCode) # <<<<<<<<<<<<<< - * return lookback - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_retCode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_INCREF(__pyx_n_s_TA_GetLookback); - __Pyx_GIVEREF(__pyx_n_s_TA_GetLookback); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_TA_GetLookback); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":684 - * retCode = lib.TA_GetLookback(holder, &lookback) - * _ta_check_success('TA_GetLookback', retCode) - * return lookback # <<<<<<<<<<<<<< - * - * # Configure all the available TA-Lib functions to be exported as - */ - __pyx_r = __pyx_v_lookback; - goto __pyx_L0; - - /* "talib/abstract.pyx":680 - * _ta_check_success('TA_SetOptInputParamReal', retCode) - * - * cdef int __ta_getLookback(lib.TA_ParamHolder *holder): # <<<<<<<<<<<<<< - * cdef int lookback - * retCode = lib.TA_GetLookback(holder, &lookback) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("talib.abstract.__ta_getLookback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * - */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = __pyx_k_b; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = __pyx_k_B; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = __pyx_k_h; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = __pyx_k_H; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = __pyx_k_i; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = __pyx_k_I; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = __pyx_k_l; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = __pyx_k_L; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = __pyx_k_q; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = __pyx_k_Q; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = __pyx_k_f; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = __pyx_k_d; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = __pyx_k_g; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = __pyx_k_Zf; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = __pyx_k_Zd; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = __pyx_k_Zg; - break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = __pyx_k_O; - break; - default: - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_7; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L7_bool_binop_done:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L15:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) - */ - /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr - */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * - */ - Py_XDECREF(__pyx_v_arr->base); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "abstract", - __pyx_k_This_file_Copyright_c_2013_Bria, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut, __pyx_k_Bull_Bear_Pattern_Bearish_0_Neut, sizeof(__pyx_k_Bull_Bear_Pattern_Bearish_0_Neut), 0, 0, 1, 0}, - {&__pyx_kp_s_Dashed_Line, __pyx_k_Dashed_Line, sizeof(__pyx_k_Dashed_Line), 0, 0, 1, 0}, - {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1}, - {&__pyx_n_s_Dot, __pyx_k_Dot, sizeof(__pyx_k_Dot), 0, 0, 1, 1}, - {&__pyx_kp_s_Dotted_Line, __pyx_k_Dotted_Line, sizeof(__pyx_k_Dotted_Line), 0, 0, 1, 0}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_n_s_FUNCTION_NAMES, __pyx_k_FUNCTION_NAMES, sizeof(__pyx_k_FUNCTION_NAMES), 0, 0, 1, 1}, - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_n_s_Function, __pyx_k_Function, sizeof(__pyx_k_Function), 0, 0, 1, 1}, - {&__pyx_n_s_Function___call, __pyx_k_Function___call, sizeof(__pyx_k_Function___call), 0, 0, 1, 1}, - {&__pyx_n_s_Function___call_function, __pyx_k_Function___call_function, sizeof(__pyx_k_Function___call_function), 0, 0, 1, 1}, - {&__pyx_n_s_Function___get_opt_input_value, __pyx_k_Function___get_opt_input_value, sizeof(__pyx_k_Function___get_opt_input_value), 0, 0, 1, 1}, - {&__pyx_n_s_Function___init, __pyx_k_Function___init, sizeof(__pyx_k_Function___init), 0, 0, 1, 1}, - {&__pyx_n_s_Function___initialize_function_i, __pyx_k_Function___initialize_function_i, sizeof(__pyx_k_Function___initialize_function_i), 0, 0, 1, 1}, - {&__pyx_n_s_Function___input_price_series_na, __pyx_k_Function___input_price_series_na, sizeof(__pyx_k_Function___input_price_series_na), 0, 0, 1, 1}, - {&__pyx_n_s_Function___repr, __pyx_k_Function___repr, sizeof(__pyx_k_Function___repr), 0, 0, 1, 1}, - {&__pyx_n_s_Function___str, __pyx_k_Function___str, sizeof(__pyx_k_Function___str), 0, 0, 1, 1}, - {&__pyx_n_s_Function___unicode, __pyx_k_Function___unicode, sizeof(__pyx_k_Function___unicode), 0, 0, 1, 1}, - {&__pyx_n_s_Function__call_function, __pyx_k_Function__call_function, sizeof(__pyx_k_Function__call_function), 0, 0, 1, 1}, - {&__pyx_n_s_Function__get_opt_input_value, __pyx_k_Function__get_opt_input_value, sizeof(__pyx_k_Function__get_opt_input_value), 0, 0, 1, 1}, - {&__pyx_n_s_Function__info, __pyx_k_Function__info, sizeof(__pyx_k_Function__info), 0, 0, 1, 1}, - {&__pyx_n_s_Function__initialize_function_i, __pyx_k_Function__initialize_function_i, sizeof(__pyx_k_Function__initialize_function_i), 0, 0, 1, 1}, - {&__pyx_n_s_Function__input_arrays, __pyx_k_Function__input_arrays, sizeof(__pyx_k_Function__input_arrays), 0, 0, 1, 1}, - {&__pyx_n_s_Function__input_names, __pyx_k_Function__input_names, sizeof(__pyx_k_Function__input_names), 0, 0, 1, 1}, - {&__pyx_n_s_Function__input_price_series_na, __pyx_k_Function__input_price_series_na, sizeof(__pyx_k_Function__input_price_series_na), 0, 0, 1, 1}, - {&__pyx_n_s_Function__name, __pyx_k_Function__name, sizeof(__pyx_k_Function__name), 0, 0, 1, 1}, - {&__pyx_n_s_Function__namestr, __pyx_k_Function__namestr, sizeof(__pyx_k_Function__namestr), 0, 0, 1, 1}, - {&__pyx_n_s_Function__opt_inputs, __pyx_k_Function__opt_inputs, sizeof(__pyx_k_Function__opt_inputs), 0, 0, 1, 1}, - {&__pyx_n_s_Function__outputs, __pyx_k_Function__outputs, sizeof(__pyx_k_Function__outputs), 0, 0, 1, 1}, - {&__pyx_n_s_Function__outputs_valid, __pyx_k_Function__outputs_valid, sizeof(__pyx_k_Function__outputs_valid), 0, 0, 1, 1}, - {&__pyx_n_s_Function_function_flags, __pyx_k_Function_function_flags, sizeof(__pyx_k_Function_function_flags), 0, 0, 1, 1}, - {&__pyx_n_s_Function_get_input_arrays, __pyx_k_Function_get_input_arrays, sizeof(__pyx_k_Function_get_input_arrays), 0, 0, 1, 1}, - {&__pyx_n_s_Function_get_input_names, __pyx_k_Function_get_input_names, sizeof(__pyx_k_Function_get_input_names), 0, 0, 1, 1}, - {&__pyx_n_s_Function_get_parameters, __pyx_k_Function_get_parameters, sizeof(__pyx_k_Function_get_parameters), 0, 0, 1, 1}, - {&__pyx_kp_s_Function_has_an_unstable_period, __pyx_k_Function_has_an_unstable_period, sizeof(__pyx_k_Function_has_an_unstable_period), 0, 0, 1, 0}, - {&__pyx_n_s_Function_info, __pyx_k_Function_info, sizeof(__pyx_k_Function_info), 0, 0, 1, 1}, - {&__pyx_n_s_Function_lookback, __pyx_k_Function_lookback, sizeof(__pyx_k_Function_lookback), 0, 0, 1, 1}, - {&__pyx_n_s_Function_output_flags, __pyx_k_Function_output_flags, sizeof(__pyx_k_Function_output_flags), 0, 0, 1, 1}, - {&__pyx_n_s_Function_output_names, __pyx_k_Function_output_names, sizeof(__pyx_k_Function_output_names), 0, 0, 1, 1}, - {&__pyx_n_s_Function_outputs, __pyx_k_Function_outputs, sizeof(__pyx_k_Function_outputs), 0, 0, 1, 1}, - {&__pyx_n_s_Function_run, __pyx_k_Function_run, sizeof(__pyx_k_Function_run), 0, 0, 1, 1}, - {&__pyx_n_s_Function_set_function_args, __pyx_k_Function_set_function_args, sizeof(__pyx_k_Function_set_function_args), 0, 0, 1, 1}, - {&__pyx_n_s_Function_set_input_arrays, __pyx_k_Function_set_input_arrays, sizeof(__pyx_k_Function_set_input_arrays), 0, 0, 1, 1}, - {&__pyx_n_s_Function_set_input_names, __pyx_k_Function_set_input_names, sizeof(__pyx_k_Function_set_input_names), 0, 0, 1, 1}, - {&__pyx_n_s_Function_set_parameters, __pyx_k_Function_set_parameters, sizeof(__pyx_k_Function_set_parameters), 0, 0, 1, 1}, - {&__pyx_n_s_Histogram, __pyx_k_Histogram, sizeof(__pyx_k_Histogram), 0, 0, 1, 1}, - {&__pyx_n_s_INPUT_ARRAYS_DEFAULTS, __pyx_k_INPUT_ARRAYS_DEFAULTS, sizeof(__pyx_k_INPUT_ARRAYS_DEFAULTS), 0, 0, 1, 1}, - {&__pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_k_INPUT_ARRAYS_TYPES, sizeof(__pyx_k_INPUT_ARRAYS_TYPES), 0, 0, 1, 1}, - {&__pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS, __pyx_k_INPUT_PRICE_SERIES_DEFAULTS, sizeof(__pyx_k_INPUT_PRICE_SERIES_DEFAULTS), 0, 0, 1, 1}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_kp_s_Inputs, __pyx_k_Inputs, sizeof(__pyx_k_Inputs), 0, 0, 1, 0}, - {&__pyx_n_s_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1}, - {&__pyx_n_s_MA_Type, __pyx_k_MA_Type, sizeof(__pyx_k_MA_Type), 0, 0, 1, 1}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, - {&__pyx_kp_s_Output_can_be_negative, __pyx_k_Output_can_be_negative, sizeof(__pyx_k_Output_can_be_negative), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_can_be_positive, __pyx_k_Output_can_be_positive, sizeof(__pyx_k_Output_can_be_positive), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_can_be_zero, __pyx_k_Output_can_be_zero, sizeof(__pyx_k_Output_can_be_zero), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_is_a_candlestick, __pyx_k_Output_is_a_candlestick, sizeof(__pyx_k_Output_is_a_candlestick), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_is_over_volume, __pyx_k_Output_is_over_volume, sizeof(__pyx_k_Output_is_over_volume), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_scale_same_as_input, __pyx_k_Output_scale_same_as_input, sizeof(__pyx_k_Output_scale_same_as_input), 0, 0, 1, 0}, - {&__pyx_kp_s_Outputs, __pyx_k_Outputs, sizeof(__pyx_k_Outputs), 0, 0, 1, 0}, - {&__pyx_n_s_PANDAS_DATAFRAME, __pyx_k_PANDAS_DATAFRAME, sizeof(__pyx_k_PANDAS_DATAFRAME), 0, 0, 1, 1}, - {&__pyx_n_s_PANDAS_SERIES, __pyx_k_PANDAS_SERIES, sizeof(__pyx_k_PANDAS_SERIES), 0, 0, 1, 1}, - {&__pyx_kp_s_Parameters, __pyx_k_Parameters, sizeof(__pyx_k_Parameters), 0, 0, 1, 0}, - {&__pyx_kp_s_Pattern_Bool, __pyx_k_Pattern_Bool, sizeof(__pyx_k_Pattern_Bool), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1}, - {&__pyx_kp_s_Strength_Pattern_200_100_Bearish, __pyx_k_Strength_Pattern_200_100_Bearish, sizeof(__pyx_k_Strength_Pattern_200_100_Bearish), 0, 0, 1, 0}, - {&__pyx_n_s_TA_FUNC_FLAGS, __pyx_k_TA_FUNC_FLAGS, sizeof(__pyx_k_TA_FUNC_FLAGS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_FuncTableAlloc, __pyx_k_TA_FuncTableAlloc, sizeof(__pyx_k_TA_FuncTableAlloc), 0, 0, 1, 1}, - {&__pyx_n_s_TA_FuncTableFree, __pyx_k_TA_FuncTableFree, sizeof(__pyx_k_TA_FuncTableFree), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetFuncHandle, __pyx_k_TA_GetFuncHandle, sizeof(__pyx_k_TA_GetFuncHandle), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetFuncInfo, __pyx_k_TA_GetFuncInfo, sizeof(__pyx_k_TA_GetFuncInfo), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetInputParameterInfo, __pyx_k_TA_GetInputParameterInfo, sizeof(__pyx_k_TA_GetInputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetLookback, __pyx_k_TA_GetLookback, sizeof(__pyx_k_TA_GetLookback), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetOptInputParameterInfo, __pyx_k_TA_GetOptInputParameterInfo, sizeof(__pyx_k_TA_GetOptInputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GetOutputParameterInfo, __pyx_k_TA_GetOutputParameterInfo, sizeof(__pyx_k_TA_GetOutputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GroupTableAlloc, __pyx_k_TA_GroupTableAlloc, sizeof(__pyx_k_TA_GroupTableAlloc), 0, 0, 1, 1}, - {&__pyx_n_s_TA_GroupTableFree, __pyx_k_TA_GroupTableFree, sizeof(__pyx_k_TA_GroupTableFree), 0, 0, 1, 1}, - {&__pyx_n_s_TA_INPUT_FLAGS, __pyx_k_TA_INPUT_FLAGS, sizeof(__pyx_k_TA_INPUT_FLAGS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_OUTPUT_FLAGS, __pyx_k_TA_OUTPUT_FLAGS, sizeof(__pyx_k_TA_OUTPUT_FLAGS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ParamHolderAlloc, __pyx_k_TA_ParamHolderAlloc, sizeof(__pyx_k_TA_ParamHolderAlloc), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ParamHolderFree, __pyx_k_TA_ParamHolderFree, sizeof(__pyx_k_TA_ParamHolderFree), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SetOptInputParamInteger, __pyx_k_TA_SetOptInputParamInteger, sizeof(__pyx_k_TA_SetOptInputParamInteger), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SetOptInputParamReal, __pyx_k_TA_SetOptInputParamReal, sizeof(__pyx_k_TA_SetOptInputParamReal), 0, 0, 1, 1}, - {&__pyx_kp_s_This_is_a_pythonic_wrapper_arou, __pyx_k_This_is_a_pythonic_wrapper_arou, sizeof(__pyx_k_This_is_a_pythonic_wrapper_arou), 0, 0, 1, 0}, - {&__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_k_Users_jbenedik_Dev_ta_lib_talib, sizeof(__pyx_k_Users_jbenedik_Dev_ta_lib_talib), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_s_Values_represent_a_lower_limit, __pyx_k_Values_represent_a_lower_limit, sizeof(__pyx_k_Values_represent_a_lower_limit), 0, 0, 1, 0}, - {&__pyx_kp_s_Values_represent_an_upper_limit, __pyx_k_Values_represent_an_upper_limit, sizeof(__pyx_k_Values_represent_an_upper_limit), 0, 0, 1, 0}, - {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, - {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0}, - {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, - {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, - {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, - {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_kp_s_any_ndarray, __pyx_k_any_ndarray, sizeof(__pyx_k_any_ndarray), 0, 0, 1, 0}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, - {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, - {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, - {&__pyx_n_s_bytes2str, __pyx_k_bytes2str, sizeof(__pyx_k_bytes2str), 0, 0, 1, 1}, - {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, - {&__pyx_n_s_call_function, __pyx_k_call_function, sizeof(__pyx_k_call_function), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_column_stack, __pyx_k_column_stack, sizeof(__pyx_k_column_stack), 0, 0, 1, 1}, - {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, - {&__pyx_n_s_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, - {&__pyx_n_s_default_value, __pyx_k_default_value, sizeof(__pyx_k_default_value), 0, 0, 1, 1}, - {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, - {&__pyx_n_s_display_name, __pyx_k_display_name, sizeof(__pyx_k_display_name), 0, 0, 1, 1}, - {&__pyx_kp_s_display_name_s_group_s, __pyx_k_display_name_s_group_s, sizeof(__pyx_k_display_name_s_group_s), 0, 0, 1, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_docs, __pyx_k_docs, sizeof(__pyx_k_docs), 0, 0, 1, 1}, - {&__pyx_n_s_documentation, __pyx_k_documentation, sizeof(__pyx_k_documentation), 0, 0, 1, 1}, - {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, - {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, - {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, - {&__pyx_n_s_flags_lookup_dict, __pyx_k_flags_lookup_dict, sizeof(__pyx_k_flags_lookup_dict), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_func_args, __pyx_k_func_args, sizeof(__pyx_k_func_args), 0, 0, 1, 1}, - {&__pyx_n_s_func_c, __pyx_k_func_c, sizeof(__pyx_k_func_c), 0, 0, 1, 1}, - {&__pyx_n_s_func_info, __pyx_k_func_info, sizeof(__pyx_k_func_info), 0, 0, 1, 1}, - {&__pyx_n_s_func_line, __pyx_k_func_line, sizeof(__pyx_k_func_line), 0, 0, 1, 1}, - {&__pyx_n_s_function_flags, __pyx_k_function_flags, sizeof(__pyx_k_function_flags), 0, 0, 1, 1}, - {&__pyx_n_s_function_name, __pyx_k_function_name, sizeof(__pyx_k_function_name), 0, 0, 1, 1}, - {&__pyx_n_s_functions, __pyx_k_functions, sizeof(__pyx_k_functions), 0, 0, 1, 1}, - {&__pyx_n_s_get_defaults_and_docs, __pyx_k_get_defaults_and_docs, sizeof(__pyx_k_get_defaults_and_docs), 0, 0, 1, 1}, - {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, - {&__pyx_n_s_get_input_arrays, __pyx_k_get_input_arrays, sizeof(__pyx_k_get_input_arrays), 0, 0, 1, 1}, - {&__pyx_n_s_get_input_names, __pyx_k_get_input_names, sizeof(__pyx_k_get_input_names), 0, 0, 1, 1}, - {&__pyx_n_s_get_opt_input_value, __pyx_k_get_opt_input_value, sizeof(__pyx_k_get_opt_input_value), 0, 0, 1, 1}, - {&__pyx_n_s_get_parameters, __pyx_k_get_parameters, sizeof(__pyx_k_get_parameters), 0, 0, 1, 1}, - {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1}, - {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, - {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1}, - {&__pyx_n_s_help, __pyx_k_help, sizeof(__pyx_k_help), 0, 0, 1, 1}, - {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1}, - {&__pyx_n_s_holder, __pyx_k_holder, sizeof(__pyx_k_holder), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_in, __pyx_k_in, sizeof(__pyx_k_in), 0, 0, 1, 1}, - {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, - {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_initialize_function_info, __pyx_k_initialize_function_info, sizeof(__pyx_k_initialize_function_info), 0, 0, 1, 1}, - {&__pyx_n_s_input_arrays, __pyx_k_input_arrays, sizeof(__pyx_k_input_arrays), 0, 0, 1, 1}, - {&__pyx_kp_s_input_arrays_2, __pyx_k_input_arrays_2, sizeof(__pyx_k_input_arrays_2), 0, 0, 1, 0}, - {&__pyx_kp_s_input_arrays_parameter_missing_r, __pyx_k_input_arrays_parameter_missing_r, sizeof(__pyx_k_input_arrays_parameter_missing_r), 0, 0, 1, 0}, - {&__pyx_n_s_input_name, __pyx_k_input_name, sizeof(__pyx_k_input_name), 0, 0, 1, 1}, - {&__pyx_n_s_input_names, __pyx_k_input_names, sizeof(__pyx_k_input_names), 0, 0, 1, 1}, - {&__pyx_n_s_input_price_series_names, __pyx_k_input_price_series_names, sizeof(__pyx_k_input_price_series_names), 0, 0, 1, 1}, - {&__pyx_n_s_input_price_series_names_2, __pyx_k_input_price_series_names_2, sizeof(__pyx_k_input_price_series_names_2), 0, 0, 1, 1}, - {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, - {&__pyx_kp_s_integer_values_are_100_0_or_100, __pyx_k_integer_values_are_100_0_or_100, sizeof(__pyx_k_integer_values_are_100_0_or_100), 0, 0, 1, 0}, - {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, - {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, - {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1}, - {&__pyx_n_s_lookback, __pyx_k_lookback, sizeof(__pyx_k_lookback), 0, 0, 1, 1}, - {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1}, - {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, - {&__pyx_n_s_matype, __pyx_k_matype, sizeof(__pyx_k_matype), 0, 0, 1, 1}, - {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, - {&__pyx_n_s_max_int, __pyx_k_max_int, sizeof(__pyx_k_max_int), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, - {&__pyx_n_s_min_int, __pyx_k_min_int, sizeof(__pyx_k_min_int), 0, 0, 1, 1}, - {&__pyx_n_s_missing_keys, __pyx_k_missing_keys, sizeof(__pyx_k_missing_keys), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_num_inputs, __pyx_k_num_inputs, sizeof(__pyx_k_num_inputs), 0, 0, 1, 1}, - {&__pyx_n_s_num_opt_inputs, __pyx_k_num_opt_inputs, sizeof(__pyx_k_num_opt_inputs), 0, 0, 1, 1}, - {&__pyx_n_s_num_outputs, __pyx_k_num_outputs, sizeof(__pyx_k_num_outputs), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, - {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, - {&__pyx_n_s_openInterest, __pyx_k_openInterest, sizeof(__pyx_k_openInterest), 0, 0, 1, 1}, - {&__pyx_n_s_optIn, __pyx_k_optIn, sizeof(__pyx_k_optIn), 0, 0, 1, 1}, - {&__pyx_n_s_opt_input, __pyx_k_opt_input, sizeof(__pyx_k_opt_input), 0, 0, 1, 1}, - {&__pyx_n_s_ordereddict, __pyx_k_ordereddict, sizeof(__pyx_k_ordereddict), 0, 0, 1, 1}, - {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, - {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, - {&__pyx_n_s_output_flags, __pyx_k_output_flags, sizeof(__pyx_k_output_flags), 0, 0, 1, 1}, - {&__pyx_n_s_output_name, __pyx_k_output_name, sizeof(__pyx_k_output_name), 0, 0, 1, 1}, - {&__pyx_n_s_output_names, __pyx_k_output_names, sizeof(__pyx_k_output_names), 0, 0, 1, 1}, - {&__pyx_n_s_outputs, __pyx_k_outputs, sizeof(__pyx_k_outputs), 0, 0, 1, 1}, - {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, - {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, - {&__pyx_n_s_param_name, __pyx_k_param_name, sizeof(__pyx_k_param_name), 0, 0, 1, 1}, - {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, - {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_price, __pyx_k_price, sizeof(__pyx_k_price), 0, 0, 1, 1}, - {&__pyx_n_s_price0, __pyx_k_price0, sizeof(__pyx_k_price0), 0, 0, 1, 1}, - {&__pyx_n_s_price1, __pyx_k_price1, sizeof(__pyx_k_price1), 0, 0, 1, 1}, - {&__pyx_n_s_price_series, __pyx_k_price_series, sizeof(__pyx_k_price_series), 0, 0, 1, 1}, - {&__pyx_n_s_prices, __pyx_k_prices, sizeof(__pyx_k_prices), 0, 0, 1, 1}, - {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, - {&__pyx_n_s_real0, __pyx_k_real0, sizeof(__pyx_k_real0), 0, 0, 1, 1}, - {&__pyx_n_s_real1, __pyx_k_real1, sizeof(__pyx_k_real1), 0, 0, 1, 1}, - {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, - {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, - {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, - {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, - {&__pyx_n_s_retCode, __pyx_k_retCode, sizeof(__pyx_k_retCode), 0, 0, 1, 1}, - {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, - {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, - {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0}, - {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0}, - {&__pyx_kp_s_s_4, __pyx_k_s_4, sizeof(__pyx_k_s_4), 0, 0, 1, 0}, - {&__pyx_kp_s_s_Function_s, __pyx_k_s_Function_s, sizeof(__pyx_k_s_Function_s), 0, 0, 1, 0}, - {&__pyx_kp_s_s_not_supported_by_TA_LIB, __pyx_k_s_not_supported_by_TA_LIB, sizeof(__pyx_k_s_not_supported_by_TA_LIB), 0, 0, 1, 0}, - {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, - {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1}, - {&__pyx_n_s_set_function_args, __pyx_k_set_function_args, sizeof(__pyx_k_set_function_args), 0, 0, 1, 1}, - {&__pyx_n_s_set_input_arrays, __pyx_k_set_input_arrays, sizeof(__pyx_k_set_input_arrays), 0, 0, 1, 1}, - {&__pyx_n_s_set_input_names, __pyx_k_set_input_names, sizeof(__pyx_k_set_input_names), 0, 0, 1, 1}, - {&__pyx_n_s_set_parameters, __pyx_k_set_parameters, sizeof(__pyx_k_set_parameters), 0, 0, 1, 1}, - {&__pyx_n_s_skip_first, __pyx_k_skip_first, sizeof(__pyx_k_skip_first), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_str2bytes, __pyx_k_str2bytes, sizeof(__pyx_k_str2bytes), 0, 0, 1, 1}, - {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, - {&__pyx_n_s_ta_check_success, __pyx_k_ta_check_success, sizeof(__pyx_k_ta_check_success), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getFuncInfo, __pyx_k_ta_getFuncInfo, sizeof(__pyx_k_ta_getFuncInfo), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getFuncTable, __pyx_k_ta_getFuncTable, sizeof(__pyx_k_ta_getFuncTable), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getGroupTable, __pyx_k_ta_getGroupTable, sizeof(__pyx_k_ta_getGroupTable), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getInputParameterInfo, __pyx_k_ta_getInputParameterInfo, sizeof(__pyx_k_ta_getInputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getOptInputParameterInfo, __pyx_k_ta_getOptInputParameterInfo, sizeof(__pyx_k_ta_getOptInputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_ta_getOutputParameterInfo, __pyx_k_ta_getOutputParameterInfo, sizeof(__pyx_k_ta_getOutputParameterInfo), 0, 0, 1, 1}, - {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, - {&__pyx_n_s_talib_abstract, __pyx_k_talib_abstract, sizeof(__pyx_k_talib_abstract), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_timeStamp, __pyx_k_timeStamp, sizeof(__pyx_k_timeStamp), 0, 0, 1, 1}, - {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, - {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, - {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_update_info, __pyx_k_update_info, sizeof(__pyx_k_update_info), 0, 0, 1, 1}, - {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_value_range, __pyx_k_value_range, sizeof(__pyx_k_value_range), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, - {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, - {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "talib/abstract.pyx":54 - * - * def bytes2str(b): - * return b.decode('ascii') # <<<<<<<<<<<<<< - * - * else: - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "talib/abstract.pyx":118 - * - * # inputs (price series names) - * for i in xrange(self.__info.pop('num_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getInputParameterInfo(self.__name, i) - * input_name = info['name'] - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_num_inputs); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "talib/abstract.pyx":127 - * - * # optional inputs (function parameters) - * for i in xrange(self.__info.pop('num_opt_inputs')): # <<<<<<<<<<<<<< - * info = _ta_getOptInputParameterInfo(self.__name, i) - * param_name = info['name'] - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_num_opt_inputs); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "talib/abstract.pyx":135 - * # outputs - * self.__info['output_flags'] = OrderedDict() - * for i in xrange(self.__info.pop('num_outputs')): # <<<<<<<<<<<<<< - * info = _ta_getOutputParameterInfo(self.__name, i) - * output_name = info['name'] - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_num_outputs); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "talib/abstract.pyx":543 - * name = name[len('in'):].lower() - * if 'real' in name: - * name = name.replace('real', 'price') # <<<<<<<<<<<<<< - * elif 'price' in name: - * name = 'prices' - */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_real, __pyx_n_s_price); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "talib/abstract.pyx":50 - * if sys.version >= '3': - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return bytes(s, 'ascii') - * - */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_str2bytes, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":53 - * return bytes(s, 'ascii') - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b.decode('ascii') - * - */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_bytes2str, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":58 - * else: - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return s - * - */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_str2bytes, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":61 - * return s - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b - * - */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_bytes2str, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":93 - * """ - * - * def __init__(self, function_name, *args, **kwargs): # <<<<<<<<<<<<<< - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - */ - __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_function_name, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_init, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":113 - * self.set_function_args(*args, **kwargs) - * - * def __initialize_function_info(self): # <<<<<<<<<<<<<< - * # function info - * self.__info = _ta_getFuncInfo(self.__name) - */ - __pyx_tuple__28 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_info, __pyx_n_s_input_name, __pyx_n_s_param_name, __pyx_n_s_output_name); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_initialize_function_info, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":143 - * - * @property - * def info(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the function's info dict. - */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_info, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":150 - * - * @property - * def function_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns any function flags defined for this indicator function. - */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_function_flags, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":157 - * - * @property - * def output_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns the flags for each output for this indicator function. - */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_output_flags, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":163 - * return self.__info['output_flags'].copy() - * - * def get_input_names(self): # <<<<<<<<<<<<<< - * """ - * Returns the dict of input price series names that specifies which - */ - __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_input_name); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_input_names, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":173 - * return ret - * - * def set_input_names(self, input_names): # <<<<<<<<<<<<<< - * """ - * Sets the input price series names to use. - */ - __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input_names, __pyx_n_s_input_name, __pyx_n_s_price_series); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_set_input_names, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":184 - * input_names = property(get_input_names, set_input_names) - * - * def get_input_arrays(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the dict of input arrays in use. - */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_input_arrays, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":190 - * return self.__input_arrays.copy() - * - * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< - * """ - * Sets the dict of input_arrays to use. Returns True/False for - */ - __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input_arrays, __pyx_n_s_missing_keys, __pyx_n_s_key); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_set_input_arrays, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":233 - * input_arrays = property(get_input_arrays, set_input_arrays) - * - * def get_parameters(self): # <<<<<<<<<<<<<< - * """ - * Returns the function's optional parameters and their default values. - */ - __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_opt_input); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_parameters, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":242 - * return ret - * - * def set_parameters(self, parameters): # <<<<<<<<<<<<<< - * """ - * Sets the function parameter values. - */ - __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_parameters, __pyx_n_s_param, __pyx_n_s_value); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_set_parameters, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":253 - * parameters = property(get_parameters, set_parameters) - * - * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] - */ - __pyx_tuple__48 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_update_info, __pyx_n_s_key, __pyx_n_s_skip_first, __pyx_n_s_i, __pyx_n_s_param_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_set_function_args, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":285 - * - * @property - * def lookback(self): # <<<<<<<<<<<<<< - * """ - * Returns the lookback window size for the function with the parameter - */ - __pyx_tuple__50 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_holder, __pyx_n_s_i, __pyx_n_s_opt_input, __pyx_n_s_value, __pyx_n_s_type_2, __pyx_n_s_lookback); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_lookback, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":305 - * - * @property - * def output_names(self): # <<<<<<<<<<<<<< - * """ - * Returns a list of the output names returned by this function. - */ - __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_output_names, 305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":315 - * - * @property - * def outputs(self): # <<<<<<<<<<<<<< - * """ - * Returns the TA function values for the currently set input_arrays and - */ - __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ret, __pyx_n_s_index); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_outputs, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":338 - * return ret[0] if len(ret) == 1 else ret - * - * def run(self, input_arrays=None): # <<<<<<<<<<<<<< - * """ - * run([input_arrays=None]) - */ - __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_input_arrays); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_run, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_tuple__58 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - - /* "talib/abstract.pyx":350 - * return self.outputs - * - * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) - */ - __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_call, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":362 - * - * # figure out which price series names we're using for inputs - * def __input_price_series_names(self): # <<<<<<<<<<<<<< - * input_price_series_names = [] - * for input_name in self.__input_names: - */ - __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_input_price_series_names, __pyx_n_s_input_name, __pyx_n_s_price_series, __pyx_n_s_name); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_input_price_series_names_2, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":373 - * return input_price_series_names - * - * def __call_function(self): # <<<<<<<<<<<<<< - * input_price_series_names = self.__input_price_series_names() - * - */ - __pyx_tuple__63 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_input_price_series_names, __pyx_n_s_args, __pyx_n_s_price_series, __pyx_n_s_series, __pyx_n_s_opt_input, __pyx_n_s_value, __pyx_n_s_results, __pyx_n_s_keys, __pyx_n_s_i, __pyx_n_s_output); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_call_function, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":400 - * self.__outputs_valid = True - * - * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< - * """ - * Returns the user-set value if there is one, otherwise the default. - */ - __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_input_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_opt_input_value, 400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":409 - * return value - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return '%s' % self.info - * - */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_repr, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":412 - * return '%s' % self.info - * - * def __unicode__(self): # <<<<<<<<<<<<<< - * return unicode(self.__str__()) - * - */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_unicode, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":415 - * return unicode(self.__str__()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults - * - */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_str, 415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":429 - * # therefore recommended over using these functions directly. - * - * def _ta_getGroupTable(): # <<<<<<<<<<<<<< - * """ - * Returns the list of available TALIB function group names. *slow* - */ - __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_table, __pyx_n_s_groups, __pyx_n_s_i); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getGroupTable, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":441 - * return groups - * - * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< - * """ - * Returns a list of the functions for the specified group name. *slow* - */ - __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_group, __pyx_n_s_group, __pyx_n_s_table, __pyx_n_s_functions, __pyx_n_s_i); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getFuncTable, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":453 - * return functions - * - * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< - * """ - * TA-LIB provides hints for multiple flags as a bitwise-ORed int. - */ - __pyx_tuple__77 = PyTuple_Pack(7, __pyx_n_s_flag, __pyx_n_s_flags_lookup_dict, __pyx_n_s_value_range, __pyx_n_s_min_int, __pyx_n_s_max_int, __pyx_n_s_ret, __pyx_n_s_i); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_flags, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":512 - * } - * - * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns the info dict for the function. It has the following keys: name, - */ - __pyx_tuple__79 = PyTuple_Pack(4, __pyx_n_s_function_name, __pyx_n_s_function_name, __pyx_n_s_info, __pyx_n_s_retCode); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getFuncInfo, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":531 - * } - * - * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's input info dict for the given index. It has two - */ - __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getInputParameterInfo, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":552 - * } - * - * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's opt_input info dict for the given index. It has the - */ - __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name, __pyx_n_s_default_value); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getOptInputParameterInfo, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":576 - * } - * - * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's output info dict for the given index. It has two - */ - __pyx_tuple__85 = PyTuple_Pack(5, __pyx_n_s_function_name, __pyx_n_s_idx, __pyx_n_s_info, __pyx_n_s_retCode, __pyx_n_s_name); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_getOutputParameterInfo, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":596 - * } - * - * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< - * """ - * Returns a tuple with two outputs: defaults, a dict of parameter defaults, - */ - __pyx_tuple__87 = PyTuple_Pack(13, __pyx_n_s_func_info, __pyx_n_s_defaults, __pyx_n_s_func_line, __pyx_n_s_func_args, __pyx_n_s_docs, __pyx_n_s_input_names, __pyx_n_s_input_name, __pyx_n_s_value, __pyx_n_s_params, __pyx_n_s_param, __pyx_n_s_outputs, __pyx_n_s_output, __pyx_n_s_documentation); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_get_defaults_and_docs, 596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_16777216 = PyInt_FromLong(16777216L); if (unlikely(!__pyx_int_16777216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_67108864 = PyInt_FromLong(67108864L); if (unlikely(!__pyx_int_67108864)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_134217728 = PyInt_FromLong(134217728L); if (unlikely(!__pyx_int_134217728)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initabstract(void); /*proto*/ -PyMODINIT_FUNC initabstract(void) -#else -PyMODINIT_FUNC PyInit_abstract(void); /*proto*/ -PyMODINIT_FUNC PyInit_abstract(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_abstract(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("abstract", __pyx_methods, __pyx_k_This_file_Copyright_c_2013_Bria, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_talib__abstract) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "talib.abstract")) { - if (unlikely(PyDict_SetItemString(modules, "talib.abstract", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - - /* "talib/abstract.pyx":4 - * This file Copyright (c) 2013 Brian A Cappello - * ''' - * import math # <<<<<<<<<<<<<< - * - * from . import func as func_c - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":6 - * import math - * - * from . import func as func_c # <<<<<<<<<<<<<< - * from .common import _ta_check_success, MA_Type - * try: - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_func); - __Pyx_GIVEREF(__pyx_n_s_func); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_func); - __pyx_t_2 = __Pyx_Import(__pyx_kp_s__5, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_func); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_func_c, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":7 - * - * from . import func as func_c - * from .common import _ta_check_success, MA_Type # <<<<<<<<<<<<<< - * try: - * from collections import OrderedDict - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_ta_check_success); - __Pyx_GIVEREF(__pyx_n_s_ta_check_success); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ta_check_success); - __Pyx_INCREF(__pyx_n_s_MA_Type); - __Pyx_GIVEREF(__pyx_n_s_MA_Type); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_MA_Type); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_common, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ta_check_success); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_check_success, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA_Type, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":8 - * from . import func as func_c - * from .common import _ta_check_success, MA_Type - * try: # <<<<<<<<<<<<<< - * from collections import OrderedDict - * except ImportError: # handle python 2.6 and earlier - */ - { - __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - /*try:*/ { - - /* "talib/abstract.pyx":9 - * from .common import _ta_check_success, MA_Type - * try: - * from collections import OrderedDict # <<<<<<<<<<<<<< - * except ImportError: # handle python 2.6 and earlier - * from ordereddict import OrderedDict - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_OrderedDict); - __Pyx_GIVEREF(__pyx_n_s_OrderedDict); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":8 - * from . import func as func_c - * from .common import _ta_check_success, MA_Type - * try: # <<<<<<<<<<<<<< - * from collections import OrderedDict - * except ImportError: # handle python 2.6 and earlier - */ - } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L9_try_end; - __pyx_L2_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":10 - * try: - * from collections import OrderedDict - * except ImportError: # handle python 2.6 and earlier # <<<<<<<<<<<<<< - * from ordereddict import OrderedDict - * from cython.operator cimport dereference as deref - */ - __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); - if (__pyx_t_6) { - __Pyx_AddTraceback("talib.abstract", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_7); - - /* "talib/abstract.pyx":11 - * from collections import OrderedDict - * except ImportError: # handle python 2.6 and earlier - * from ordereddict import OrderedDict # <<<<<<<<<<<<<< - * from cython.operator cimport dereference as deref - * import numpy - */ - __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_n_s_OrderedDict); - __Pyx_GIVEREF(__pyx_n_s_OrderedDict); - PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_OrderedDict); - __pyx_t_9 = __Pyx_Import(__pyx_n_s_ordereddict, __pyx_t_8, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L3_exception_handled; - } - goto __pyx_L4_except_error; - __pyx_L4_except_error:; - - /* "talib/abstract.pyx":8 - * from . import func as func_c - * from .common import _ta_check_success, MA_Type - * try: # <<<<<<<<<<<<<< - * from collections import OrderedDict - * except ImportError: # handle python 2.6 and earlier - */ - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L1_error; - __pyx_L3_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - __pyx_L9_try_end:; - } - - /* "talib/abstract.pyx":13 - * from ordereddict import OrderedDict - * from cython.operator cimport dereference as deref - * import numpy # <<<<<<<<<<<<<< - * import sys - * - */ - __pyx_t_7 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":14 - * from cython.operator cimport dereference as deref - * import numpy - * import sys # <<<<<<<<<<<<<< - * - * cimport numpy as np - */ - __pyx_t_7 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":19 - * cimport libta_lib as lib - * - * lib.TA_Initialize() # <<<<<<<<<<<<<< - * - * __FUNCTION_NAMES = set(func_c.__all__) - */ - TA_Initialize(); - - /* "talib/abstract.pyx":21 - * lib.TA_Initialize() - * - * __FUNCTION_NAMES = set(func_c.__all__) # <<<<<<<<<<<<<< - * - * __INPUT_ARRAYS_DEFAULTS = {'open': None, - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_func_c); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FUNCTION_NAMES, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":23 - * __FUNCTION_NAMES = set(func_c.__all__) - * - * __INPUT_ARRAYS_DEFAULTS = {'open': None, # <<<<<<<<<<<<<< - * 'high': None, - * 'low': None, - */ - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_open, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":24 - * - * __INPUT_ARRAYS_DEFAULTS = {'open': None, - * 'high': None, # <<<<<<<<<<<<<< - * 'low': None, - * 'close': None, - */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_high, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":25 - * __INPUT_ARRAYS_DEFAULTS = {'open': None, - * 'high': None, - * 'low': None, # <<<<<<<<<<<<<< - * 'close': None, - * 'volume': None, - */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_low, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":26 - * 'high': None, - * 'low': None, - * 'close': None, # <<<<<<<<<<<<<< - * 'volume': None, - * } - */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_close, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/abstract.pyx":27 - * 'low': None, - * 'close': None, - * 'volume': None, # <<<<<<<<<<<<<< - * } - * - */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_volume, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_DEFAULTS, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":31 - * - * # lookup for TALIB input parameters which don't define expected price series inputs - * __INPUT_PRICE_SERIES_DEFAULTS = {'price': 'close', # <<<<<<<<<<<<<< - * 'price0': 'high', - * 'price1': 'low', - */ - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_price, __pyx_n_s_close) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_price0, __pyx_n_s_high) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_price1, __pyx_n_s_low) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_periods, __pyx_n_s_periods) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_PRICE_SERIES_DEFAULTS, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":38 - * - * # allow use of pandas.DataFrame for input arrays - * try: # <<<<<<<<<<<<<< - * import pandas - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - */ - { - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "talib/abstract.pyx":39 - * # allow use of pandas.DataFrame for input arrays - * try: - * import pandas # <<<<<<<<<<<<<< - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - * __PANDAS_DATAFRAME = pandas.DataFrame - */ - __pyx_t_7 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":40 - * try: - * import pandas - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) # <<<<<<<<<<<<<< - * __PANDAS_DATAFRAME = pandas.DataFrame - * __PANDAS_SERIES = pandas.Series - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)(&PyDict_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyDict_Type))); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":41 - * import pandas - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - * __PANDAS_DATAFRAME = pandas.DataFrame # <<<<<<<<<<<<<< - * __PANDAS_SERIES = pandas.Series - * except ImportError: - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_DATAFRAME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":42 - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - * __PANDAS_DATAFRAME = pandas.DataFrame - * __PANDAS_SERIES = pandas.Series # <<<<<<<<<<<<<< - * except ImportError: - * __INPUT_ARRAYS_TYPES = (dict,) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Series); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_SERIES, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L12_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":38 - * - * # allow use of pandas.DataFrame for input arrays - * try: # <<<<<<<<<<<<<< - * import pandas - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - */ - } - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L19_try_end; - __pyx_L12_error:; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "talib/abstract.pyx":43 - * __PANDAS_DATAFRAME = pandas.DataFrame - * __PANDAS_SERIES = pandas.Series - * except ImportError: # <<<<<<<<<<<<<< - * __INPUT_ARRAYS_TYPES = (dict,) - * __PANDAS_DATAFRAME = None - */ - __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); - if (__pyx_t_6) { - __Pyx_AddTraceback("talib.abstract", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); - - /* "talib/abstract.pyx":44 - * __PANDAS_SERIES = pandas.Series - * except ImportError: - * __INPUT_ARRAYS_TYPES = (dict,) # <<<<<<<<<<<<<< - * __PANDAS_DATAFRAME = None - * __PANDAS_SERIES = None - */ - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(((PyObject *)(&PyDict_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)(&PyDict_Type))); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUT_ARRAYS_TYPES, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":45 - * except ImportError: - * __INPUT_ARRAYS_TYPES = (dict,) - * __PANDAS_DATAFRAME = None # <<<<<<<<<<<<<< - * __PANDAS_SERIES = None - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_DATAFRAME, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} - - /* "talib/abstract.pyx":46 - * __INPUT_ARRAYS_TYPES = (dict,) - * __PANDAS_DATAFRAME = None - * __PANDAS_SERIES = None # <<<<<<<<<<<<<< - * - * if sys.version >= '3': - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PANDAS_SERIES, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L13_exception_handled; - } - goto __pyx_L14_except_error; - __pyx_L14_except_error:; - - /* "talib/abstract.pyx":38 - * - * # allow use of pandas.DataFrame for input arrays - * try: # <<<<<<<<<<<<<< - * import pandas - * __INPUT_ARRAYS_TYPES = (dict, pandas.DataFrame) - */ - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L13_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); - __pyx_L19_try_end:; - } - - /* "talib/abstract.pyx":48 - * __PANDAS_SERIES = None - * - * if sys.version >= '3': # <<<<<<<<<<<<<< - * - * def str2bytes(s): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_s_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { - - /* "talib/abstract.pyx":50 - * if sys.version >= '3': - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return bytes(s, 'ascii') - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_1str2bytes, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2bytes, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":53 - * return bytes(s, 'ascii') - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b.decode('ascii') - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_3bytes2str, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes2str, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":48 - * __PANDAS_SERIES = None - * - * if sys.version >= '3': # <<<<<<<<<<<<<< - * - * def str2bytes(s): - */ - goto __pyx_L22; - } - - /* "talib/abstract.pyx":58 - * else: - * - * def str2bytes(s): # <<<<<<<<<<<<<< - * return s - * - */ - /*else*/ { - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_5str2bytes, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2bytes, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":61 - * return s - * - * def bytes2str(b): # <<<<<<<<<<<<<< - * return b - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_7bytes2str, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes2str, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L22:; - - /* "talib/abstract.pyx":64 - * return b - * - * class Function(object): # <<<<<<<<<<<<<< - * """ - * This is a pythonic wrapper around TALIB's abstract interface. It is - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Function, __pyx_n_s_Function, (PyObject *) NULL, __pyx_n_s_talib_abstract, __pyx_kp_s_This_is_a_pythonic_wrapper_arou); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - - /* "talib/abstract.pyx":93 - * """ - * - * def __init__(self, function_name, *args, **kwargs): # <<<<<<<<<<<<<< - * # make sure the function_name is valid and define all of our variables - * self.__name = function_name.upper() - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_1__init__, 0, __pyx_n_s_Function___init, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_init, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":113 - * self.set_function_args(*args, **kwargs) - * - * def __initialize_function_info(self): # <<<<<<<<<<<<<< - * # function info - * self.__info = _ta_getFuncInfo(self.__name) - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_3__initialize_function_info, 0, __pyx_n_s_Function___initialize_function_i, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_Function__initialize_function_i, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":143 - * - * @property - * def info(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the function's info dict. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_5info, 0, __pyx_n_s_Function_info, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":142 - * self.__info['output_names'] = self.output_names - * - * @property # <<<<<<<<<<<<<< - * def info(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_info, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":150 - * - * @property - * def function_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns any function flags defined for this indicator function. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_7function_flags, 0, __pyx_n_s_Function_function_flags, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":149 - * return self.__info.copy() - * - * @property # <<<<<<<<<<<<<< - * def function_flags(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_function_flags, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":157 - * - * @property - * def output_flags(self): # <<<<<<<<<<<<<< - * """ - * Returns the flags for each output for this indicator function. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_9output_flags, 0, __pyx_n_s_Function_output_flags, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":156 - * return self.__info['function_flags'] - * - * @property # <<<<<<<<<<<<<< - * def output_flags(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_output_flags, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":163 - * return self.__info['output_flags'].copy() - * - * def get_input_names(self): # <<<<<<<<<<<<<< - * """ - * Returns the dict of input price series names that specifies which - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_11get_input_names, 0, __pyx_n_s_Function_get_input_names, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_get_input_names, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":173 - * return ret - * - * def set_input_names(self, input_names): # <<<<<<<<<<<<<< - * """ - * Sets the input price series names to use. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_13set_input_names, 0, __pyx_n_s_Function_set_input_names, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_set_input_names, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":182 - * self.__outputs_valid = False - * - * input_names = property(get_input_names, set_input_names) # <<<<<<<<<<<<<< - * - * def get_input_arrays(self): - */ - __pyx_t_9 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_get_input_names); - if (unlikely(!__pyx_t_9)) { - PyErr_Clear(); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_input_names); - } - if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_set_input_names); - if (unlikely(!__pyx_t_8)) { - PyErr_Clear(); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_input_names); - } - if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8); - __pyx_t_9 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_input_names, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":184 - * input_names = property(get_input_names, set_input_names) - * - * def get_input_arrays(self): # <<<<<<<<<<<<<< - * """ - * Returns a copy of the dict of input arrays in use. - */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_15get_input_arrays, 0, __pyx_n_s_Function_get_input_arrays, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_get_input_arrays, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":190 - * return self.__input_arrays.copy() - * - * def set_input_arrays(self, input_arrays): # <<<<<<<<<<<<<< - * """ - * Sets the dict of input_arrays to use. Returns True/False for - */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_17set_input_arrays, 0, __pyx_n_s_Function_set_input_arrays, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_set_input_arrays, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "talib/abstract.pyx":231 - * return False - * - * input_arrays = property(get_input_arrays, set_input_arrays) # <<<<<<<<<<<<<< - * - * def get_parameters(self): - */ - __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_get_input_arrays); - if (unlikely(!__pyx_t_8)) { - PyErr_Clear(); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_input_arrays); - } - if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_set_input_arrays); - if (unlikely(!__pyx_t_11)) { - PyErr_Clear(); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_input_arrays); - } - if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); - __pyx_t_8 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_input_arrays, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "talib/abstract.pyx":233 - * input_arrays = property(get_input_arrays, set_input_arrays) - * - * def get_parameters(self): # <<<<<<<<<<<<<< - * """ - * Returns the function's optional parameters and their default values. - */ - __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_19get_parameters, 0, __pyx_n_s_Function_get_parameters, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_get_parameters, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "talib/abstract.pyx":242 - * return ret - * - * def set_parameters(self, parameters): # <<<<<<<<<<<<<< - * """ - * Sets the function parameter values. - */ - __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_21set_parameters, 0, __pyx_n_s_Function_set_parameters, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_set_parameters, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "talib/abstract.pyx":251 - * self.__info['parameters'] = self.parameters - * - * parameters = property(get_parameters, set_parameters) # <<<<<<<<<<<<<< - * - * def set_function_args(self, *args, **kwargs): - */ - __pyx_t_11 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_get_parameters); - if (unlikely(!__pyx_t_11)) { - PyErr_Clear(); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_parameters); - } - if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_set_parameters); - if (unlikely(!__pyx_t_9)) { - PyErr_Clear(); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_parameters); - } - if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9); - __pyx_t_11 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_parameters, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":253 - * parameters = property(get_parameters, set_parameters) - * - * def set_function_args(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * optionl args:[input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs] - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_23set_function_args, 0, __pyx_n_s_Function_set_function_args, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_set_function_args, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":285 - * - * @property - * def lookback(self): # <<<<<<<<<<<<<< - * """ - * Returns the lookback window size for the function with the parameter - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_25lookback, 0, __pyx_n_s_Function_lookback, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":284 - * self.__outputs_valid = False - * - * @property # <<<<<<<<<<<<<< - * def lookback(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_lookback, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":305 - * - * @property - * def output_names(self): # <<<<<<<<<<<<<< - * """ - * Returns a list of the output names returned by this function. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_27output_names, 0, __pyx_n_s_Function_output_names, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":304 - * return lookback - * - * @property # <<<<<<<<<<<<<< - * def output_names(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_output_names, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":315 - * - * @property - * def outputs(self): # <<<<<<<<<<<<<< - * """ - * Returns the TA function values for the currently set input_arrays and - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_29outputs, 0, __pyx_n_s_Function_outputs, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - - /* "talib/abstract.pyx":314 - * return ret - * - * @property # <<<<<<<<<<<<<< - * def outputs(self): - * """ - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_outputs, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":338 - * return ret[0] if len(ret) == 1 else ret - * - * def run(self, input_arrays=None): # <<<<<<<<<<<<<< - * """ - * run([input_arrays=None]) - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_31run, 0, __pyx_n_s_Function_run, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__58); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_run, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":350 - * return self.outputs - * - * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * """ - * func_instance([input_arrays,] [parameter_args,] [input_price_series_kwargs,] [parameter_kwargs]) - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_33__call__, 0, __pyx_n_s_Function___call, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_call, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":362 - * - * # figure out which price series names we're using for inputs - * def __input_price_series_names(self): # <<<<<<<<<<<<<< - * input_price_series_names = [] - * for input_name in self.__input_names: - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_35__input_price_series_names, 0, __pyx_n_s_Function___input_price_series_na, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_Function__input_price_series_na, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":373 - * return input_price_series_names - * - * def __call_function(self): # <<<<<<<<<<<<<< - * input_price_series_names = self.__input_price_series_names() - * - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_37__call_function, 0, __pyx_n_s_Function___call_function, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_Function__call_function, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":400 - * self.__outputs_valid = True - * - * def __get_opt_input_value(self, input_name): # <<<<<<<<<<<<<< - * """ - * Returns the user-set value if there is one, otherwise the default. - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_39__get_opt_input_value, 0, __pyx_n_s_Function___get_opt_input_value, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_Function__get_opt_input_value, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":409 - * return value - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return '%s' % self.info - * - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_41__repr__, 0, __pyx_n_s_Function___repr, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":412 - * return '%s' % self.info - * - * def __unicode__(self): # <<<<<<<<<<<<<< - * return unicode(self.__str__()) - * - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_43__unicode__, 0, __pyx_n_s_Function___unicode, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_unicode, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":415 - * return unicode(self.__str__()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return _get_defaults_and_docs(self.info)[1] # docstring includes defaults - * - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_8abstract_8Function_45__str__, 0, __pyx_n_s_Function___str, NULL, __pyx_n_s_talib_abstract, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_str, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "talib/abstract.pyx":64 - * return b - * - * class Function(object): # <<<<<<<<<<<<<< - * """ - * This is a pythonic wrapper around TALIB's abstract interface. It is - */ - __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Function, __pyx_t_2, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Function, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":429 - * # therefore recommended over using these functions directly. - * - * def _ta_getGroupTable(): # <<<<<<<<<<<<<< - * """ - * Returns the list of available TALIB function group names. *slow* - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_9_ta_getGroupTable, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getGroupTable, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":441 - * return groups - * - * def _ta_getFuncTable(char *group): # <<<<<<<<<<<<<< - * """ - * Returns a list of the functions for the specified group name. *slow* - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_11_ta_getFuncTable, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getFuncTable, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":453 - * return functions - * - * def __get_flags(int flag, dict flags_lookup_dict): # <<<<<<<<<<<<<< - * """ - * TA-LIB provides hints for multiple flags as a bitwise-ORed int. - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_13__get_flags, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_flags, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":479 - * - * TA_FUNC_FLAGS = { - * 16777216: 'Output scale same as input', # <<<<<<<<<<<<<< - * 67108864: 'Output is over volume', - * 134217728: 'Function has an unstable period', - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_int_16777216, __pyx_kp_s_Output_scale_same_as_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_67108864, __pyx_kp_s_Output_is_over_volume) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_134217728, __pyx_kp_s_Function_has_an_unstable_period) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_268435456, __pyx_kp_s_Output_is_a_candlestick) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_FUNC_FLAGS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":487 - * # when flag is 0, the function (should) work on any reasonable input ndarray - * TA_INPUT_FLAGS = { - * 1: 'open', # <<<<<<<<<<<<<< - * 2: 'high', - * 4: 'low', - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_n_s_open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_n_s_high) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_n_s_low) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_n_s_close) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_n_s_volume) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_32, __pyx_n_s_openInterest) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_64, __pyx_n_s_timeStamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_INPUT_FLAGS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":497 - * - * TA_OUTPUT_FLAGS = { - * 1: 'Line', # <<<<<<<<<<<<<< - * 2: 'Dotted Line', - * 4: 'Dashed Line', - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_n_s_Line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_kp_s_Dotted_Line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_kp_s_Dashed_Line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_n_s_Dot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_n_s_Histogram) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_32, __pyx_kp_s_Pattern_Bool) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_64, __pyx_kp_s_Bull_Bear_Pattern_Bearish_0_Neut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_128, __pyx_kp_s_Strength_Pattern_200_100_Bearish) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_256, __pyx_kp_s_Output_can_be_positive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_512, __pyx_kp_s_Output_can_be_negative) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_1024, __pyx_kp_s_Output_can_be_zero) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_2048, __pyx_kp_s_Values_represent_an_upper_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_4096, __pyx_kp_s_Values_represent_a_lower_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TA_OUTPUT_FLAGS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":512 - * } - * - * def _ta_getFuncInfo(char *function_name): # <<<<<<<<<<<<<< - * """ - * Returns the info dict for the function. It has the following keys: name, - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_15_ta_getFuncInfo, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getFuncInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":531 - * } - * - * def _ta_getInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's input info dict for the given index. It has two - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_17_ta_getInputParameterInfo, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getInputParameterInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":552 - * } - * - * def _ta_getOptInputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's opt_input info dict for the given index. It has the - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_19_ta_getOptInputParameterInfo, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getOptInputParameterInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":576 - * } - * - * def _ta_getOutputParameterInfo(char *function_name, int idx): # <<<<<<<<<<<<<< - * """ - * Returns the function's output info dict for the given index. It has two - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_21_ta_getOutputParameterInfo, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_getOutputParameterInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":596 - * } - * - * def _get_defaults_and_docs(func_info): # <<<<<<<<<<<<<< - * """ - * Returns a tuple with two outputs: defaults, a dict of parameter defaults, - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5talib_8abstract_23_get_defaults_and_docs, NULL, __pyx_n_s_talib_abstract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_defaults_and_docs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":688 - * # Configure all the available TA-Lib functions to be exported as - * # an abstract function wrapper for convenient import. - * for name in __FUNCTION_NAMES: # <<<<<<<<<<<<<< - * exec "%s = Function('%s')" % (name, name) - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FUNCTION_NAMES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_13(__pyx_t_1); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":689 - * # an abstract function wrapper for convenient import. - * for name in __FUNCTION_NAMES: - * exec "%s = Function('%s')" % (name, name) # <<<<<<<<<<<<<< - * - * __all__ = ['Function'] + list(__FUNCTION_NAMES) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); - __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_Function_s, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_Globals(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyExec3(__pyx_t_7, __pyx_t_9, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":688 - * # Configure all the available TA-Lib functions to be exported as - * # an abstract function wrapper for convenient import. - * for name in __FUNCTION_NAMES: # <<<<<<<<<<<<<< - * exec "%s = Function('%s')" % (name, name) - * - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/abstract.pyx":691 - * exec "%s = Function('%s')" % (name, name) - * - * __all__ = ['Function'] + list(__FUNCTION_NAMES) # <<<<<<<<<<<<<< - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_Function); - __Pyx_GIVEREF(__pyx_n_s_Function); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Function); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FUNCTION_NAMES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/abstract.pyx":1 - * ''' # <<<<<<<<<<<<<< - * This file Copyright (c) 2013 Brian A Cappello - * ''' - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "../../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init talib.abstract", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init talib.abstract"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -#if !CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { - return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); -} -#endif - -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { - PyObject *method, *result = NULL; - method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto bad; -#if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyMethod_Check(method))) { - PyObject *self = PyMethod_GET_SELF(method); - if (likely(self)) { - PyObject *function = PyMethod_GET_FUNCTION(method); - result = __Pyx_PyObject_CallOneArg(function, self); - Py_DECREF(method); - return result; - } - } -#endif - result = __Pyx_PyObject_CallNoArg(method); - Py_DECREF(method); -bad: - return result; -} - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(index); - } -} - -static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, - int is_tuple, int has_known_size, int decref_tuple) { - Py_ssize_t index; - PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; - if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { - iternextfunc iternext; - iter = PyObject_GetIter(tuple); - if (unlikely(!iter)) goto bad; - if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } - iternext = Py_TYPE(iter)->tp_iternext; - value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } - value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } - if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; - Py_DECREF(iter); - } else { - if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { - __Pyx_UnpackTupleError(tuple, 2); - goto bad; - } -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); - if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); - if (unlikely(!value2)) goto bad; -#else - value1 = PyTuple_GET_ITEM(tuple, 0); - value2 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(value1); - Py_INCREF(value2); -#endif - if (decref_tuple) { Py_DECREF(tuple); } - } - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -unpacking_failed: - if (!has_known_size && __Pyx_IterFinish() == 0) - __Pyx_RaiseNeedMoreValuesError(index); -bad: - Py_XDECREF(iter); - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -} - -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_source_is_dict) { - is_dict = is_dict || likely(PyDict_CheckExact(iterable)); - *p_source_is_dict = is_dict; -#if !CYTHON_COMPILING_IN_PYPY - if (is_dict) { - *p_orig_length = PyDict_Size(iterable); - Py_INCREF(iterable); - return iterable; - } -#endif - *p_orig_length = 0; - if (method_name) { - PyObject* iter; - iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); - if (!iterable) - return NULL; -#if !CYTHON_COMPILING_IN_PYPY - if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) - return iterable; -#endif - iter = PyObject_GetIter(iterable); - Py_DECREF(iterable); - return iter; - } - return PyObject_GetIter(iterable); -} -static CYTHON_INLINE int __Pyx_dict_iter_next( - PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { - PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY - if (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); - return -1; - } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; - } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } - } - return 1; - } else if (PyTuple_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyTuple_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else if (PyList_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else -#endif - { - next_item = PyIter_Next(iter_obj); - if (unlikely(!next_item)) { - return __Pyx_IterFinish(); - } - } - if (pitem) { - *pitem = next_item; - } else if (pkey && pvalue) { - if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) - return -1; - } else if (pkey) { - *pkey = next_item; - } else { - *pvalue = next_item; - } - return 1; -} - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - x = (long)((unsigned long)a + b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - if (likely(__Pyx_sst_abs(size) <= 1)) { - a = likely(size) ? digits[0] : 0; - if (size == -1) a = -a; - } else { - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - } - x = a + b; - return PyLong_FromLong(x); - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - double result; - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); -} -#endif - -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS); - } -#endif - return 0; -} - -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *args, *result = NULL; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); -#else - args = PyTuple_Pack(1, self); - if (unlikely(!args)) goto bad; -#endif - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - Py_DECREF(args); -bad: - return result; -} - -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - if (PY_MAJOR_VERSION >= 3) - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); - else - return PyDict_Keys(d); -} - -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" -#endif - -static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) { -#if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t shiftby; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(exp))) { - shiftby = PyInt_AS_LONG(exp); - } else -#endif - if (likely(PyLong_CheckExact(exp))) { - #if CYTHON_USE_PYLONG_INTERNALS - const Py_ssize_t size = Py_SIZE(exp); - if (likely(size == 1)) { - shiftby = ((PyLongObject*)exp)->ob_digit[0]; - } else if (size == 0) { - return PyInt_FromLong(1L); - } else if (unlikely(size < 0)) { - goto fallback; - } else { - shiftby = PyLong_AsSsize_t(exp); - } - #else - shiftby = PyLong_AsSsize_t(exp); - #endif - } else { - goto fallback; - } - if (likely(shiftby >= 0)) { - if ((size_t)shiftby <= sizeof(long) * 8 - 2) { - long value = 1L << shiftby; - return PyInt_FromLong(value); - } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) { - unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby; - return PyLong_FromUnsignedLongLong(value); - } else { - PyObject *one = PyInt_FromLong(1L); - if (unlikely(!one)) return NULL; - return PyNumber_Lshift(one, exp); - } - } else if (shiftby == -1 && PyErr_Occurred()) { - PyErr_Clear(); - } -fallback: -#endif - return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none); -} - -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, - Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, - int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { -#if CYTHON_COMPILING_IN_CPYTHON - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - goto bad; - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#endif - mp = Py_TYPE(obj)->tp_as_mapping; - if (likely(mp && mp->mp_subscript)) -#endif - { - PyObject* result; - PyObject *py_slice, *py_start, *py_stop; - if (_py_slice) { - py_slice = *_py_slice; - } else { - PyObject* owned_start = NULL; - PyObject* owned_stop = NULL; - if (_py_start) { - py_start = *_py_start; - } else { - if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); - if (unlikely(!py_start)) goto bad; - } else - py_start = Py_None; - } - if (_py_stop) { - py_stop = *_py_stop; - } else { - if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); - if (unlikely(!py_stop)) { - Py_XDECREF(owned_start); - goto bad; - } - } else - py_stop = Py_None; - } - py_slice = PySlice_New(py_start, py_stop, Py_None); - Py_XDECREF(owned_start); - Py_XDECREF(owned_stop); - if (unlikely(!py_slice)) goto bad; - } -#if CYTHON_COMPILING_IN_CPYTHON - result = mp->mp_subscript(obj, py_slice); -#else - result = PyObject_GetItem(obj, py_slice); -#endif - if (!_py_slice) { - Py_DECREF(py_slice); - } - return result; - } - PyErr_Format(PyExc_TypeError, - "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); -bad: - return NULL; -} - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { - if (op1 == op2) { - Py_RETURN_TRUE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a == b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a; - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - if (likely(__Pyx_sst_abs(size) <= 1)) { - a = likely(size) ? digits[0] : 0; - if (size == -1) a = -a; - } else { - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 - default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); - #else - default: Py_RETURN_FALSE; - #endif - } - } - if (a == b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - if ((double)a == (double)b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - return PyObject_RichCompare(op1, op2, Py_EQ); -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - x = a % b; - x += ((x != 0) & ((x ^ b) < 0)) * b; - return PyInt_FromLong(x); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - if (likely(__Pyx_sst_abs(size) <= 1)) { - a = likely(size) ? digits[0] : 0; - if (size == -1) a = -a; - } else { - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2); - } - } - x = a % b; - x += ((x != 0) & ((x ^ b) < 0)) * b; - return PyLong_FromLong(x); - long_long: - llx = lla % llb; - llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb; - return PyLong_FromLongLong(llx); - } - #endif - return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); -} -#endif - -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { - int r; - if (!j) return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, - CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); - if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { - PyObject* old = PyList_GET_ITEM(o, n); - Py_INCREF(v); - PyList_SET_ITEM(o, n, v); - Py_DECREF(old); - return 1; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_ass_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return -1; - } - } - return m->sq_ass_item(o, i, v); - } - } -#else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { -#else - if (is_list || PySequence_Check(o)) { -#endif - return PySequence_SetItem(o, i, v); - } -#endif - return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); -} - -static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, - int full_traceback, CYTHON_UNUSED int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); -#endif - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); - } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); -#endif -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -#else - PyErr_GetExcInfo(type, value, tb); -#endif -} -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(type, value, tb); -#endif -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { - Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); - for (i=0; i < nbases; i++) { - PyTypeObject *tmptype; - PyObject *tmp = PyTuple_GET_ITEM(bases, i); - tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif - if (!metaclass) { - metaclass = tmptype; - continue; - } - if (PyType_IsSubtype(metaclass, tmptype)) - continue; - if (PyType_IsSubtype(tmptype, metaclass)) { - metaclass = tmptype; - continue; - } - PyErr_SetString(PyExc_TypeError, - "metaclass conflict: " - "the metaclass of a derived class " - "must be a (non-strict) subclass " - "of the metaclasses of all its bases"); - return NULL; - } - if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else - metaclass = &PyType_Type; -#endif - } - Py_INCREF((PyObject*) metaclass); - return (PyObject*) metaclass; -} - -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* fake_module; - PyTypeObject* cached_type = NULL; - fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); - if (!fake_module) return NULL; - Py_INCREF(fake_module); - cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); - if (cached_type) { - if (!PyType_Check((PyObject*)cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", - type->tp_name); - goto bad; - } - if (cached_type->tp_basicsize != type->tp_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - type->tp_name); - goto bad; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; - } -done: - Py_DECREF(fake_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} - -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) -{ - if (unlikely(op->func_doc == NULL)) { - if (op->func.m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp = op->func_doc; - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - op->func_doc = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - tmp = op->func_name; - Py_INCREF(value); - op->func_name = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - tmp = op->func_qualname; - Py_INCREF(value); - op->func_qualname = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) -{ - PyObject *self; - self = m->func_closure; - if (self == NULL) - self = Py_None; - Py_INCREF(self); - return self; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - tmp = op->func_dict; - Py_INCREF(value); - op->func_dict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) -{ - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_COMPILING_IN_CPYTHON - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyTuple_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_tuple; - op->defaults_tuple = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_tuple; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_kwdict; - op->defaults_kwdict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_kwdict; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value || value == Py_None) { - value = NULL; - } else if (!PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - tmp = op->func_annotations; - op->func_annotations = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { - PyObject* result = op->func_annotations; - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromString(m->func.m_ml->ml_name); -#else - return PyString_FromString(m->func.m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); - if (op == NULL) - return NULL; - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; - op->func.m_ml = ml; - op->func.m_self = (PyObject *) op; - Py_XINCREF(closure); - op->func_closure = closure; - Py_XINCREF(module); - op->func.m_module = module; - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; - op->func_classobj = NULL; - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - PyObject_GC_Track(op); - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); - Py_CLEAR(m->func.m_module); - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); - Py_CLEAR(m->func_classobj); - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyMem_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - PyObject_GC_Del(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); - Py_VISIT(m->func.m_module); - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); - Py_VISIT(m->func_classobj); - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) -{ - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { - Py_INCREF(func); - return func; - } - if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { - if (type == NULL) - type = (PyObject *)(Py_TYPE(obj)); - return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); - } - if (obj == Py_None) - obj = NULL; - return __Pyx_PyMethod_New(func, obj, type); -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -#if CYTHON_COMPILING_IN_PYPY -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - PyObject *self = f->m_self; - Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 0)) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 1)) { - PyObject *result, *arg0 = PySequence_ITEM(arg, 0); - if (unlikely(!arg0)) return NULL; - result = (*meth)(self, arg0); - Py_DECREF(arg0); - return result; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags in " - "__Pyx_CyFunction_Call. METH_OLDARGS is no " - "longer supported!"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -#else -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return PyCFunction_Call(func, arg, kw); -} -#endif -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, - 0, - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_Call, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_CyFunction_descr_get, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -}; -static int __pyx_CyFunction_init(void) { -#if !CYTHON_COMPILING_IN_PYPY - __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; -#endif - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); - if (__pyx_CyFunctionType == NULL) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyMem_Malloc(size); - if (!m->defaults) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, - PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { - PyObject *ns; - if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); - if (prep) { - PyObject *pargs = PyTuple_Pack(2, name, bases); - if (unlikely(!pargs)) { - Py_DECREF(prep); - return NULL; - } - ns = PyObject_Call(prep, pargs, mkw); - Py_DECREF(prep); - Py_DECREF(pargs); - } else { - if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) - return NULL; - PyErr_Clear(); - ns = PyDict_New(); - } - } else { - ns = PyDict_New(); - } - if (unlikely(!ns)) - return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; - return ns; -bad: - Py_DECREF(ns); - return NULL; -} -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, - PyObject *dict, PyObject *mkw, - int calculate_metaclass, int allow_py2_metaclass) { - PyObject *result, *margs; - PyObject *owned_metaclass = NULL; - if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); - if (owned_metaclass) { - metaclass = owned_metaclass; - } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { - PyErr_Clear(); - } else { - return NULL; - } - } - if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { - metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); - Py_XDECREF(owned_metaclass); - if (unlikely(!metaclass)) - return NULL; - owned_metaclass = metaclass; - } - margs = PyTuple_Pack(3, name, bases, dict); - if (unlikely(!margs)) { - result = NULL; - } else { - result = PyObject_Call(metaclass, margs, mkw); - Py_DECREF(margs); - } - Py_XDECREF(owned_metaclass); - return result; -} - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - -static PyObject* __Pyx_Globals(void) { - Py_ssize_t i; - PyObject *names; - PyObject *globals = __pyx_d; - Py_INCREF(globals); - names = PyObject_Dir(__pyx_m); - if (!names) - goto bad; - for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { -#if CYTHON_COMPILING_IN_PYPY - PyObject* name = PySequence_ITEM(names, i); - if (!name) - goto bad; -#else - PyObject* name = PyList_GET_ITEM(names, i); -#endif - if (!PyDict_Contains(globals, name)) { - PyObject* value = __Pyx_GetAttr(__pyx_m, name); - if (!value) { -#if CYTHON_COMPILING_IN_PYPY - Py_DECREF(name); -#endif - goto bad; - } - if (PyDict_SetItem(globals, name, value) < 0) { -#if CYTHON_COMPILING_IN_PYPY - Py_DECREF(name); -#endif - Py_DECREF(value); - goto bad; - } - } -#if CYTHON_COMPILING_IN_PYPY - Py_DECREF(name); -#endif - } - Py_DECREF(names); - return globals; -bad: - Py_XDECREF(names); - Py_XDECREF(globals); - return NULL; -} - -static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) { - return __Pyx_PyExec3(o, globals, NULL); -} -static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) { - PyObject* result; - PyObject* s = 0; - char *code = 0; - if (!globals || globals == Py_None) { - globals = __pyx_d; - } else if (!PyDict_Check(globals)) { - PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s", - Py_TYPE(globals)->tp_name); - goto bad; - } - if (!locals || locals == Py_None) { - locals = globals; - } - if (PyDict_GetItem(globals, __pyx_n_s_builtins) == NULL) { - if (PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0) - goto bad; - } - if (PyCode_Check(o)) { - if (PyCode_GetNumFree((PyCodeObject *)o) > 0) { - PyErr_SetString(PyExc_TypeError, - "code object passed to exec() may not contain free variables"); - goto bad; - } - #if CYTHON_COMPILING_IN_PYPY || PY_VERSION_HEX < 0x030200B1 - result = PyEval_EvalCode((PyCodeObject *)o, globals, locals); - #else - result = PyEval_EvalCode(o, globals, locals); - #endif - } else { - PyCompilerFlags cf; - cf.cf_flags = 0; - if (PyUnicode_Check(o)) { - cf.cf_flags = PyCF_SOURCE_IS_UTF8; - s = PyUnicode_AsUTF8String(o); - if (!s) goto bad; - o = s; - #if PY_MAJOR_VERSION >= 3 - } else if (!PyBytes_Check(o)) { - #else - } else if (!PyString_Check(o)) { - #endif - PyErr_Format(PyExc_TypeError, - "exec: arg 1 must be string, bytes or code object, got %.200s", - Py_TYPE(o)->tp_name); - goto bad; - } - #if PY_MAJOR_VERSION >= 3 - code = PyBytes_AS_STRING(o); - #else - code = PyString_AS_STRING(o); - #endif - if (PyEval_MergeCompilerFlags(&cf)) { - result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf); - } else { - result = PyRun_String(code, Py_file_input, globals, locals); - } - Py_XDECREF(s); - } - return result; -bad: - Py_XDECREF(s); - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OptInputParameterType(TA_OptInputParameterType value) { - const TA_OptInputParameterType neg_one = (TA_OptInputParameterType) -1, const_zero = (TA_OptInputParameterType) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_OptInputParameterType) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_OptInputParameterType) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_OptInputParameterType) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_OptInputParameterType) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_OptInputParameterType) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_OptInputParameterType), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value) { - const TA_RetCode neg_one = (TA_RetCode) -1, const_zero = (TA_RetCode) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_RetCode) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_RetCode) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_RetCode) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_RetCode) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_RetCode) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_RetCode), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { - const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(unsigned int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(unsigned int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(unsigned int), - little, !is_unsigned); - } -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { - const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(unsigned int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (unsigned int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned int) 0; - case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) - case 2: - if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { - return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { - return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { - return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (unsigned int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(unsigned int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned int) 0; - case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) - case -2: - if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { - return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(unsigned int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) - } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - unsigned int val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (unsigned int) -1; - } - } else { - unsigned int val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned int) -1; - val = __Pyx_PyInt_As_unsigned_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned int"); - return (unsigned int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned int"); - return (unsigned int) -1; -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_FuncFlags(TA_FuncFlags value) { - const TA_FuncFlags neg_one = (TA_FuncFlags) -1, const_zero = (TA_FuncFlags) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_FuncFlags) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_FuncFlags) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_FuncFlags) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_FuncFlags) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_FuncFlags) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_FuncFlags), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_InputFlags(TA_InputFlags value) { - const TA_InputFlags neg_one = (TA_InputFlags) -1, const_zero = (TA_InputFlags) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_InputFlags) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_InputFlags) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_InputFlags) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_InputFlags) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_InputFlags) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_InputFlags), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_OutputFlags(TA_OutputFlags value) { - const TA_OutputFlags neg_one = (TA_OutputFlags) -1, const_zero = (TA_OutputFlags) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_OutputFlags) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_OutputFlags) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_OutputFlags) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_OutputFlags) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_OutputFlags) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_OutputFlags), - little, !is_unsigned); - } -} - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -#if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); - case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); - case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_absf(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -#if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); - case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); - case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_abs(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/talib/common.c b/talib/common.c deleted file mode 100644 index 1194a6467..000000000 --- a/talib/common.c +++ /dev/null @@ -1,5519 +0,0 @@ -/* Generated by Cython 0.23.4 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_23_4" -#include -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) -#define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__talib__common -#define __PYX_HAVE_API__talib__common -#if defined(WIN32) || defined(MS_WINDOWS) -#include "ta_libc.h" -#else -#include "ta-lib/ta_defs.h" -#include "ta-lib/ta_common.h" -#include "ta-lib/ta_abstract.h" -#include "ta-lib/ta_func.h" -#endif -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "talib/common.pyx", -}; - -/*--- Type declarations ---*/ - -/* --- Runtime support code (head) --- */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); - -#define __Pyx_CyFunction_USED 1 -#include -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { - PyCFunctionObject func; -#if PY_VERSION_HEX < 0x030500A0 - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; - PyObject *func_classobj; - void *defaults; - int defaults_pyobjects; - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; -} __pyx_CyFunctionObject; -static PyTypeObject *__pyx_CyFunctionType = 0; -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) -static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *self, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(void); - -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, - PyObject *mkw, PyObject *modname, PyObject *doc); -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, - PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); -#else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ - (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) -#endif - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -static CYTHON_INLINE TA_RetCode __Pyx_PyInt_As_TA_RetCode(PyObject *); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value); - -static CYTHON_INLINE TA_FuncUnstId __Pyx_PyInt_As_TA_FuncUnstId(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -static int __Pyx_check_binary_version(void); - -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'talib.libta_lib' */ - -/* Module declarations from 'talib.common' */ -static PyObject *__pyx_f_5talib_6common__ta_check_success(PyObject *, TA_RetCode, int __pyx_skip_dispatch); /*proto*/ -#define __Pyx_MODULE_NAME "talib.common" -int __pyx_module_is_main_talib__common = 0; - -/* Implementation of 'talib.common' */ -static PyObject *__pyx_builtin_object; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_Exception; -static char __pyx_k_i[] = "i"; -static char __pyx_k_DX[] = "DX"; -static char __pyx_k_T3[] = "T3"; -static char __pyx_k_id[] = "id"; -static char __pyx_k_ADX[] = "ADX"; -static char __pyx_k_ALL[] = "ALL"; -static char __pyx_k_ATR[] = "ATR"; -static char __pyx_k_CMO[] = "CMO"; -static char __pyx_k_EMA[] = "EMA"; -static char __pyx_k_MFI[] = "MFI"; -static char __pyx_k_RSI[] = "RSI"; -static char __pyx_k_SMA[] = "SMA"; -static char __pyx_k_WMA[] = "WMA"; -static char __pyx_k_doc[] = "__doc__"; -static char __pyx_k_ADXR[] = "ADXR"; -static char __pyx_k_DEMA[] = "DEMA"; -static char __pyx_k_KAMA[] = "KAMA"; -static char __pyx_k_MAMA[] = "MAMA"; -static char __pyx_k_NATR[] = "NATR"; -static char __pyx_k_NONE[] = "NONE"; -static char __pyx_k_TEMA[] = "TEMA"; -static char __pyx_k_init[] = "__init__"; -static char __pyx_k_main[] = "__main__"; -static char __pyx_k_name[] = "name"; -static char __pyx_k_self[] = "self"; -static char __pyx_k_test[] = "__test__"; -static char __pyx_k_type[] = "type_"; -static char __pyx_k_TRIMA[] = "TRIMA"; -static char __pyx_k_range[] = "range"; -static char __pyx_k_lookup[] = "_lookup"; -static char __pyx_k_module[] = "__module__"; -static char __pyx_k_object[] = "object"; -static char __pyx_k_period[] = "period"; -static char __pyx_k_HT_SINE[] = "HT_SINE"; -static char __pyx_k_MA_Type[] = "MA_Type"; -static char __pyx_k_PLUS_DI[] = "PLUS_DI"; -static char __pyx_k_PLUS_DM[] = "PLUS_DM"; -static char __pyx_k_Success[] = "Success"; -static char __pyx_k_getitem[] = "__getitem__"; -static char __pyx_k_prepare[] = "__prepare__"; -static char __pyx_k_MINUS_DI[] = "MINUS_DI"; -static char __pyx_k_MINUS_DM[] = "MINUS_DM"; -static char __pyx_k_STOCHRSI[] = "STOCHRSI"; -static char __pyx_k_qualname[] = "__qualname__"; -static char __pyx_k_ret_code[] = "ret_code"; -static char __pyx_k_Exception[] = "Exception"; -static char __pyx_k_HT_PHASOR[] = "HT_PHASOR"; -static char __pyx_k_enumerate[] = "enumerate"; -static char __pyx_k_metaclass[] = "__metaclass__"; -static char __pyx_k_HT_DCPHASE[] = "HT_DCPHASE"; -static char __pyx_k_ta_version[] = "__ta_version__"; -static char __pyx_k_HT_DCPERIOD[] = "HT_DCPERIOD"; -static char __pyx_k_TA_Shutdown[] = "TA_Shutdown"; -static char __pyx_k_ta_shutdown[] = "_ta_shutdown"; -static char __pyx_k_HT_TRENDLINE[] = "HT_TRENDLINE"; -static char __pyx_k_HT_TRENDMODE[] = "HT_TRENDMODE"; -static char __pyx_k_talib_common[] = "talib.common"; -static char __pyx_k_TA_Initialize[] = "TA_Initialize"; -static char __pyx_k_function_name[] = "function_name"; -static char __pyx_k_ta_initialize[] = "_ta_initialize"; -static char __pyx_k_MA_Type___init[] = "MA_Type.__init__"; -static char __pyx_k_ta_func_unst_ids[] = "_ta_func_unst_ids"; -static char __pyx_k_MA_Type___getitem[] = "MA_Type.__getitem__"; -static char __pyx_k_TA_SetUnstablePeriod[] = "TA_SetUnstablePeriod"; -static char __pyx_k_Simple_Moving_Average[] = "Simple Moving Average"; -static char __pyx_k_ta_get_unstable_period[] = "_ta_get_unstable_period"; -static char __pyx_k_ta_set_unstable_period[] = "_ta_set_unstable_period"; -static char __pyx_k_Weighted_Moving_Average[] = "Weighted Moving Average"; -static char __pyx_k_Bad_Object_TA_BAD_OBJECT[] = "Bad Object (TA_BAD_OBJECT)"; -static char __pyx_k_Triangular_Moving_Average[] = "Triangular Moving Average"; -static char __pyx_k_Bad_Parameter_TA_BAD_PARAM[] = "Bad Parameter (TA_BAD_PARAM)"; -static char __pyx_k_Exponential_Moving_Average[] = "Exponential Moving Average"; -static char __pyx_k_MESA_Adaptive_Moving_Average[] = "MESA Adaptive Moving Average"; -static char __pyx_k_Unknown_Error_TA_UNKNOWN_ERR[] = "Unknown Error (TA_UNKNOWN_ERR)"; -static char __pyx_k_Allocation_Error_TA_ALLOC_ERR[] = "Allocation Error (TA_ALLOC_ERR)"; -static char __pyx_k_Not_Supported_TA_NOT_SUPPORTED[] = "Not Supported (TA_NOT_SUPPORTED)"; -static char __pyx_k_Kaufman_Adaptive_Moving_Average[] = "Kaufman Adaptive Moving Average"; -static char __pyx_k_Out_of_Range_Start_Index_TA_OUT[] = "Out-of-Range Start Index (TA_OUT_OF_RANGE_START_INDEX)"; -static char __pyx_k_Users_jbenedik_Dev_ta_lib_talib[] = "/Users/jbenedik/Dev/ta-lib/talib/common.pyx"; -static char __pyx_k_s_function_failed_with_error_co[] = "%s function failed with error code %s: %s"; -static char __pyx_k_Double_Exponential_Moving_Averag[] = "Double Exponential Moving Average"; -static char __pyx_k_Function_Not_Found_TA_FUNC_NOT_F[] = "Function Not Found (TA_FUNC_NOT_FOUND)"; -static char __pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU[] = "Group Not Found (TA_GROUP_NOT_FOUND)"; -static char __pyx_k_Input_Not_All_Initialized_TA_INP[] = "Input Not All Initialized (TA_INPUT_NOT_ALL_INITIALIZE)"; -static char __pyx_k_Internal_Error_TA_INTERNAL_ERROR[] = "Internal Error (TA_INTERNAL_ERROR)"; -static char __pyx_k_Invalid_Handle_TA_INVALID_HANDLE[] = "Invalid Handle (TA_INVALID_HANDLE)"; -static char __pyx_k_Invalid_List_Type_TA_INVALID_LIS[] = "Invalid List Type (TA_INVALID_LIST_TYPE)"; -static char __pyx_k_Invalid_Parameter_Function_TA_IN[] = "Invalid Parameter Function (TA_INVALID_PARAM_FUNCTION)"; -static char __pyx_k_Invalid_Parameter_Holder_TA_INVA[] = "Invalid Parameter Holder (TA_INVALID_PARAM_HOLDER)"; -static char __pyx_k_Invalid_Parameter_Holder_Type_TA[] = "Invalid Parameter Holder Type (TA_INVALID_PARAM_HOLDER_TYPE)"; -static char __pyx_k_Library_Not_Initialized_TA_LIB_N[] = "Library Not Initialized (TA_LIB_NOT_INITIALIZE)"; -static char __pyx_k_Out_of_Range_End_Index_TA_OUT_OF[] = "Out-of-Range End Index (TA_OUT_OF_RANGE_END_INDEX)"; -static char __pyx_k_Output_Not_All_Initialized_TA_OU[] = "Output Not All Initialized (TA_OUTPUT_NOT_ALL_INITIALIZE)"; -static char __pyx_k_Triple_Exponential_Moving_Averag[] = "Triple Exponential Moving Average"; -static char __pyx_k_Triple_Generalized_Double_Expone[] = "Triple Generalized Double Exponential Moving Average"; -static PyObject *__pyx_n_s_ADX; -static PyObject *__pyx_n_s_ADXR; -static PyObject *__pyx_n_s_ALL; -static PyObject *__pyx_n_s_ATR; -static PyObject *__pyx_kp_s_Allocation_Error_TA_ALLOC_ERR; -static PyObject *__pyx_kp_s_Bad_Object_TA_BAD_OBJECT; -static PyObject *__pyx_kp_s_Bad_Parameter_TA_BAD_PARAM; -static PyObject *__pyx_n_s_CMO; -static PyObject *__pyx_n_s_DEMA; -static PyObject *__pyx_n_s_DX; -static PyObject *__pyx_kp_s_Double_Exponential_Moving_Averag; -static PyObject *__pyx_n_s_EMA; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_kp_s_Exponential_Moving_Average; -static PyObject *__pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F; -static PyObject *__pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU; -static PyObject *__pyx_n_s_HT_DCPERIOD; -static PyObject *__pyx_n_s_HT_DCPHASE; -static PyObject *__pyx_n_s_HT_PHASOR; -static PyObject *__pyx_n_s_HT_SINE; -static PyObject *__pyx_n_s_HT_TRENDLINE; -static PyObject *__pyx_n_s_HT_TRENDMODE; -static PyObject *__pyx_kp_s_Input_Not_All_Initialized_TA_INP; -static PyObject *__pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR; -static PyObject *__pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE; -static PyObject *__pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS; -static PyObject *__pyx_kp_s_Invalid_Parameter_Function_TA_IN; -static PyObject *__pyx_kp_s_Invalid_Parameter_Holder_TA_INVA; -static PyObject *__pyx_kp_s_Invalid_Parameter_Holder_Type_TA; -static PyObject *__pyx_n_s_KAMA; -static PyObject *__pyx_kp_s_Kaufman_Adaptive_Moving_Average; -static PyObject *__pyx_kp_s_Library_Not_Initialized_TA_LIB_N; -static PyObject *__pyx_n_s_MAMA; -static PyObject *__pyx_n_s_MA_Type; -static PyObject *__pyx_n_s_MA_Type___getitem; -static PyObject *__pyx_n_s_MA_Type___init; -static PyObject *__pyx_kp_s_MESA_Adaptive_Moving_Average; -static PyObject *__pyx_n_s_MFI; -static PyObject *__pyx_n_s_MINUS_DI; -static PyObject *__pyx_n_s_MINUS_DM; -static PyObject *__pyx_n_s_NATR; -static PyObject *__pyx_n_s_NONE; -static PyObject *__pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED; -static PyObject *__pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF; -static PyObject *__pyx_kp_s_Out_of_Range_Start_Index_TA_OUT; -static PyObject *__pyx_kp_s_Output_Not_All_Initialized_TA_OU; -static PyObject *__pyx_n_s_PLUS_DI; -static PyObject *__pyx_n_s_PLUS_DM; -static PyObject *__pyx_n_s_RSI; -static PyObject *__pyx_n_s_SMA; -static PyObject *__pyx_n_s_STOCHRSI; -static PyObject *__pyx_kp_s_Simple_Moving_Average; -static PyObject *__pyx_n_s_Success; -static PyObject *__pyx_n_s_T3; -static PyObject *__pyx_n_s_TA_Initialize; -static PyObject *__pyx_n_s_TA_SetUnstablePeriod; -static PyObject *__pyx_n_s_TA_Shutdown; -static PyObject *__pyx_n_s_TEMA; -static PyObject *__pyx_n_s_TRIMA; -static PyObject *__pyx_kp_s_Triangular_Moving_Average; -static PyObject *__pyx_kp_s_Triple_Exponential_Moving_Averag; -static PyObject *__pyx_kp_s_Triple_Generalized_Double_Expone; -static PyObject *__pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR; -static PyObject *__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib; -static PyObject *__pyx_n_s_WMA; -static PyObject *__pyx_kp_s_Weighted_Moving_Average; -static PyObject *__pyx_n_s_doc; -static PyObject *__pyx_n_s_enumerate; -static PyObject *__pyx_n_s_function_name; -static PyObject *__pyx_n_s_getitem; -static PyObject *__pyx_n_s_i; -static PyObject *__pyx_n_s_id; -static PyObject *__pyx_n_s_init; -static PyObject *__pyx_n_s_lookup; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_metaclass; -static PyObject *__pyx_n_s_module; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_object; -static PyObject *__pyx_n_s_period; -static PyObject *__pyx_n_s_prepare; -static PyObject *__pyx_n_s_qualname; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_ret_code; -static PyObject *__pyx_kp_s_s_function_failed_with_error_co; -static PyObject *__pyx_n_s_self; -static PyObject *__pyx_n_s_ta_func_unst_ids; -static PyObject *__pyx_n_s_ta_get_unstable_period; -static PyObject *__pyx_n_s_ta_initialize; -static PyObject *__pyx_n_s_ta_set_unstable_period; -static PyObject *__pyx_n_s_ta_shutdown; -static PyObject *__pyx_n_s_ta_version; -static PyObject *__pyx_n_s_talib_common; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_type; -static PyObject *__pyx_pf_5talib_6common__ta_check_success(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code); /* proto */ -static PyObject *__pyx_pf_5talib_6common_2_ta_initialize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5talib_6common_4_ta_shutdown(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5talib_6common_7MA_Type___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5talib_6common_7MA_Type_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type_); /* proto */ -static PyObject *__pyx_pf_5talib_6common_6_ta_set_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_period); /* proto */ -static PyObject *__pyx_pf_5talib_6common_8_ta_get_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_3; -static PyObject *__pyx_int_4; -static PyObject *__pyx_int_5; -static PyObject *__pyx_int_6; -static PyObject *__pyx_int_7; -static PyObject *__pyx_int_8; -static PyObject *__pyx_int_9; -static PyObject *__pyx_int_10; -static PyObject *__pyx_int_11; -static PyObject *__pyx_int_12; -static PyObject *__pyx_int_13; -static PyObject *__pyx_int_14; -static PyObject *__pyx_int_15; -static PyObject *__pyx_int_16; -static PyObject *__pyx_int_5000; -static PyObject *__pyx_int_65535; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_codeobj__2; -static PyObject *__pyx_codeobj__4; -static PyObject *__pyx_codeobj__7; -static PyObject *__pyx_codeobj__9; -static PyObject *__pyx_codeobj__11; -static PyObject *__pyx_codeobj__13; - -/* "talib/common.pyx":7 - * __ta_version__ = lib.TA_GetVersionString() - * - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): # <<<<<<<<<<<<<< - * if ret_code == lib.TA_SUCCESS: - * return True - */ - -static PyObject *__pyx_pw_5talib_6common_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_5talib_6common__ta_check_success(PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code, CYTHON_UNUSED int __pyx_skip_dispatch) { - PyObject *__pyx_v_ta_errors = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_check_success", 0); - - /* "talib/common.pyx":8 - * - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): - * if ret_code == lib.TA_SUCCESS: # <<<<<<<<<<<<<< - * return True - * ta_errors = { - */ - __pyx_t_1 = ((__pyx_v_ret_code == TA_SUCCESS) != 0); - if (__pyx_t_1) { - - /* "talib/common.pyx":9 - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): - * if ret_code == lib.TA_SUCCESS: - * return True # <<<<<<<<<<<<<< - * ta_errors = { - * 0: 'Success', - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "talib/common.pyx":8 - * - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): - * if ret_code == lib.TA_SUCCESS: # <<<<<<<<<<<<<< - * return True - * ta_errors = { - */ - } - - /* "talib/common.pyx":11 - * return True - * ta_errors = { - * 0: 'Success', # <<<<<<<<<<<<<< - * 1: 'Library Not Initialized (TA_LIB_NOT_INITIALIZE)', - * 2: 'Bad Parameter (TA_BAD_PARAM)', - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_int_0, __pyx_n_s_Success) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_kp_s_Library_Not_Initialized_TA_LIB_N) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_kp_s_Bad_Parameter_TA_BAD_PARAM) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_kp_s_Allocation_Error_TA_ALLOC_ERR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_5, __pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_6, __pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_7, __pyx_kp_s_Invalid_Parameter_Holder_TA_INVA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_kp_s_Invalid_Parameter_Holder_Type_TA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_9, __pyx_kp_s_Invalid_Parameter_Function_TA_IN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_10, __pyx_kp_s_Input_Not_All_Initialized_TA_INP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_11, __pyx_kp_s_Output_Not_All_Initialized_TA_OU) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_12, __pyx_kp_s_Out_of_Range_Start_Index_TA_OUT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_13, __pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_14, __pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_15, __pyx_kp_s_Bad_Object_TA_BAD_OBJECT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_5000, __pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, __pyx_int_65535, __pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ta_errors = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/common.pyx":32 - * } - * raise Exception('%s function failed with error code %s: %s' % ( - * function_name, ret_code, ta_errors[ret_code])) # <<<<<<<<<<<<<< - * - * def _ta_initialize(): - */ - __pyx_t_2 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_ret_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_TA_RetCode(__pyx_v_ret_code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_ta_errors, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_function_name); - __Pyx_GIVEREF(__pyx_v_function_name); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function_name); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - - /* "talib/common.pyx":31 - * 65535: 'Unknown Error (TA_UNKNOWN_ERR)', - * } - * raise Exception('%s function failed with error code %s: %s' % ( # <<<<<<<<<<<<<< - * function_name, ret_code, ta_errors[ret_code])) - * - */ - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_function_failed_with_error_co, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":7 - * __ta_version__ = lib.TA_GetVersionString() - * - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): # <<<<<<<<<<<<<< - * if ret_code == lib.TA_SUCCESS: - * return True - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.common._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ta_errors); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_5talib_6common_1_ta_check_success(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_function_name = 0; - TA_RetCode __pyx_v_ret_code; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_check_success (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function_name,&__pyx_n_s_ret_code,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_function_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ret_code)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_ta_check_success", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_check_success") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_function_name = ((PyObject*)values[0]); - __pyx_v_ret_code = __Pyx_PyInt_As_TA_RetCode(values[1]); if (unlikely((__pyx_v_ret_code == (TA_RetCode)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ta_check_success", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.common._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_function_name), (&PyString_Type), 1, "function_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_5talib_6common__ta_check_success(__pyx_self, __pyx_v_function_name, __pyx_v_ret_code); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common__ta_check_success(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_function_name, TA_RetCode __pyx_v_ret_code) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_check_success", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_5talib_6common__ta_check_success(__pyx_v_function_name, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("talib.common._ta_check_success", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":34 - * function_name, ret_code, ta_errors[ret_code])) - * - * def _ta_initialize(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_3_ta_initialize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_3_ta_initialize = {"_ta_initialize", (PyCFunction)__pyx_pw_5talib_6common_3_ta_initialize, METH_NOARGS, 0}; -static PyObject *__pyx_pw_5talib_6common_3_ta_initialize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_initialize (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_6common_2_ta_initialize(__pyx_self); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_2_ta_initialize(CYTHON_UNUSED PyObject *__pyx_self) { - TA_RetCode __pyx_v_ret_code; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_initialize", 0); - - /* "talib/common.pyx":36 - * def _ta_initialize(): - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() # <<<<<<<<<<<<<< - * _ta_check_success('TA_Initialize', ret_code) - * - */ - __pyx_v_ret_code = TA_Initialize(); - - /* "talib/common.pyx":37 - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() - * _ta_check_success('TA_Initialize', ret_code) # <<<<<<<<<<<<<< - * - * def _ta_shutdown(): - */ - __pyx_t_1 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_Initialize, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":34 - * function_name, ret_code, ta_errors[ret_code])) - * - * def _ta_initialize(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("talib.common._ta_initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":39 - * _ta_check_success('TA_Initialize', ret_code) - * - * def _ta_shutdown(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_5_ta_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_5_ta_shutdown = {"_ta_shutdown", (PyCFunction)__pyx_pw_5talib_6common_5_ta_shutdown, METH_NOARGS, 0}; -static PyObject *__pyx_pw_5talib_6common_5_ta_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_shutdown (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_6common_4_ta_shutdown(__pyx_self); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_4_ta_shutdown(CYTHON_UNUSED PyObject *__pyx_self) { - TA_RetCode __pyx_v_ret_code; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_shutdown", 0); - - /* "talib/common.pyx":41 - * def _ta_shutdown(): - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() # <<<<<<<<<<<<<< - * _ta_check_success('TA_Shutdown', ret_code) - * - */ - __pyx_v_ret_code = TA_Shutdown(); - - /* "talib/common.pyx":42 - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() - * _ta_check_success('TA_Shutdown', ret_code) # <<<<<<<<<<<<<< - * - * class MA_Type(object): - */ - __pyx_t_1 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_Shutdown, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":39 - * _ta_check_success('TA_Initialize', ret_code) - * - * def _ta_shutdown(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("talib.common._ta_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":47 - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_7MA_Type_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_7MA_Type_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5talib_6common_7MA_Type_1__init__, METH_O, 0}; -static PyObject *__pyx_pw_5talib_6common_7MA_Type_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_6common_7MA_Type___init__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_7MA_Type___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "talib/common.pyx":49 - * def __init__(self): - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', # <<<<<<<<<<<<<< - * MA_Type.EMA: 'Exponential Moving Average', - * MA_Type.WMA: 'Weighted Moving Average', - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SMA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Simple_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/common.pyx":50 - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', - * MA_Type.EMA: 'Exponential Moving Average', # <<<<<<<<<<<<<< - * MA_Type.WMA: 'Weighted Moving Average', - * MA_Type.DEMA: 'Double Exponential Moving Average', - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_EMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Exponential_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":51 - * MA_Type.SMA: 'Simple Moving Average', - * MA_Type.EMA: 'Exponential Moving Average', - * MA_Type.WMA: 'Weighted Moving Average', # <<<<<<<<<<<<<< - * MA_Type.DEMA: 'Double Exponential Moving Average', - * MA_Type.TEMA: 'Triple Exponential Moving Average', - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_WMA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Weighted_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/common.pyx":52 - * MA_Type.EMA: 'Exponential Moving Average', - * MA_Type.WMA: 'Weighted Moving Average', - * MA_Type.DEMA: 'Double Exponential Moving Average', # <<<<<<<<<<<<<< - * MA_Type.TEMA: 'Triple Exponential Moving Average', - * MA_Type.TRIMA: 'Triangular Moving Average', - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DEMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Double_Exponential_Moving_Averag) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":53 - * MA_Type.WMA: 'Weighted Moving Average', - * MA_Type.DEMA: 'Double Exponential Moving Average', - * MA_Type.TEMA: 'Triple Exponential Moving Average', # <<<<<<<<<<<<<< - * MA_Type.TRIMA: 'Triangular Moving Average', - * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TEMA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Triple_Exponential_Moving_Averag) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/common.pyx":54 - * MA_Type.DEMA: 'Double Exponential Moving Average', - * MA_Type.TEMA: 'Triple Exponential Moving Average', - * MA_Type.TRIMA: 'Triangular Moving Average', # <<<<<<<<<<<<<< - * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', - * MA_Type.MAMA: 'MESA Adaptive Moving Average', - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TRIMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_Triangular_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":55 - * MA_Type.TEMA: 'Triple Exponential Moving Average', - * MA_Type.TRIMA: 'Triangular Moving Average', - * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', # <<<<<<<<<<<<<< - * MA_Type.MAMA: 'MESA Adaptive Moving Average', - * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_KAMA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Kaufman_Adaptive_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/common.pyx":56 - * MA_Type.TRIMA: 'Triangular Moving Average', - * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', - * MA_Type.MAMA: 'MESA Adaptive Moving Average', # <<<<<<<<<<<<<< - * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', - * } - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MAMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_kp_s_MESA_Adaptive_Moving_Average) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":57 - * MA_Type.KAMA: 'Kaufman Adaptive Moving Average', - * MA_Type.MAMA: 'MESA Adaptive Moving Average', - * MA_Type.T3: 'Triple Generalized Double Exponential Moving Average', # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_T3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Triple_Generalized_Double_Expone) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/common.pyx":48 - * - * def __init__(self): - * self._lookup = { # <<<<<<<<<<<<<< - * MA_Type.SMA: 'Simple Moving Average', - * MA_Type.EMA: 'Exponential Moving Average', - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lookup, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":47 - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("talib.common.MA_Type.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":60 - * } - * - * def __getitem__(self, type_): # <<<<<<<<<<<<<< - * return self._lookup[type_] - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_7MA_Type_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_7MA_Type_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_5talib_6common_7MA_Type_3__getitem__, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5talib_6common_7MA_Type_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_type_ = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_type_ = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.common.MA_Type.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_6common_7MA_Type_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_type_); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_7MA_Type_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type_) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 0); - - /* "talib/common.pyx":61 - * - * def __getitem__(self, type_): - * return self._lookup[type_] # <<<<<<<<<<<<<< - * - * MA_Type = MA_Type() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_type_); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/common.pyx":60 - * } - * - * def __getitem__(self, type_): # <<<<<<<<<<<<<< - * return self._lookup[type_] - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.common.MA_Type.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":74 - * _ta_func_unst_ids[name] = i - * - * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_7_ta_set_unstable_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_7_ta_set_unstable_period = {"_ta_set_unstable_period", (PyCFunction)__pyx_pw_5talib_6common_7_ta_set_unstable_period, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5talib_6common_7_ta_set_unstable_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_period = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_set_unstable_period (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_period,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_ta_set_unstable_period", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ta_set_unstable_period") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_name = values[0]; - __pyx_v_period = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ta_set_unstable_period", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("talib.common._ta_set_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5talib_6common_6_ta_set_unstable_period(__pyx_self, __pyx_v_name, __pyx_v_period); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_6_ta_set_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_period) { - TA_RetCode __pyx_v_ret_code; - TA_FuncUnstId __pyx_v_id; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - TA_FuncUnstId __pyx_t_3; - unsigned int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_set_unstable_period", 0); - - /* "talib/common.pyx":76 - * def _ta_set_unstable_period(name, period): - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] # <<<<<<<<<<<<<< - * ret_code = lib.TA_SetUnstablePeriod(id, period) - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_TA_FuncUnstId(__pyx_t_2); if (unlikely((__pyx_t_3 == (TA_FuncUnstId)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_id = __pyx_t_3; - - /* "talib/common.pyx":77 - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - * ret_code = lib.TA_SetUnstablePeriod(id, period) # <<<<<<<<<<<<<< - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - * - */ - __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_period); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ret_code = TA_SetUnstablePeriod(__pyx_v_id, __pyx_t_4); - - /* "talib/common.pyx":78 - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - * ret_code = lib.TA_SetUnstablePeriod(id, period) - * _ta_check_success('TA_SetUnstablePeriod', ret_code) # <<<<<<<<<<<<<< - * - * def _ta_get_unstable_period(name): - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SetUnstablePeriod, __pyx_v_ret_code, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":74 - * _ta_func_unst_ids[name] = i - * - * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.common._ta_set_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/common.pyx":80 - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - * - * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6common_9_ta_get_unstable_period(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ -static PyMethodDef __pyx_mdef_5talib_6common_9_ta_get_unstable_period = {"_ta_get_unstable_period", (PyCFunction)__pyx_pw_5talib_6common_9_ta_get_unstable_period, METH_O, 0}; -static PyObject *__pyx_pw_5talib_6common_9_ta_get_unstable_period(PyObject *__pyx_self, PyObject *__pyx_v_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ta_get_unstable_period (wrapper)", 0); - __pyx_r = __pyx_pf_5talib_6common_8_ta_get_unstable_period(__pyx_self, ((PyObject *)__pyx_v_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6common_8_ta_get_unstable_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { - unsigned int __pyx_v_period; - TA_FuncUnstId __pyx_v_id; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - TA_FuncUnstId __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ta_get_unstable_period", 0); - - /* "talib/common.pyx":82 - * def _ta_get_unstable_period(name): - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] # <<<<<<<<<<<<<< - * period = lib.TA_GetUnstablePeriod(id) - * return period - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_TA_FuncUnstId(__pyx_t_2); if (unlikely((__pyx_t_3 == (TA_FuncUnstId)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_id = __pyx_t_3; - - /* "talib/common.pyx":83 - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - * period = lib.TA_GetUnstablePeriod(id) # <<<<<<<<<<<<<< - * return period - */ - __pyx_v_period = TA_GetUnstablePeriod(__pyx_v_id); - - /* "talib/common.pyx":84 - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - * period = lib.TA_GetUnstablePeriod(id) - * return period # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_period); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/common.pyx":80 - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - * - * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.common._ta_get_unstable_period", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {"_ta_check_success", (PyCFunction)__pyx_pw_5talib_6common_1_ta_check_success, METH_VARARGS|METH_KEYWORDS, 0}, - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "common", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_ADX, __pyx_k_ADX, sizeof(__pyx_k_ADX), 0, 0, 1, 1}, - {&__pyx_n_s_ADXR, __pyx_k_ADXR, sizeof(__pyx_k_ADXR), 0, 0, 1, 1}, - {&__pyx_n_s_ALL, __pyx_k_ALL, sizeof(__pyx_k_ALL), 0, 0, 1, 1}, - {&__pyx_n_s_ATR, __pyx_k_ATR, sizeof(__pyx_k_ATR), 0, 0, 1, 1}, - {&__pyx_kp_s_Allocation_Error_TA_ALLOC_ERR, __pyx_k_Allocation_Error_TA_ALLOC_ERR, sizeof(__pyx_k_Allocation_Error_TA_ALLOC_ERR), 0, 0, 1, 0}, - {&__pyx_kp_s_Bad_Object_TA_BAD_OBJECT, __pyx_k_Bad_Object_TA_BAD_OBJECT, sizeof(__pyx_k_Bad_Object_TA_BAD_OBJECT), 0, 0, 1, 0}, - {&__pyx_kp_s_Bad_Parameter_TA_BAD_PARAM, __pyx_k_Bad_Parameter_TA_BAD_PARAM, sizeof(__pyx_k_Bad_Parameter_TA_BAD_PARAM), 0, 0, 1, 0}, - {&__pyx_n_s_CMO, __pyx_k_CMO, sizeof(__pyx_k_CMO), 0, 0, 1, 1}, - {&__pyx_n_s_DEMA, __pyx_k_DEMA, sizeof(__pyx_k_DEMA), 0, 0, 1, 1}, - {&__pyx_n_s_DX, __pyx_k_DX, sizeof(__pyx_k_DX), 0, 0, 1, 1}, - {&__pyx_kp_s_Double_Exponential_Moving_Averag, __pyx_k_Double_Exponential_Moving_Averag, sizeof(__pyx_k_Double_Exponential_Moving_Averag), 0, 0, 1, 0}, - {&__pyx_n_s_EMA, __pyx_k_EMA, sizeof(__pyx_k_EMA), 0, 0, 1, 1}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_kp_s_Exponential_Moving_Average, __pyx_k_Exponential_Moving_Average, sizeof(__pyx_k_Exponential_Moving_Average), 0, 0, 1, 0}, - {&__pyx_kp_s_Function_Not_Found_TA_FUNC_NOT_F, __pyx_k_Function_Not_Found_TA_FUNC_NOT_F, sizeof(__pyx_k_Function_Not_Found_TA_FUNC_NOT_F), 0, 0, 1, 0}, - {&__pyx_kp_s_Group_Not_Found_TA_GROUP_NOT_FOU, __pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU, sizeof(__pyx_k_Group_Not_Found_TA_GROUP_NOT_FOU), 0, 0, 1, 0}, - {&__pyx_n_s_HT_DCPERIOD, __pyx_k_HT_DCPERIOD, sizeof(__pyx_k_HT_DCPERIOD), 0, 0, 1, 1}, - {&__pyx_n_s_HT_DCPHASE, __pyx_k_HT_DCPHASE, sizeof(__pyx_k_HT_DCPHASE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_PHASOR, __pyx_k_HT_PHASOR, sizeof(__pyx_k_HT_PHASOR), 0, 0, 1, 1}, - {&__pyx_n_s_HT_SINE, __pyx_k_HT_SINE, sizeof(__pyx_k_HT_SINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDLINE, __pyx_k_HT_TRENDLINE, sizeof(__pyx_k_HT_TRENDLINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDMODE, __pyx_k_HT_TRENDMODE, sizeof(__pyx_k_HT_TRENDMODE), 0, 0, 1, 1}, - {&__pyx_kp_s_Input_Not_All_Initialized_TA_INP, __pyx_k_Input_Not_All_Initialized_TA_INP, sizeof(__pyx_k_Input_Not_All_Initialized_TA_INP), 0, 0, 1, 0}, - {&__pyx_kp_s_Internal_Error_TA_INTERNAL_ERROR, __pyx_k_Internal_Error_TA_INTERNAL_ERROR, sizeof(__pyx_k_Internal_Error_TA_INTERNAL_ERROR), 0, 0, 1, 0}, - {&__pyx_kp_s_Invalid_Handle_TA_INVALID_HANDLE, __pyx_k_Invalid_Handle_TA_INVALID_HANDLE, sizeof(__pyx_k_Invalid_Handle_TA_INVALID_HANDLE), 0, 0, 1, 0}, - {&__pyx_kp_s_Invalid_List_Type_TA_INVALID_LIS, __pyx_k_Invalid_List_Type_TA_INVALID_LIS, sizeof(__pyx_k_Invalid_List_Type_TA_INVALID_LIS), 0, 0, 1, 0}, - {&__pyx_kp_s_Invalid_Parameter_Function_TA_IN, __pyx_k_Invalid_Parameter_Function_TA_IN, sizeof(__pyx_k_Invalid_Parameter_Function_TA_IN), 0, 0, 1, 0}, - {&__pyx_kp_s_Invalid_Parameter_Holder_TA_INVA, __pyx_k_Invalid_Parameter_Holder_TA_INVA, sizeof(__pyx_k_Invalid_Parameter_Holder_TA_INVA), 0, 0, 1, 0}, - {&__pyx_kp_s_Invalid_Parameter_Holder_Type_TA, __pyx_k_Invalid_Parameter_Holder_Type_TA, sizeof(__pyx_k_Invalid_Parameter_Holder_Type_TA), 0, 0, 1, 0}, - {&__pyx_n_s_KAMA, __pyx_k_KAMA, sizeof(__pyx_k_KAMA), 0, 0, 1, 1}, - {&__pyx_kp_s_Kaufman_Adaptive_Moving_Average, __pyx_k_Kaufman_Adaptive_Moving_Average, sizeof(__pyx_k_Kaufman_Adaptive_Moving_Average), 0, 0, 1, 0}, - {&__pyx_kp_s_Library_Not_Initialized_TA_LIB_N, __pyx_k_Library_Not_Initialized_TA_LIB_N, sizeof(__pyx_k_Library_Not_Initialized_TA_LIB_N), 0, 0, 1, 0}, - {&__pyx_n_s_MAMA, __pyx_k_MAMA, sizeof(__pyx_k_MAMA), 0, 0, 1, 1}, - {&__pyx_n_s_MA_Type, __pyx_k_MA_Type, sizeof(__pyx_k_MA_Type), 0, 0, 1, 1}, - {&__pyx_n_s_MA_Type___getitem, __pyx_k_MA_Type___getitem, sizeof(__pyx_k_MA_Type___getitem), 0, 0, 1, 1}, - {&__pyx_n_s_MA_Type___init, __pyx_k_MA_Type___init, sizeof(__pyx_k_MA_Type___init), 0, 0, 1, 1}, - {&__pyx_kp_s_MESA_Adaptive_Moving_Average, __pyx_k_MESA_Adaptive_Moving_Average, sizeof(__pyx_k_MESA_Adaptive_Moving_Average), 0, 0, 1, 0}, - {&__pyx_n_s_MFI, __pyx_k_MFI, sizeof(__pyx_k_MFI), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DI, __pyx_k_MINUS_DI, sizeof(__pyx_k_MINUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DM, __pyx_k_MINUS_DM, sizeof(__pyx_k_MINUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_NATR, __pyx_k_NATR, sizeof(__pyx_k_NATR), 0, 0, 1, 1}, - {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, - {&__pyx_kp_s_Not_Supported_TA_NOT_SUPPORTED, __pyx_k_Not_Supported_TA_NOT_SUPPORTED, sizeof(__pyx_k_Not_Supported_TA_NOT_SUPPORTED), 0, 0, 1, 0}, - {&__pyx_kp_s_Out_of_Range_End_Index_TA_OUT_OF, __pyx_k_Out_of_Range_End_Index_TA_OUT_OF, sizeof(__pyx_k_Out_of_Range_End_Index_TA_OUT_OF), 0, 0, 1, 0}, - {&__pyx_kp_s_Out_of_Range_Start_Index_TA_OUT, __pyx_k_Out_of_Range_Start_Index_TA_OUT, sizeof(__pyx_k_Out_of_Range_Start_Index_TA_OUT), 0, 0, 1, 0}, - {&__pyx_kp_s_Output_Not_All_Initialized_TA_OU, __pyx_k_Output_Not_All_Initialized_TA_OU, sizeof(__pyx_k_Output_Not_All_Initialized_TA_OU), 0, 0, 1, 0}, - {&__pyx_n_s_PLUS_DI, __pyx_k_PLUS_DI, sizeof(__pyx_k_PLUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_PLUS_DM, __pyx_k_PLUS_DM, sizeof(__pyx_k_PLUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_RSI, __pyx_k_RSI, sizeof(__pyx_k_RSI), 0, 0, 1, 1}, - {&__pyx_n_s_SMA, __pyx_k_SMA, sizeof(__pyx_k_SMA), 0, 0, 1, 1}, - {&__pyx_n_s_STOCHRSI, __pyx_k_STOCHRSI, sizeof(__pyx_k_STOCHRSI), 0, 0, 1, 1}, - {&__pyx_kp_s_Simple_Moving_Average, __pyx_k_Simple_Moving_Average, sizeof(__pyx_k_Simple_Moving_Average), 0, 0, 1, 0}, - {&__pyx_n_s_Success, __pyx_k_Success, sizeof(__pyx_k_Success), 0, 0, 1, 1}, - {&__pyx_n_s_T3, __pyx_k_T3, sizeof(__pyx_k_T3), 0, 0, 1, 1}, - {&__pyx_n_s_TA_Initialize, __pyx_k_TA_Initialize, sizeof(__pyx_k_TA_Initialize), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SetUnstablePeriod, __pyx_k_TA_SetUnstablePeriod, sizeof(__pyx_k_TA_SetUnstablePeriod), 0, 0, 1, 1}, - {&__pyx_n_s_TA_Shutdown, __pyx_k_TA_Shutdown, sizeof(__pyx_k_TA_Shutdown), 0, 0, 1, 1}, - {&__pyx_n_s_TEMA, __pyx_k_TEMA, sizeof(__pyx_k_TEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TRIMA, __pyx_k_TRIMA, sizeof(__pyx_k_TRIMA), 0, 0, 1, 1}, - {&__pyx_kp_s_Triangular_Moving_Average, __pyx_k_Triangular_Moving_Average, sizeof(__pyx_k_Triangular_Moving_Average), 0, 0, 1, 0}, - {&__pyx_kp_s_Triple_Exponential_Moving_Averag, __pyx_k_Triple_Exponential_Moving_Averag, sizeof(__pyx_k_Triple_Exponential_Moving_Averag), 0, 0, 1, 0}, - {&__pyx_kp_s_Triple_Generalized_Double_Expone, __pyx_k_Triple_Generalized_Double_Expone, sizeof(__pyx_k_Triple_Generalized_Double_Expone), 0, 0, 1, 0}, - {&__pyx_kp_s_Unknown_Error_TA_UNKNOWN_ERR, __pyx_k_Unknown_Error_TA_UNKNOWN_ERR, sizeof(__pyx_k_Unknown_Error_TA_UNKNOWN_ERR), 0, 0, 1, 0}, - {&__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_k_Users_jbenedik_Dev_ta_lib_talib, sizeof(__pyx_k_Users_jbenedik_Dev_ta_lib_talib), 0, 0, 1, 0}, - {&__pyx_n_s_WMA, __pyx_k_WMA, sizeof(__pyx_k_WMA), 0, 0, 1, 1}, - {&__pyx_kp_s_Weighted_Moving_Average, __pyx_k_Weighted_Moving_Average, sizeof(__pyx_k_Weighted_Moving_Average), 0, 0, 1, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, - {&__pyx_n_s_function_name, __pyx_k_function_name, sizeof(__pyx_k_function_name), 0, 0, 1, 1}, - {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, - {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_ret_code, __pyx_k_ret_code, sizeof(__pyx_k_ret_code), 0, 0, 1, 1}, - {&__pyx_kp_s_s_function_failed_with_error_co, __pyx_k_s_function_failed_with_error_co, sizeof(__pyx_k_s_function_failed_with_error_co), 0, 0, 1, 0}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_ta_func_unst_ids, __pyx_k_ta_func_unst_ids, sizeof(__pyx_k_ta_func_unst_ids), 0, 0, 1, 1}, - {&__pyx_n_s_ta_get_unstable_period, __pyx_k_ta_get_unstable_period, sizeof(__pyx_k_ta_get_unstable_period), 0, 0, 1, 1}, - {&__pyx_n_s_ta_initialize, __pyx_k_ta_initialize, sizeof(__pyx_k_ta_initialize), 0, 0, 1, 1}, - {&__pyx_n_s_ta_set_unstable_period, __pyx_k_ta_set_unstable_period, sizeof(__pyx_k_ta_set_unstable_period), 0, 0, 1, 1}, - {&__pyx_n_s_ta_shutdown, __pyx_k_ta_shutdown, sizeof(__pyx_k_ta_shutdown), 0, 0, 1, 1}, - {&__pyx_n_s_ta_version, __pyx_k_ta_version, sizeof(__pyx_k_ta_version), 0, 0, 1, 1}, - {&__pyx_n_s_talib_common, __pyx_k_talib_common, sizeof(__pyx_k_talib_common), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "talib/common.pyx":34 - * function_name, ret_code, ta_errors[ret_code])) - * - * def _ta_initialize(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ret_code); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_initialize, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":39 - * _ta_check_success('TA_Initialize', ret_code) - * - * def _ta_shutdown(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ret_code); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_shutdown, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":45 - * - * class MA_Type(object): - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) # <<<<<<<<<<<<<< - * - * def __init__(self): - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_9); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "talib/common.pyx":47 - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_init, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":60 - * } - * - * def __getitem__(self, type_): # <<<<<<<<<<<<<< - * return self._lookup[type_] - * - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_type); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_getitem, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":74 - * _ta_func_unst_ids[name] = i - * - * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_name, __pyx_n_s_period, __pyx_n_s_ret_code, __pyx_n_s_id); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_set_unstable_period, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "talib/common.pyx":80 - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - * - * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_period, __pyx_n_s_id); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ta_get_unstable_period, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_5000 = PyInt_FromLong(5000); if (unlikely(!__pyx_int_5000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initcommon(void); /*proto*/ -PyMODINIT_FUNC initcommon(void) -#else -PyMODINIT_FUNC PyInit_common(void); /*proto*/ -PyMODINIT_FUNC PyInit_common(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *(*__pyx_t_15)(PyObject *); - Py_ssize_t __pyx_t_16; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_common(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("common", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_talib__common) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "talib.common")) { - if (unlikely(PyDict_SetItemString(modules, "talib.common", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("_ta_check_success", (void (*)(void))__pyx_f_5talib_6common__ta_check_success, "PyObject *(PyObject *, TA_RetCode, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - - /* "talib/common.pyx":5 - * from libta_lib cimport TA_RetCode, TA_FuncUnstId - * - * __ta_version__ = lib.TA_GetVersionString() # <<<<<<<<<<<<<< - * - * cpdef _ta_check_success(str function_name, TA_RetCode ret_code): - */ - __pyx_t_1 = __Pyx_PyBytes_FromString(TA_GetVersionString()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":34 - * function_name, ret_code, ta_errors[ret_code])) - * - * def _ta_initialize(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Initialize() - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_6common_3_ta_initialize, NULL, __pyx_n_s_talib_common); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_initialize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":39 - * _ta_check_success('TA_Initialize', ret_code) - * - * def _ta_shutdown(): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * ret_code = lib.TA_Shutdown() - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_6common_5_ta_shutdown, NULL, __pyx_n_s_talib_common); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_shutdown, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":44 - * _ta_check_success('TA_Shutdown', ret_code) - * - * class MA_Type(object): # <<<<<<<<<<<<<< - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MA_Type, __pyx_n_s_MA_Type, (PyObject *) NULL, __pyx_n_s_talib_common, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - - /* "talib/common.pyx":45 - * - * class MA_Type(object): - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) # <<<<<<<<<<<<<< - * - * def __init__(self): - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 9)) { - if (size > 9) __Pyx_RaiseTooManyValuesError(9); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7); - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_7 = PyList_GET_ITEM(sequence, 2); - __pyx_t_8 = PyList_GET_ITEM(sequence, 3); - __pyx_t_9 = PyList_GET_ITEM(sequence, 4); - __pyx_t_10 = PyList_GET_ITEM(sequence, 5); - __pyx_t_11 = PyList_GET_ITEM(sequence, 6); - __pyx_t_12 = PyList_GET_ITEM(sequence, 7); - __pyx_t_13 = PyList_GET_ITEM(sequence, 8); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - #else - { - Py_ssize_t i; - PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13}; - for (i=0; i < 9; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - } - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13}; - __pyx_t_14 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext; - for (index=0; index < 9; index++) { - PyObject* item = __pyx_t_15(__pyx_t_14); if (unlikely(!item)) goto __pyx_L2_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = NULL; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L3_unpacking_done; - __pyx_L2_unpacking_failed:; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L3_unpacking_done:; - } - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SMA, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_EMA, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_WMA, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DEMA, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TEMA, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TRIMA, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_KAMA, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MAMA, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_T3, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - - /* "talib/common.pyx":47 - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._lookup = { - * MA_Type.SMA: 'Simple Moving Average', - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_6common_7MA_Type_1__init__, 0, __pyx_n_s_MA_Type___init, NULL, __pyx_n_s_talib_common, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "talib/common.pyx":60 - * } - * - * def __getitem__(self, type_): # <<<<<<<<<<<<<< - * return self._lookup[type_] - * - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5talib_6common_7MA_Type_3__getitem__, 0, __pyx_n_s_MA_Type___getitem, NULL, __pyx_n_s_talib_common, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "talib/common.pyx":44 - * _ta_check_success('TA_Shutdown', ret_code) - * - * class MA_Type(object): # <<<<<<<<<<<<<< - * SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9) - * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MA_Type, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA_Type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":63 - * return self._lookup[type_] - * - * MA_Type = MA_Type() # <<<<<<<<<<<<<< - * - * _ta_func_unst_ids = {'NONE': -1} - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MA_Type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA_Type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":65 - * MA_Type = MA_Type() - * - * _ta_func_unst_ids = {'NONE': -1} # <<<<<<<<<<<<<< - * for i, name in enumerate([ - * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_NONE, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_func_unst_ids, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":66 - * - * _ta_func_unst_ids = {'NONE': -1} - * for i, name in enumerate([ # <<<<<<<<<<<<<< - * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', - * 'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDLINE', - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_t_1 = __pyx_int_0; - __pyx_t_2 = PyList_New(24); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_ADX); - __Pyx_GIVEREF(__pyx_n_s_ADX); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ADX); - __Pyx_INCREF(__pyx_n_s_ADXR); - __Pyx_GIVEREF(__pyx_n_s_ADXR); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ADXR); - __Pyx_INCREF(__pyx_n_s_ATR); - __Pyx_GIVEREF(__pyx_n_s_ATR); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ATR); - __Pyx_INCREF(__pyx_n_s_CMO); - __Pyx_GIVEREF(__pyx_n_s_CMO); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_CMO); - __Pyx_INCREF(__pyx_n_s_DX); - __Pyx_GIVEREF(__pyx_n_s_DX); - PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_DX); - __Pyx_INCREF(__pyx_n_s_EMA); - __Pyx_GIVEREF(__pyx_n_s_EMA); - PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_EMA); - __Pyx_INCREF(__pyx_n_s_HT_DCPERIOD); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPERIOD); - PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_HT_DCPERIOD); - __Pyx_INCREF(__pyx_n_s_HT_DCPHASE); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPHASE); - PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_HT_DCPHASE); - __Pyx_INCREF(__pyx_n_s_HT_PHASOR); - __Pyx_GIVEREF(__pyx_n_s_HT_PHASOR); - PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_HT_PHASOR); - __Pyx_INCREF(__pyx_n_s_HT_SINE); - __Pyx_GIVEREF(__pyx_n_s_HT_SINE); - PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_HT_SINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDLINE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDLINE); - PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_s_HT_TRENDLINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDMODE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDMODE); - PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_s_HT_TRENDMODE); - __Pyx_INCREF(__pyx_n_s_KAMA); - __Pyx_GIVEREF(__pyx_n_s_KAMA); - PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_s_KAMA); - __Pyx_INCREF(__pyx_n_s_MAMA); - __Pyx_GIVEREF(__pyx_n_s_MAMA); - PyList_SET_ITEM(__pyx_t_2, 13, __pyx_n_s_MAMA); - __Pyx_INCREF(__pyx_n_s_MFI); - __Pyx_GIVEREF(__pyx_n_s_MFI); - PyList_SET_ITEM(__pyx_t_2, 14, __pyx_n_s_MFI); - __Pyx_INCREF(__pyx_n_s_MINUS_DI); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DI); - PyList_SET_ITEM(__pyx_t_2, 15, __pyx_n_s_MINUS_DI); - __Pyx_INCREF(__pyx_n_s_MINUS_DM); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DM); - PyList_SET_ITEM(__pyx_t_2, 16, __pyx_n_s_MINUS_DM); - __Pyx_INCREF(__pyx_n_s_NATR); - __Pyx_GIVEREF(__pyx_n_s_NATR); - PyList_SET_ITEM(__pyx_t_2, 17, __pyx_n_s_NATR); - __Pyx_INCREF(__pyx_n_s_PLUS_DI); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DI); - PyList_SET_ITEM(__pyx_t_2, 18, __pyx_n_s_PLUS_DI); - __Pyx_INCREF(__pyx_n_s_PLUS_DM); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DM); - PyList_SET_ITEM(__pyx_t_2, 19, __pyx_n_s_PLUS_DM); - __Pyx_INCREF(__pyx_n_s_RSI); - __Pyx_GIVEREF(__pyx_n_s_RSI); - PyList_SET_ITEM(__pyx_t_2, 20, __pyx_n_s_RSI); - __Pyx_INCREF(__pyx_n_s_STOCHRSI); - __Pyx_GIVEREF(__pyx_n_s_STOCHRSI); - PyList_SET_ITEM(__pyx_t_2, 21, __pyx_n_s_STOCHRSI); - __Pyx_INCREF(__pyx_n_s_T3); - __Pyx_GIVEREF(__pyx_n_s_T3); - PyList_SET_ITEM(__pyx_t_2, 22, __pyx_n_s_T3); - __Pyx_INCREF(__pyx_n_s_ALL); - __Pyx_GIVEREF(__pyx_n_s_ALL); - PyList_SET_ITEM(__pyx_t_2, 23, __pyx_n_s_ALL); - __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_16 >= 24) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_2; - __pyx_t_2 = 0; - - /* "talib/common.pyx":72 - * 'NATR', 'PLUS_DI', 'PLUS_DM', 'RSI', 'STOCHRSI', 'T3', 'ALL' - * ]): - * _ta_func_unst_ids[name] = i # <<<<<<<<<<<<<< - * - * def _ta_set_unstable_period(name, period): - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ta_func_unst_ids); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/common.pyx":66 - * - * _ta_func_unst_ids = {'NONE': -1} - * for i, name in enumerate([ # <<<<<<<<<<<<<< - * 'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD', - * 'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDLINE', - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":74 - * _ta_func_unst_ids[name] = i - * - * def _ta_set_unstable_period(name, period): # <<<<<<<<<<<<<< - * cdef TA_RetCode ret_code - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_6common_7_ta_set_unstable_period, NULL, __pyx_n_s_talib_common); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_set_unstable_period, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":80 - * _ta_check_success('TA_SetUnstablePeriod', ret_code) - * - * def _ta_get_unstable_period(name): # <<<<<<<<<<<<<< - * cdef unsigned int period - * cdef TA_FuncUnstId id = _ta_func_unst_ids[name] - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5talib_6common_9_ta_get_unstable_period, NULL, __pyx_n_s_talib_common); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ta_get_unstable_period, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "talib/common.pyx":2 - * - * cimport libta_lib as lib # <<<<<<<<<<<<<< - * from libta_lib cimport TA_RetCode, TA_FuncUnstId - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init talib.common", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init talib.common"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { - Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); - for (i=0; i < nbases; i++) { - PyTypeObject *tmptype; - PyObject *tmp = PyTuple_GET_ITEM(bases, i); - tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif - if (!metaclass) { - metaclass = tmptype; - continue; - } - if (PyType_IsSubtype(metaclass, tmptype)) - continue; - if (PyType_IsSubtype(tmptype, metaclass)) { - metaclass = tmptype; - continue; - } - PyErr_SetString(PyExc_TypeError, - "metaclass conflict: " - "the metaclass of a derived class " - "must be a (non-strict) subclass " - "of the metaclasses of all its bases"); - return NULL; - } - if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else - metaclass = &PyType_Type; -#endif - } - Py_INCREF((PyObject*) metaclass); - return (PyObject*) metaclass; -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* fake_module; - PyTypeObject* cached_type = NULL; - fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); - if (!fake_module) return NULL; - Py_INCREF(fake_module); - cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); - if (cached_type) { - if (!PyType_Check((PyObject*)cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", - type->tp_name); - goto bad; - } - if (cached_type->tp_basicsize != type->tp_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - type->tp_name); - goto bad; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; - } -done: - Py_DECREF(fake_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} - -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) -{ - if (unlikely(op->func_doc == NULL)) { - if (op->func.m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp = op->func_doc; - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - op->func_doc = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - tmp = op->func_name; - Py_INCREF(value); - op->func_name = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - tmp = op->func_qualname; - Py_INCREF(value); - op->func_qualname = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) -{ - PyObject *self; - self = m->func_closure; - if (self == NULL) - self = Py_None; - Py_INCREF(self); - return self; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - tmp = op->func_dict; - Py_INCREF(value); - op->func_dict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) -{ - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_COMPILING_IN_CPYTHON - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyTuple_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_tuple; - op->defaults_tuple = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_tuple; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_kwdict; - op->defaults_kwdict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_kwdict; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value || value == Py_None) { - value = NULL; - } else if (!PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - tmp = op->func_annotations; - op->func_annotations = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { - PyObject* result = op->func_annotations; - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromString(m->func.m_ml->ml_name); -#else - return PyString_FromString(m->func.m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); - if (op == NULL) - return NULL; - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; - op->func.m_ml = ml; - op->func.m_self = (PyObject *) op; - Py_XINCREF(closure); - op->func_closure = closure; - Py_XINCREF(module); - op->func.m_module = module; - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; - op->func_classobj = NULL; - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - PyObject_GC_Track(op); - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); - Py_CLEAR(m->func.m_module); - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); - Py_CLEAR(m->func_classobj); - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyMem_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - PyObject_GC_Del(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); - Py_VISIT(m->func.m_module); - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); - Py_VISIT(m->func_classobj); - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) -{ - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { - Py_INCREF(func); - return func; - } - if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { - if (type == NULL) - type = (PyObject *)(Py_TYPE(obj)); - return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); - } - if (obj == Py_None) - obj = NULL; - return __Pyx_PyMethod_New(func, obj, type); -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -#if CYTHON_COMPILING_IN_PYPY -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - PyObject *self = f->m_self; - Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 0)) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 1)) { - PyObject *result, *arg0 = PySequence_ITEM(arg, 0); - if (unlikely(!arg0)) return NULL; - result = (*meth)(self, arg0); - Py_DECREF(arg0); - return result; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags in " - "__Pyx_CyFunction_Call. METH_OLDARGS is no " - "longer supported!"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -#else -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return PyCFunction_Call(func, arg, kw); -} -#endif -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, - 0, - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_Call, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_CyFunction_descr_get, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -}; -static int __pyx_CyFunction_init(void) { -#if !CYTHON_COMPILING_IN_PYPY - __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; -#endif - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); - if (__pyx_CyFunctionType == NULL) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyMem_Malloc(size); - if (!m->defaults) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, - PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { - PyObject *ns; - if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); - if (prep) { - PyObject *pargs = PyTuple_Pack(2, name, bases); - if (unlikely(!pargs)) { - Py_DECREF(prep); - return NULL; - } - ns = PyObject_Call(prep, pargs, mkw); - Py_DECREF(prep); - Py_DECREF(pargs); - } else { - if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) - return NULL; - PyErr_Clear(); - ns = PyDict_New(); - } - } else { - ns = PyDict_New(); - } - if (unlikely(!ns)) - return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; - return ns; -bad: - Py_DECREF(ns); - return NULL; -} -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, - PyObject *dict, PyObject *mkw, - int calculate_metaclass, int allow_py2_metaclass) { - PyObject *result, *margs; - PyObject *owned_metaclass = NULL; - if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); - if (owned_metaclass) { - metaclass = owned_metaclass; - } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { - PyErr_Clear(); - } else { - return NULL; - } - } - if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { - metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); - Py_XDECREF(owned_metaclass); - if (unlikely(!metaclass)) - return NULL; - owned_metaclass = metaclass; - } - margs = PyTuple_Pack(3, name, bases, dict); - if (unlikely(!margs)) { - result = NULL; - } else { - result = PyObject_Call(metaclass, margs, mkw); - Py_DECREF(margs); - } - Py_XDECREF(owned_metaclass); - return result; -} - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - x = (long)((unsigned long)a + b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - if (likely(__Pyx_sst_abs(size) <= 1)) { - a = likely(size) ? digits[0] : 0; - if (size == -1) a = -a; - } else { - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - } - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - } - x = a + b; - return PyLong_FromLong(x); - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - double result; - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); -} -#endif - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -static CYTHON_INLINE TA_RetCode __Pyx_PyInt_As_TA_RetCode(PyObject *x) { - const TA_RetCode neg_one = (TA_RetCode) -1, const_zero = (TA_RetCode) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(TA_RetCode) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (TA_RetCode) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (TA_RetCode) 0; - case 1: __PYX_VERIFY_RETURN_INT(TA_RetCode, digit, digits[0]) - case 2: - if (8 * sizeof(TA_RetCode) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) >= 2 * PyLong_SHIFT) { - return (TA_RetCode) (((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(TA_RetCode) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) >= 3 * PyLong_SHIFT) { - return (TA_RetCode) (((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(TA_RetCode) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) >= 4 * PyLong_SHIFT) { - return (TA_RetCode) (((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (TA_RetCode) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(TA_RetCode) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(TA_RetCode) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (TA_RetCode) 0; - case -1: __PYX_VERIFY_RETURN_INT(TA_RetCode, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(TA_RetCode, digit, +digits[0]) - case -2: - if (8 * sizeof(TA_RetCode) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { - return (TA_RetCode) (((TA_RetCode)-1)*(((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(TA_RetCode) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { - return (TA_RetCode) ((((((TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(TA_RetCode) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { - return (TA_RetCode) (((TA_RetCode)-1)*(((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(TA_RetCode) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { - return (TA_RetCode) ((((((((TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(TA_RetCode) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 4 * PyLong_SHIFT) { - return (TA_RetCode) (((TA_RetCode)-1)*(((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(TA_RetCode) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_RetCode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_RetCode) - 1 > 4 * PyLong_SHIFT) { - return (TA_RetCode) ((((((((((TA_RetCode)digits[3]) << PyLong_SHIFT) | (TA_RetCode)digits[2]) << PyLong_SHIFT) | (TA_RetCode)digits[1]) << PyLong_SHIFT) | (TA_RetCode)digits[0]))); - } - } - break; - } -#endif - if (sizeof(TA_RetCode) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, long, PyLong_AsLong(x)) - } else if (sizeof(TA_RetCode) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_RetCode, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - TA_RetCode val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (TA_RetCode) -1; - } - } else { - TA_RetCode val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (TA_RetCode) -1; - val = __Pyx_PyInt_As_TA_RetCode(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to TA_RetCode"); - return (TA_RetCode) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to TA_RetCode"); - return (TA_RetCode) -1; -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TA_RetCode(TA_RetCode value) { - const TA_RetCode neg_one = (TA_RetCode) -1, const_zero = (TA_RetCode) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(TA_RetCode) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_RetCode) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(TA_RetCode) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(TA_RetCode) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(TA_RetCode) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(TA_RetCode), - little, !is_unsigned); - } -} - -static CYTHON_INLINE TA_FuncUnstId __Pyx_PyInt_As_TA_FuncUnstId(PyObject *x) { - const TA_FuncUnstId neg_one = (TA_FuncUnstId) -1, const_zero = (TA_FuncUnstId) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(TA_FuncUnstId) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (TA_FuncUnstId) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (TA_FuncUnstId) 0; - case 1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, digit, digits[0]) - case 2: - if (8 * sizeof(TA_FuncUnstId) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) >= 2 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(TA_FuncUnstId) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) >= 3 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(TA_FuncUnstId) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) >= 4 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (TA_FuncUnstId) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(TA_FuncUnstId) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(TA_FuncUnstId) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (TA_FuncUnstId) 0; - case -1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, digit, +digits[0]) - case -2: - if (8 * sizeof(TA_FuncUnstId) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(TA_FuncUnstId) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { - return (TA_FuncUnstId) ((((((TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(TA_FuncUnstId) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(TA_FuncUnstId) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { - return (TA_FuncUnstId) ((((((((TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(TA_FuncUnstId) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 4 * PyLong_SHIFT) { - return (TA_FuncUnstId) (((TA_FuncUnstId)-1)*(((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(TA_FuncUnstId) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(TA_FuncUnstId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(TA_FuncUnstId) - 1 > 4 * PyLong_SHIFT) { - return (TA_FuncUnstId) ((((((((((TA_FuncUnstId)digits[3]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[2]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[1]) << PyLong_SHIFT) | (TA_FuncUnstId)digits[0]))); - } - } - break; - } -#endif - if (sizeof(TA_FuncUnstId) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, long, PyLong_AsLong(x)) - } else if (sizeof(TA_FuncUnstId) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(TA_FuncUnstId, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - TA_FuncUnstId val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (TA_FuncUnstId) -1; - } - } else { - TA_FuncUnstId val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (TA_FuncUnstId) -1; - val = __Pyx_PyInt_As_TA_FuncUnstId(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to TA_FuncUnstId"); - return (TA_FuncUnstId) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to TA_FuncUnstId"); - return (TA_FuncUnstId) -1; -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { - const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(unsigned int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (unsigned int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned int) 0; - case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) - case 2: - if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { - return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { - return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { - return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (unsigned int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(unsigned int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned int) 0; - case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) - case -2: - if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { - return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { - return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(unsigned int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) - } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - unsigned int val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (unsigned int) -1; - } - } else { - unsigned int val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned int) -1; - val = __Pyx_PyInt_As_unsigned_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned int"); - return (unsigned int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned int"); - return (unsigned int) -1; -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { - const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(unsigned int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(unsigned int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(unsigned int), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); - if (!d) { - PyErr_Clear(); - d = PyDict_New(); - if (!d) - goto bad; - Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) - goto bad; - } - tmp.fp = f; -#if PY_VERSION_HEX >= 0x02070000 - cobj = PyCapsule_New(tmp.p, sig, 0); -#else - cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); -#endif - if (!cobj) - goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) - goto bad; - Py_DECREF(cobj); - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(cobj); - Py_XDECREF(d); - return -1; -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/talib/func.c b/talib/func.c deleted file mode 100644 index 7047263ba..000000000 --- a/talib/func.c +++ /dev/null @@ -1,138741 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__talib__func -#define __PYX_HAVE_API__talib__func -#include "string.h" -#include "stdio.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#if defined(WIN32) || defined(MS_WINDOWS) -#include "ta_libc.h" -#else -#include "ta-lib/ta_defs.h" -#include "ta-lib/ta_common.h" -#include "ta-lib/ta_abstract.h" -#include "ta-lib/ta_func.h" -#endif -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* None.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - - -static const char *__pyx_f[] = { - "talib/func.pyx", - "__init__.pxd", - "type.pxd", -}; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - - -/*--- Type declarations ---*/ - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -/* ModuleImport.proto */ -static PyObject *__Pyx_ImportModule(const char *name); - -/* TypeImport.proto */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -/* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'talib.libta_lib' */ - -/* Module declarations from 'talib.common' */ -static PyObject *(*__pyx_f_5talib_6common__ta_check_success)(PyObject *, TA_RetCode, int __pyx_skip_dispatch); /*proto*/ - -/* Module declarations from 'talib.func' */ -static double __pyx_v_5talib_4func_NaN; -#define __Pyx_MODULE_NAME "talib.func" -int __pyx_module_is_main_talib__func = 0; - -/* Implementation of 'talib.func' */ -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_AD[] = "AD"; -static const char __pyx_k_DX[] = "DX"; -static const char __pyx_k_LN[] = "LN"; -static const char __pyx_k_MA[] = "MA"; -static const char __pyx_k_T3[] = "T3"; -static const char __pyx_k_ADD[] = "ADD"; -static const char __pyx_k_ADX[] = "ADX"; -static const char __pyx_k_APO[] = "APO"; -static const char __pyx_k_ATR[] = "ATR"; -static const char __pyx_k_BOP[] = "BOP"; -static const char __pyx_k_CCI[] = "CCI"; -static const char __pyx_k_CMO[] = "CMO"; -static const char __pyx_k_COS[] = "COS"; -static const char __pyx_k_DIV[] = "DIV"; -static const char __pyx_k_EMA[] = "EMA"; -static const char __pyx_k_EXP[] = "EXP"; -static const char __pyx_k_MAX[] = "MAX"; -static const char __pyx_k_MFI[] = "MFI"; -static const char __pyx_k_MIN[] = "MIN"; -static const char __pyx_k_MOM[] = "MOM"; -static const char __pyx_k_OBV[] = "OBV"; -static const char __pyx_k_PPO[] = "PPO"; -static const char __pyx_k_ROC[] = "ROC"; -static const char __pyx_k_RSI[] = "RSI"; -static const char __pyx_k_SAR[] = "SAR"; -static const char __pyx_k_SIN[] = "SIN"; -static const char __pyx_k_SMA[] = "SMA"; -static const char __pyx_k_SUB[] = "SUB"; -static const char __pyx_k_SUM[] = "SUM"; -static const char __pyx_k_TAN[] = "TAN"; -static const char __pyx_k_TSF[] = "TSF"; -static const char __pyx_k_VAR[] = "VAR"; -static const char __pyx_k_WMA[] = "WMA"; -static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_low[] = "low"; -static const char __pyx_k_nan[] = "nan"; -static const char __pyx_k_val[] = "val"; -static const char __pyx_k_ACOS[] = "ACOS"; -static const char __pyx_k_ADXR[] = "ADXR"; -static const char __pyx_k_ASIN[] = "ASIN"; -static const char __pyx_k_ATAN[] = "ATAN"; -static const char __pyx_k_BETA[] = "BETA"; -static const char __pyx_k_CEIL[] = "CEIL"; -static const char __pyx_k_COSH[] = "COSH"; -static const char __pyx_k_DEMA[] = "DEMA"; -static const char __pyx_k_KAMA[] = "KAMA"; -static const char __pyx_k_MACD[] = "MACD"; -static const char __pyx_k_MAMA[] = "MAMA"; -static const char __pyx_k_MAVP[] = "MAVP"; -static const char __pyx_k_MULT[] = "MULT"; -static const char __pyx_k_NATR[] = "NATR"; -static const char __pyx_k_ROCP[] = "ROCP"; -static const char __pyx_k_ROCR[] = "ROCR"; -static const char __pyx_k_SINH[] = "SINH"; -static const char __pyx_k_SQRT[] = "SQRT"; -static const char __pyx_k_TANH[] = "TANH"; -static const char __pyx_k_TEMA[] = "TEMA"; -static const char __pyx_k_TRIX[] = "TRIX"; -static const char __pyx_k_high[] = "high"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_open[] = "open"; -static const char __pyx_k_real[] = "real"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_ADOSC[] = "ADOSC"; -static const char __pyx_k_AROON[] = "AROON"; -static const char __pyx_k_FLOOR[] = "FLOOR"; -static const char __pyx_k_LOG10[] = "LOG10"; -static const char __pyx_k_STOCH[] = "STOCH"; -static const char __pyx_k_TA_AD[] = "TA_AD"; -static const char __pyx_k_TA_DX[] = "TA_DX"; -static const char __pyx_k_TA_LN[] = "TA_LN"; -static const char __pyx_k_TA_MA[] = "TA_MA"; -static const char __pyx_k_TA_T3[] = "TA_T3"; -static const char __pyx_k_TRIMA[] = "TRIMA"; -static const char __pyx_k_WILLR[] = "WILLR"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_nbdev[] = "nbdev"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_real0[] = "real0"; -static const char __pyx_k_real1[] = "real1"; -static const char __pyx_k_BBANDS[] = "BBANDS"; -static const char __pyx_k_CORREL[] = "CORREL"; -static const char __pyx_k_MINMAX[] = "MINMAX"; -static const char __pyx_k_SAREXT[] = "SAREXT"; -static const char __pyx_k_STDDEV[] = "STDDEV"; -static const char __pyx_k_STOCHF[] = "STOCHF"; -static const char __pyx_k_TA_ADD[] = "TA_ADD"; -static const char __pyx_k_TA_ADX[] = "TA_ADX"; -static const char __pyx_k_TA_APO[] = "TA_APO"; -static const char __pyx_k_TA_ATR[] = "TA_ATR"; -static const char __pyx_k_TA_BOP[] = "TA_BOP"; -static const char __pyx_k_TA_CCI[] = "TA_CCI"; -static const char __pyx_k_TA_CMO[] = "TA_CMO"; -static const char __pyx_k_TA_COS[] = "TA_COS"; -static const char __pyx_k_TA_DIV[] = "TA_DIV"; -static const char __pyx_k_TA_EMA[] = "TA_EMA"; -static const char __pyx_k_TA_EXP[] = "TA_EXP"; -static const char __pyx_k_TA_MAX[] = "TA_MAX"; -static const char __pyx_k_TA_MFI[] = "TA_MFI"; -static const char __pyx_k_TA_MIN[] = "TA_MIN"; -static const char __pyx_k_TA_MOM[] = "TA_MOM"; -static const char __pyx_k_TA_OBV[] = "TA_OBV"; -static const char __pyx_k_TA_PPO[] = "TA_PPO"; -static const char __pyx_k_TA_ROC[] = "TA_ROC"; -static const char __pyx_k_TA_RSI[] = "TA_RSI"; -static const char __pyx_k_TA_SAR[] = "TA_SAR"; -static const char __pyx_k_TA_SIN[] = "TA_SIN"; -static const char __pyx_k_TA_SMA[] = "TA_SMA"; -static const char __pyx_k_TA_SUB[] = "TA_SUB"; -static const char __pyx_k_TA_SUM[] = "TA_SUM"; -static const char __pyx_k_TA_TAN[] = "TA_TAN"; -static const char __pyx_k_TA_TSF[] = "TA_TSF"; -static const char __pyx_k_TA_VAR[] = "TA_VAR"; -static const char __pyx_k_TA_WMA[] = "TA_WMA"; -static const char __pyx_k_TRANGE[] = "TRANGE"; -static const char __pyx_k_ULTOSC[] = "ULTOSC"; -static const char __pyx_k_begidx[] = "begidx"; -static const char __pyx_k_endidx[] = "endidx"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_length[] = "length"; -static const char __pyx_k_matype[] = "matype"; -static const char __pyx_k_outmax[] = "outmax"; -static const char __pyx_k_outmin[] = "outmin"; -static const char __pyx_k_volume[] = "volume"; -static const char __pyx_k_CDLDOJI[] = "CDLDOJI"; -static const char __pyx_k_HT_SINE[] = "HT_SINE"; -static const char __pyx_k_MACDEXT[] = "MACDEXT"; -static const char __pyx_k_MACDFIX[] = "MACDFIX"; -static const char __pyx_k_PLUS_DI[] = "PLUS_DI"; -static const char __pyx_k_PLUS_DM[] = "PLUS_DM"; -static const char __pyx_k_ROCR100[] = "ROCR100"; -static const char __pyx_k_TA_ACOS[] = "TA_ACOS"; -static const char __pyx_k_TA_ADXR[] = "TA_ADXR"; -static const char __pyx_k_TA_ASIN[] = "TA_ASIN"; -static const char __pyx_k_TA_ATAN[] = "TA_ATAN"; -static const char __pyx_k_TA_BETA[] = "TA_BETA"; -static const char __pyx_k_TA_CEIL[] = "TA_CEIL"; -static const char __pyx_k_TA_COSH[] = "TA_COSH"; -static const char __pyx_k_TA_DEMA[] = "TA_DEMA"; -static const char __pyx_k_TA_KAMA[] = "TA_KAMA"; -static const char __pyx_k_TA_MACD[] = "TA_MACD"; -static const char __pyx_k_TA_MAMA[] = "TA_MAMA"; -static const char __pyx_k_TA_MAVP[] = "TA_MAVP"; -static const char __pyx_k_TA_MULT[] = "TA_MULT"; -static const char __pyx_k_TA_NATR[] = "TA_NATR"; -static const char __pyx_k_TA_ROCP[] = "TA_ROCP"; -static const char __pyx_k_TA_ROCR[] = "TA_ROCR"; -static const char __pyx_k_TA_SINH[] = "TA_SINH"; -static const char __pyx_k_TA_SQRT[] = "TA_SQRT"; -static const char __pyx_k_TA_TANH[] = "TA_TANH"; -static const char __pyx_k_TA_TEMA[] = "TA_TEMA"; -static const char __pyx_k_TA_TRIX[] = "TA_TRIX"; -static const char __pyx_k_maximum[] = "maximum"; -static const char __pyx_k_nbdevdn[] = "nbdevdn"; -static const char __pyx_k_nbdevup[] = "nbdevup"; -static const char __pyx_k_outfama[] = "outfama"; -static const char __pyx_k_outmacd[] = "outmacd"; -static const char __pyx_k_outmama[] = "outmama"; -static const char __pyx_k_outreal[] = "outreal"; -static const char __pyx_k_outsine[] = "outsine"; -static const char __pyx_k_periods[] = "periods"; -static const char __pyx_k_retCode[] = "retCode"; -static const char __pyx_k_vfactor[] = "vfactor"; -static const char __pyx_k_AROONOSC[] = "AROONOSC"; -static const char __pyx_k_AVGPRICE[] = "AVGPRICE"; -static const char __pyx_k_MAXINDEX[] = "MAXINDEX"; -static const char __pyx_k_MEDPRICE[] = "MEDPRICE"; -static const char __pyx_k_MIDPOINT[] = "MIDPOINT"; -static const char __pyx_k_MIDPRICE[] = "MIDPRICE"; -static const char __pyx_k_MININDEX[] = "MININDEX"; -static const char __pyx_k_MINUS_DI[] = "MINUS_DI"; -static const char __pyx_k_MINUS_DM[] = "MINUS_DM"; -static const char __pyx_k_STOCHRSI[] = "STOCHRSI"; -static const char __pyx_k_TA_ADOSC[] = "TA_ADOSC"; -static const char __pyx_k_TA_AROON[] = "TA_AROON"; -static const char __pyx_k_TA_FLOOR[] = "TA_FLOOR"; -static const char __pyx_k_TA_LOG10[] = "TA_LOG10"; -static const char __pyx_k_TA_STOCH[] = "TA_STOCH"; -static const char __pyx_k_TA_TRIMA[] = "TA_TRIMA"; -static const char __pyx_k_TA_WILLR[] = "TA_WILLR"; -static const char __pyx_k_TYPPRICE[] = "TYPPRICE"; -static const char __pyx_k_WCLPRICE[] = "WCLPRICE"; -static const char __pyx_k_lookback[] = "lookback"; -static const char __pyx_k_low_data[] = "low_data"; -static const char __pyx_k_outfastd[] = "outfastd"; -static const char __pyx_k_outfastk[] = "outfastk"; -static const char __pyx_k_outslowd[] = "outslowd"; -static const char __pyx_k_outslowk[] = "outslowk"; -static const char __pyx_k_CDL2CROWS[] = "CDL2CROWS"; -static const char __pyx_k_CDLHAMMER[] = "CDLHAMMER"; -static const char __pyx_k_CDLHARAMI[] = "CDLHARAMI"; -static const char __pyx_k_CDLINNECK[] = "CDLINNECK"; -static const char __pyx_k_CDLONNECK[] = "CDLONNECK"; -static const char __pyx_k_CDLTAKURI[] = "CDLTAKURI"; -static const char __pyx_k_Exception[] = "Exception"; -static const char __pyx_k_HT_PHASOR[] = "HT_PHASOR"; -static const char __pyx_k_LINEARREG[] = "LINEARREG"; -static const char __pyx_k_TA_BBANDS[] = "TA_BBANDS"; -static const char __pyx_k_TA_CORREL[] = "TA_CORREL"; -static const char __pyx_k_TA_MINMAX[] = "TA_MINMAX"; -static const char __pyx_k_TA_SAREXT[] = "TA_SAREXT"; -static const char __pyx_k_TA_STDDEV[] = "TA_STDDEV"; -static const char __pyx_k_TA_STOCHF[] = "TA_STOCHF"; -static const char __pyx_k_TA_TRANGE[] = "TA_TRANGE"; -static const char __pyx_k_TA_ULTOSC[] = "TA_ULTOSC"; -static const char __pyx_k_fastlimit[] = "fastlimit"; -static const char __pyx_k_high_data[] = "high_data"; -static const char __pyx_k_maxperiod[] = "maxperiod"; -static const char __pyx_k_minperiod[] = "minperiod"; -static const char __pyx_k_open_data[] = "open_data"; -static const char __pyx_k_outbegidx[] = "outbegidx"; -static const char __pyx_k_outmaxidx[] = "outmaxidx"; -static const char __pyx_k_outminidx[] = "outminidx"; -static const char __pyx_k_real_data[] = "real_data"; -static const char __pyx_k_slowlimit[] = "slowlimit"; -static const char __pyx_k_CDL3INSIDE[] = "CDL3INSIDE"; -static const char __pyx_k_CDLHIKKAKE[] = "CDLHIKKAKE"; -static const char __pyx_k_CDLKICKING[] = "CDLKICKING"; -static const char __pyx_k_CDLMATHOLD[] = "CDLMATHOLD"; -static const char __pyx_k_CDLTRISTAR[] = "CDLTRISTAR"; -static const char __pyx_k_HT_DCPHASE[] = "HT_DCPHASE"; -static const char __pyx_k_TA_CDLDOJI[] = "TA_CDLDOJI"; -static const char __pyx_k_TA_HT_SINE[] = "TA_HT_SINE"; -static const char __pyx_k_TA_MACDEXT[] = "TA_MACDEXT"; -static const char __pyx_k_TA_MACDFIX[] = "TA_MACDFIX"; -static const char __pyx_k_TA_PLUS_DI[] = "TA_PLUS_DI"; -static const char __pyx_k_TA_PLUS_DM[] = "TA_PLUS_DM"; -static const char __pyx_k_TA_ROCR100[] = "TA_ROCR100"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_close_data[] = "close_data"; -static const char __pyx_k_fastmatype[] = "fastmatype"; -static const char __pyx_k_fastperiod[] = "fastperiod"; -static const char __pyx_k_outaroonup[] = "outaroonup"; -static const char __pyx_k_outinphase[] = "outinphase"; -static const char __pyx_k_outinteger[] = "outinteger"; -static const char __pyx_k_real0_data[] = "real0_data"; -static const char __pyx_k_real1_data[] = "real1_data"; -static const char __pyx_k_slowmatype[] = "slowmatype"; -static const char __pyx_k_slowperiod[] = "slowperiod"; -static const char __pyx_k_startvalue[] = "startvalue"; -static const char __pyx_k_talib_func[] = "talib.func"; -static const char __pyx_k_timeperiod[] = "timeperiod"; -static const char __pyx_k_CDL3OUTSIDE[] = "CDL3OUTSIDE"; -static const char __pyx_k_CDLBELTHOLD[] = "CDLBELTHOLD"; -static const char __pyx_k_CDLDOJISTAR[] = "CDLDOJISTAR"; -static const char __pyx_k_CDLHIGHWAVE[] = "CDLHIGHWAVE"; -static const char __pyx_k_CDLLONGLINE[] = "CDLLONGLINE"; -static const char __pyx_k_CDLMARUBOZU[] = "CDLMARUBOZU"; -static const char __pyx_k_CDLPIERCING[] = "CDLPIERCING"; -static const char __pyx_k_HT_DCPERIOD[] = "HT_DCPERIOD"; -static const char __pyx_k_MINMAXINDEX[] = "MINMAXINDEX"; -static const char __pyx_k_TA_AROONOSC[] = "TA_AROONOSC"; -static const char __pyx_k_TA_AVGPRICE[] = "TA_AVGPRICE"; -static const char __pyx_k_TA_MAXINDEX[] = "TA_MAXINDEX"; -static const char __pyx_k_TA_MEDPRICE[] = "TA_MEDPRICE"; -static const char __pyx_k_TA_MIDPOINT[] = "TA_MIDPOINT"; -static const char __pyx_k_TA_MIDPRICE[] = "TA_MIDPRICE"; -static const char __pyx_k_TA_MININDEX[] = "TA_MININDEX"; -static const char __pyx_k_TA_MINUS_DI[] = "TA_MINUS_DI"; -static const char __pyx_k_TA_MINUS_DM[] = "TA_MINUS_DM"; -static const char __pyx_k_TA_STOCHRSI[] = "TA_STOCHRSI"; -static const char __pyx_k_TA_TYPPRICE[] = "TA_TYPPRICE"; -static const char __pyx_k_TA_WCLPRICE[] = "TA_WCLPRICE"; -static const char __pyx_k_outleadsine[] = "outleadsine"; -static const char __pyx_k_outmacdhist[] = "outmacdhist"; -static const char __pyx_k_outmax_data[] = "outmax_data"; -static const char __pyx_k_outmin_data[] = "outmin_data"; -static const char __pyx_k_penetration[] = "penetration"; -static const char __pyx_k_timeperiod1[] = "timeperiod1"; -static const char __pyx_k_timeperiod2[] = "timeperiod2"; -static const char __pyx_k_timeperiod3[] = "timeperiod3"; -static const char __pyx_k_volume_data[] = "volume_data"; -static const char __pyx_k_CDLBREAKAWAY[] = "CDLBREAKAWAY"; -static const char __pyx_k_CDLENGULFING[] = "CDLENGULFING"; -static const char __pyx_k_CDLSHORTLINE[] = "CDLSHORTLINE"; -static const char __pyx_k_CDLTASUKIGAP[] = "CDLTASUKIGAP"; -static const char __pyx_k_CDLTHRUSTING[] = "CDLTHRUSTING"; -static const char __pyx_k_HT_TRENDLINE[] = "HT_TRENDLINE"; -static const char __pyx_k_HT_TRENDMODE[] = "HT_TRENDMODE"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_TA_CDL2CROWS[] = "TA_CDL2CROWS"; -static const char __pyx_k_TA_CDLHAMMER[] = "TA_CDLHAMMER"; -static const char __pyx_k_TA_CDLHARAMI[] = "TA_CDLHARAMI"; -static const char __pyx_k_TA_CDLINNECK[] = "TA_CDLINNECK"; -static const char __pyx_k_TA_CDLONNECK[] = "TA_CDLONNECK"; -static const char __pyx_k_TA_CDLTAKURI[] = "TA_CDLTAKURI"; -static const char __pyx_k_TA_HT_PHASOR[] = "TA_HT_PHASOR"; -static const char __pyx_k_TA_LINEARREG[] = "TA_LINEARREG"; -static const char __pyx_k_acceleration[] = "acceleration"; -static const char __pyx_k_fastd_matype[] = "fastd_matype"; -static const char __pyx_k_fastd_period[] = "fastd_period"; -static const char __pyx_k_fastk_period[] = "fastk_period"; -static const char __pyx_k_outaroondown[] = "outaroondown"; -static const char __pyx_k_outfama_data[] = "outfama_data"; -static const char __pyx_k_outmacd_data[] = "outmacd_data"; -static const char __pyx_k_outmama_data[] = "outmama_data"; -static const char __pyx_k_outnbelement[] = "outnbelement"; -static const char __pyx_k_outreal_data[] = "outreal_data"; -static const char __pyx_k_outsine_data[] = "outsine_data"; -static const char __pyx_k_periods_data[] = "periods_data"; -static const char __pyx_k_signalmatype[] = "signalmatype"; -static const char __pyx_k_signalperiod[] = "signalperiod"; -static const char __pyx_k_slowd_matype[] = "slowd_matype"; -static const char __pyx_k_slowd_period[] = "slowd_period"; -static const char __pyx_k_slowk_matype[] = "slowk_matype"; -static const char __pyx_k_slowk_period[] = "slowk_period"; -static const char __pyx_k_CDLHANGINGMAN[] = "CDLHANGINGMAN"; -static const char __pyx_k_CDLHIKKAKEMOD[] = "CDLHIKKAKEMOD"; -static const char __pyx_k_TA_CDL3INSIDE[] = "TA_CDL3INSIDE"; -static const char __pyx_k_TA_CDLHIKKAKE[] = "TA_CDLHIKKAKE"; -static const char __pyx_k_TA_CDLKICKING[] = "TA_CDLKICKING"; -static const char __pyx_k_TA_CDLMATHOLD[] = "TA_CDLMATHOLD"; -static const char __pyx_k_TA_CDLTRISTAR[] = "TA_CDLTRISTAR"; -static const char __pyx_k_TA_HT_DCPHASE[] = "TA_HT_DCPHASE"; -static const char __pyx_k_outfastd_data[] = "outfastd_data"; -static const char __pyx_k_outfastk_data[] = "outfastk_data"; -static const char __pyx_k_outmacdsignal[] = "outmacdsignal"; -static const char __pyx_k_outquadrature[] = "outquadrature"; -static const char __pyx_k_outslowd_data[] = "outslowd_data"; -static const char __pyx_k_outslowk_data[] = "outslowk_data"; -static const char __pyx_k_CDL3BLACKCROWS[] = "CDL3BLACKCROWS"; -static const char __pyx_k_CDL3LINESTRIKE[] = "CDL3LINESTRIKE"; -static const char __pyx_k_CDLEVENINGSTAR[] = "CDLEVENINGSTAR"; -static const char __pyx_k_CDLHARAMICROSS[] = "CDLHARAMICROSS"; -static const char __pyx_k_CDLMATCHINGLOW[] = "CDLMATCHINGLOW"; -static const char __pyx_k_CDLMORNINGSTAR[] = "CDLMORNINGSTAR"; -static const char __pyx_k_CDLRICKSHAWMAN[] = "CDLRICKSHAWMAN"; -static const char __pyx_k_CDLSPINNINGTOP[] = "CDLSPINNINGTOP"; -static const char __pyx_k_TA_CDL3OUTSIDE[] = "TA_CDL3OUTSIDE"; -static const char __pyx_k_TA_CDLBELTHOLD[] = "TA_CDLBELTHOLD"; -static const char __pyx_k_TA_CDLDOJISTAR[] = "TA_CDLDOJISTAR"; -static const char __pyx_k_TA_CDLHIGHWAVE[] = "TA_CDLHIGHWAVE"; -static const char __pyx_k_TA_CDLLONGLINE[] = "TA_CDLLONGLINE"; -static const char __pyx_k_TA_CDLMARUBOZU[] = "TA_CDLMARUBOZU"; -static const char __pyx_k_TA_CDLPIERCING[] = "TA_CDLPIERCING"; -static const char __pyx_k_TA_HT_DCPERIOD[] = "TA_HT_DCPERIOD"; -static const char __pyx_k_TA_MINMAXINDEX[] = "TA_MINMAXINDEX"; -static const char __pyx_k_outmaxidx_data[] = "outmaxidx_data"; -static const char __pyx_k_outminidx_data[] = "outminidx_data"; -static const char __pyx_k_CDLADVANCEBLOCK[] = "CDLADVANCEBLOCK"; -static const char __pyx_k_CDLHOMINGPIGEON[] = "CDLHOMINGPIGEON"; -static const char __pyx_k_CDLLADDERBOTTOM[] = "CDLLADDERBOTTOM"; -static const char __pyx_k_CDLSHOOTINGSTAR[] = "CDLSHOOTINGSTAR"; -static const char __pyx_k_CDLUNIQUE3RIVER[] = "CDLUNIQUE3RIVER"; -static const char __pyx_k_LINEARREG_ANGLE[] = "LINEARREG_ANGLE"; -static const char __pyx_k_LINEARREG_SLOPE[] = "LINEARREG_SLOPE"; -static const char __pyx_k_TA_CDLBREAKAWAY[] = "TA_CDLBREAKAWAY"; -static const char __pyx_k_TA_CDLENGULFING[] = "TA_CDLENGULFING"; -static const char __pyx_k_TA_CDLSHORTLINE[] = "TA_CDLSHORTLINE"; -static const char __pyx_k_TA_CDLTASUKIGAP[] = "TA_CDLTASUKIGAP"; -static const char __pyx_k_TA_CDLTHRUSTING[] = "TA_CDLTHRUSTING"; -static const char __pyx_k_TA_HT_TRENDLINE[] = "TA_HT_TRENDLINE"; -static const char __pyx_k_TA_HT_TRENDMODE[] = "TA_HT_TRENDMODE"; -static const char __pyx_k_offsetonreverse[] = "offsetonreverse"; -static const char __pyx_k_outaroonup_data[] = "outaroonup_data"; -static const char __pyx_k_outinphase_data[] = "outinphase_data"; -static const char __pyx_k_outinteger_data[] = "outinteger_data"; -static const char __pyx_k_CDL3STARSINSOUTH[] = "CDL3STARSINSOUTH"; -static const char __pyx_k_CDLABANDONEDBABY[] = "CDLABANDONEDBABY"; -static const char __pyx_k_CDLCOUNTERATTACK[] = "CDLCOUNTERATTACK"; -static const char __pyx_k_CDLDRAGONFLYDOJI[] = "CDLDRAGONFLYDOJI"; -static const char __pyx_k_CDLSTICKSANDWICH[] = "CDLSTICKSANDWICH"; -static const char __pyx_k_TA_CDLHANGINGMAN[] = "TA_CDLHANGINGMAN"; -static const char __pyx_k_TA_CDLHIKKAKEMOD[] = "TA_CDLHIKKAKEMOD"; -static const char __pyx_k_accelerationlong[] = "accelerationlong"; -static const char __pyx_k_outleadsine_data[] = "outleadsine_data"; -static const char __pyx_k_outmacdhist_data[] = "outmacdhist_data"; -static const char __pyx_k_outreallowerband[] = "outreallowerband"; -static const char __pyx_k_outrealupperband[] = "outrealupperband"; -static const char __pyx_k_CDL3WHITESOLDIERS[] = "CDL3WHITESOLDIERS"; -static const char __pyx_k_CDLDARKCLOUDCOVER[] = "CDLDARKCLOUDCOVER"; -static const char __pyx_k_CDLGRAVESTONEDOJI[] = "CDLGRAVESTONEDOJI"; -static const char __pyx_k_CDLINVERTEDHAMMER[] = "CDLINVERTEDHAMMER"; -static const char __pyx_k_CDLLONGLEGGEDDOJI[] = "CDLLONGLEGGEDDOJI"; -static const char __pyx_k_CDLSTALLEDPATTERN[] = "CDLSTALLEDPATTERN"; -static const char __pyx_k_TA_CDL3BLACKCROWS[] = "TA_CDL3BLACKCROWS"; -static const char __pyx_k_TA_CDL3LINESTRIKE[] = "TA_CDL3LINESTRIKE"; -static const char __pyx_k_TA_CDLEVENINGSTAR[] = "TA_CDLEVENINGSTAR"; -static const char __pyx_k_TA_CDLHARAMICROSS[] = "TA_CDLHARAMICROSS"; -static const char __pyx_k_TA_CDLMATCHINGLOW[] = "TA_CDLMATCHINGLOW"; -static const char __pyx_k_TA_CDLMORNINGSTAR[] = "TA_CDLMORNINGSTAR"; -static const char __pyx_k_TA_CDLRICKSHAWMAN[] = "TA_CDLRICKSHAWMAN"; -static const char __pyx_k_TA_CDLSPINNINGTOP[] = "TA_CDLSPINNINGTOP"; -static const char __pyx_k_accelerationshort[] = "accelerationshort"; -static const char __pyx_k_low_is_not_double[] = "low is not double"; -static const char __pyx_k_outaroondown_data[] = "outaroondown_data"; -static const char __pyx_k_outrealmiddleband[] = "outrealmiddleband"; -static const char __pyx_k_CDLCLOSINGMARUBOZU[] = "CDLCLOSINGMARUBOZU"; -static const char __pyx_k_CDLEVENINGDOJISTAR[] = "CDLEVENINGDOJISTAR"; -static const char __pyx_k_CDLIDENTICAL3CROWS[] = "CDLIDENTICAL3CROWS"; -static const char __pyx_k_CDLKICKINGBYLENGTH[] = "CDLKICKINGBYLENGTH"; -static const char __pyx_k_CDLMORNINGDOJISTAR[] = "CDLMORNINGDOJISTAR"; -static const char __pyx_k_CDLSEPARATINGLINES[] = "CDLSEPARATINGLINES"; -static const char __pyx_k_CDLUPSIDEGAP2CROWS[] = "CDLUPSIDEGAP2CROWS"; -static const char __pyx_k_TA_CDLADVANCEBLOCK[] = "TA_CDLADVANCEBLOCK"; -static const char __pyx_k_TA_CDLHOMINGPIGEON[] = "TA_CDLHOMINGPIGEON"; -static const char __pyx_k_TA_CDLLADDERBOTTOM[] = "TA_CDLLADDERBOTTOM"; -static const char __pyx_k_TA_CDLSHOOTINGSTAR[] = "TA_CDLSHOOTINGSTAR"; -static const char __pyx_k_TA_CDLUNIQUE3RIVER[] = "TA_CDLUNIQUE3RIVER"; -static const char __pyx_k_TA_LINEARREG_ANGLE[] = "TA_LINEARREG_ANGLE"; -static const char __pyx_k_TA_LINEARREG_SLOPE[] = "TA_LINEARREG_SLOPE"; -static const char __pyx_k_high_is_not_double[] = "high is not double"; -static const char __pyx_k_inputs_are_all_NaN[] = "inputs are all NaN"; -static const char __pyx_k_open_is_not_double[] = "open is not double"; -static const char __pyx_k_outmacdsignal_data[] = "outmacdsignal_data"; -static const char __pyx_k_outquadrature_data[] = "outquadrature_data"; -static const char __pyx_k_real_is_not_double[] = "real is not double"; -static const char __pyx_k_CDLCONCEALBABYSWALL[] = "CDLCONCEALBABYSWALL"; -static const char __pyx_k_CDLGAPSIDESIDEWHITE[] = "CDLGAPSIDESIDEWHITE"; -static const char __pyx_k_CDLRISEFALL3METHODS[] = "CDLRISEFALL3METHODS"; -static const char __pyx_k_CDLXSIDEGAP3METHODS[] = "CDLXSIDEGAP3METHODS"; -static const char __pyx_k_LINEARREG_INTERCEPT[] = "LINEARREG_INTERCEPT"; -static const char __pyx_k_TA_CDL3STARSINSOUTH[] = "TA_CDL3STARSINSOUTH"; -static const char __pyx_k_TA_CDLABANDONEDBABY[] = "TA_CDLABANDONEDBABY"; -static const char __pyx_k_TA_CDLCOUNTERATTACK[] = "TA_CDLCOUNTERATTACK"; -static const char __pyx_k_TA_CDLDRAGONFLYDOJI[] = "TA_CDLDRAGONFLYDOJI"; -static const char __pyx_k_TA_CDLSTICKSANDWICH[] = "TA_CDLSTICKSANDWICH"; -static const char __pyx_k_accelerationmaxlong[] = "accelerationmaxlong"; -static const char __pyx_k_close_is_not_double[] = "close is not double"; -static const char __pyx_k_real0_is_not_double[] = "real0 is not double"; -static const char __pyx_k_real1_is_not_double[] = "real1 is not double"; -static const char __pyx_k_TA_CDL3WHITESOLDIERS[] = "TA_CDL3WHITESOLDIERS"; -static const char __pyx_k_TA_CDLDARKCLOUDCOVER[] = "TA_CDLDARKCLOUDCOVER"; -static const char __pyx_k_TA_CDLGRAVESTONEDOJI[] = "TA_CDLGRAVESTONEDOJI"; -static const char __pyx_k_TA_CDLINVERTEDHAMMER[] = "TA_CDLINVERTEDHAMMER"; -static const char __pyx_k_TA_CDLLONGLEGGEDDOJI[] = "TA_CDLLONGLEGGEDDOJI"; -static const char __pyx_k_TA_CDLSTALLEDPATTERN[] = "TA_CDLSTALLEDPATTERN"; -static const char __pyx_k_accelerationinitlong[] = "accelerationinitlong"; -static const char __pyx_k_accelerationmaxshort[] = "accelerationmaxshort"; -static const char __pyx_k_volume_is_not_double[] = "volume is not double"; -static const char __pyx_k_TA_CDLCLOSINGMARUBOZU[] = "TA_CDLCLOSINGMARUBOZU"; -static const char __pyx_k_TA_CDLEVENINGDOJISTAR[] = "TA_CDLEVENINGDOJISTAR"; -static const char __pyx_k_TA_CDLIDENTICAL3CROWS[] = "TA_CDLIDENTICAL3CROWS"; -static const char __pyx_k_TA_CDLKICKINGBYLENGTH[] = "TA_CDLKICKINGBYLENGTH"; -static const char __pyx_k_TA_CDLMORNINGDOJISTAR[] = "TA_CDLMORNINGDOJISTAR"; -static const char __pyx_k_TA_CDLSEPARATINGLINES[] = "TA_CDLSEPARATINGLINES"; -static const char __pyx_k_TA_CDLUPSIDEGAP2CROWS[] = "TA_CDLUPSIDEGAP2CROWS"; -static const char __pyx_k_accelerationinitshort[] = "accelerationinitshort"; -static const char __pyx_k_outreallowerband_data[] = "outreallowerband_data"; -static const char __pyx_k_outrealupperband_data[] = "outrealupperband_data"; -static const char __pyx_k_periods_is_not_double[] = "periods is not double"; -static const char __pyx_k_TA_CDLCONCEALBABYSWALL[] = "TA_CDLCONCEALBABYSWALL"; -static const char __pyx_k_TA_CDLGAPSIDESIDEWHITE[] = "TA_CDLGAPSIDESIDEWHITE"; -static const char __pyx_k_TA_CDLRISEFALL3METHODS[] = "TA_CDLRISEFALL3METHODS"; -static const char __pyx_k_TA_CDLXSIDEGAP3METHODS[] = "TA_CDLXSIDEGAP3METHODS"; -static const char __pyx_k_TA_LINEARREG_INTERCEPT[] = "TA_LINEARREG_INTERCEPT"; -static const char __pyx_k_outrealmiddleband_data[] = "outrealmiddleband_data"; -static const char __pyx_k_low_has_wrong_dimensions[] = "low has wrong dimensions"; -static const char __pyx_k_high_has_wrong_dimensions[] = "high has wrong dimensions"; -static const char __pyx_k_open_has_wrong_dimensions[] = "open has wrong dimensions"; -static const char __pyx_k_real_has_wrong_dimensions[] = "real has wrong dimensions"; -static const char __pyx_k_close_has_wrong_dimensions[] = "close has wrong dimensions"; -static const char __pyx_k_real0_has_wrong_dimensions[] = "real0 has wrong dimensions"; -static const char __pyx_k_real1_has_wrong_dimensions[] = "real1 has wrong dimensions"; -static const char __pyx_k_input_lengths_are_different[] = "input lengths are different"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_volume_has_wrong_dimensions[] = "volume has wrong dimensions"; -static const char __pyx_k_periods_has_wrong_dimensions[] = "periods has wrong dimensions"; -static const char __pyx_k_Users_jbenedik_Dev_ta_lib_talib[] = "/Users/jbenedik/Dev/ta-lib/talib/func.pyx"; -static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; -static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_n_s_ACOS; -static PyObject *__pyx_n_s_AD; -static PyObject *__pyx_n_s_ADD; -static PyObject *__pyx_n_s_ADOSC; -static PyObject *__pyx_n_s_ADX; -static PyObject *__pyx_n_s_ADXR; -static PyObject *__pyx_n_s_APO; -static PyObject *__pyx_n_s_AROON; -static PyObject *__pyx_n_s_AROONOSC; -static PyObject *__pyx_n_s_ASIN; -static PyObject *__pyx_n_s_ATAN; -static PyObject *__pyx_n_s_ATR; -static PyObject *__pyx_n_s_AVGPRICE; -static PyObject *__pyx_n_s_BBANDS; -static PyObject *__pyx_n_s_BETA; -static PyObject *__pyx_n_s_BOP; -static PyObject *__pyx_n_s_CCI; -static PyObject *__pyx_n_s_CDL2CROWS; -static PyObject *__pyx_n_s_CDL3BLACKCROWS; -static PyObject *__pyx_n_s_CDL3INSIDE; -static PyObject *__pyx_n_s_CDL3LINESTRIKE; -static PyObject *__pyx_n_s_CDL3OUTSIDE; -static PyObject *__pyx_n_s_CDL3STARSINSOUTH; -static PyObject *__pyx_n_s_CDL3WHITESOLDIERS; -static PyObject *__pyx_n_s_CDLABANDONEDBABY; -static PyObject *__pyx_n_s_CDLADVANCEBLOCK; -static PyObject *__pyx_n_s_CDLBELTHOLD; -static PyObject *__pyx_n_s_CDLBREAKAWAY; -static PyObject *__pyx_n_s_CDLCLOSINGMARUBOZU; -static PyObject *__pyx_n_s_CDLCONCEALBABYSWALL; -static PyObject *__pyx_n_s_CDLCOUNTERATTACK; -static PyObject *__pyx_n_s_CDLDARKCLOUDCOVER; -static PyObject *__pyx_n_s_CDLDOJI; -static PyObject *__pyx_n_s_CDLDOJISTAR; -static PyObject *__pyx_n_s_CDLDRAGONFLYDOJI; -static PyObject *__pyx_n_s_CDLENGULFING; -static PyObject *__pyx_n_s_CDLEVENINGDOJISTAR; -static PyObject *__pyx_n_s_CDLEVENINGSTAR; -static PyObject *__pyx_n_s_CDLGAPSIDESIDEWHITE; -static PyObject *__pyx_n_s_CDLGRAVESTONEDOJI; -static PyObject *__pyx_n_s_CDLHAMMER; -static PyObject *__pyx_n_s_CDLHANGINGMAN; -static PyObject *__pyx_n_s_CDLHARAMI; -static PyObject *__pyx_n_s_CDLHARAMICROSS; -static PyObject *__pyx_n_s_CDLHIGHWAVE; -static PyObject *__pyx_n_s_CDLHIKKAKE; -static PyObject *__pyx_n_s_CDLHIKKAKEMOD; -static PyObject *__pyx_n_s_CDLHOMINGPIGEON; -static PyObject *__pyx_n_s_CDLIDENTICAL3CROWS; -static PyObject *__pyx_n_s_CDLINNECK; -static PyObject *__pyx_n_s_CDLINVERTEDHAMMER; -static PyObject *__pyx_n_s_CDLKICKING; -static PyObject *__pyx_n_s_CDLKICKINGBYLENGTH; -static PyObject *__pyx_n_s_CDLLADDERBOTTOM; -static PyObject *__pyx_n_s_CDLLONGLEGGEDDOJI; -static PyObject *__pyx_n_s_CDLLONGLINE; -static PyObject *__pyx_n_s_CDLMARUBOZU; -static PyObject *__pyx_n_s_CDLMATCHINGLOW; -static PyObject *__pyx_n_s_CDLMATHOLD; -static PyObject *__pyx_n_s_CDLMORNINGDOJISTAR; -static PyObject *__pyx_n_s_CDLMORNINGSTAR; -static PyObject *__pyx_n_s_CDLONNECK; -static PyObject *__pyx_n_s_CDLPIERCING; -static PyObject *__pyx_n_s_CDLRICKSHAWMAN; -static PyObject *__pyx_n_s_CDLRISEFALL3METHODS; -static PyObject *__pyx_n_s_CDLSEPARATINGLINES; -static PyObject *__pyx_n_s_CDLSHOOTINGSTAR; -static PyObject *__pyx_n_s_CDLSHORTLINE; -static PyObject *__pyx_n_s_CDLSPINNINGTOP; -static PyObject *__pyx_n_s_CDLSTALLEDPATTERN; -static PyObject *__pyx_n_s_CDLSTICKSANDWICH; -static PyObject *__pyx_n_s_CDLTAKURI; -static PyObject *__pyx_n_s_CDLTASUKIGAP; -static PyObject *__pyx_n_s_CDLTHRUSTING; -static PyObject *__pyx_n_s_CDLTRISTAR; -static PyObject *__pyx_n_s_CDLUNIQUE3RIVER; -static PyObject *__pyx_n_s_CDLUPSIDEGAP2CROWS; -static PyObject *__pyx_n_s_CDLXSIDEGAP3METHODS; -static PyObject *__pyx_n_s_CEIL; -static PyObject *__pyx_n_s_CMO; -static PyObject *__pyx_n_s_CORREL; -static PyObject *__pyx_n_s_COS; -static PyObject *__pyx_n_s_COSH; -static PyObject *__pyx_n_s_DEMA; -static PyObject *__pyx_n_s_DIV; -static PyObject *__pyx_n_s_DX; -static PyObject *__pyx_n_s_EMA; -static PyObject *__pyx_n_s_EXP; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_n_s_FLOOR; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_n_s_HT_DCPERIOD; -static PyObject *__pyx_n_s_HT_DCPHASE; -static PyObject *__pyx_n_s_HT_PHASOR; -static PyObject *__pyx_n_s_HT_SINE; -static PyObject *__pyx_n_s_HT_TRENDLINE; -static PyObject *__pyx_n_s_HT_TRENDMODE; -static PyObject *__pyx_n_s_KAMA; -static PyObject *__pyx_n_s_LINEARREG; -static PyObject *__pyx_n_s_LINEARREG_ANGLE; -static PyObject *__pyx_n_s_LINEARREG_INTERCEPT; -static PyObject *__pyx_n_s_LINEARREG_SLOPE; -static PyObject *__pyx_n_s_LN; -static PyObject *__pyx_n_s_LOG10; -static PyObject *__pyx_n_s_MA; -static PyObject *__pyx_n_s_MACD; -static PyObject *__pyx_n_s_MACDEXT; -static PyObject *__pyx_n_s_MACDFIX; -static PyObject *__pyx_n_s_MAMA; -static PyObject *__pyx_n_s_MAVP; -static PyObject *__pyx_n_s_MAX; -static PyObject *__pyx_n_s_MAXINDEX; -static PyObject *__pyx_n_s_MEDPRICE; -static PyObject *__pyx_n_s_MFI; -static PyObject *__pyx_n_s_MIDPOINT; -static PyObject *__pyx_n_s_MIDPRICE; -static PyObject *__pyx_n_s_MIN; -static PyObject *__pyx_n_s_MININDEX; -static PyObject *__pyx_n_s_MINMAX; -static PyObject *__pyx_n_s_MINMAXINDEX; -static PyObject *__pyx_n_s_MINUS_DI; -static PyObject *__pyx_n_s_MINUS_DM; -static PyObject *__pyx_n_s_MOM; -static PyObject *__pyx_n_s_MULT; -static PyObject *__pyx_n_s_NATR; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_OBV; -static PyObject *__pyx_n_s_PLUS_DI; -static PyObject *__pyx_n_s_PLUS_DM; -static PyObject *__pyx_n_s_PPO; -static PyObject *__pyx_n_s_ROC; -static PyObject *__pyx_n_s_ROCP; -static PyObject *__pyx_n_s_ROCR; -static PyObject *__pyx_n_s_ROCR100; -static PyObject *__pyx_n_s_RSI; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_SAR; -static PyObject *__pyx_n_s_SAREXT; -static PyObject *__pyx_n_s_SIN; -static PyObject *__pyx_n_s_SINH; -static PyObject *__pyx_n_s_SMA; -static PyObject *__pyx_n_s_SQRT; -static PyObject *__pyx_n_s_STDDEV; -static PyObject *__pyx_n_s_STOCH; -static PyObject *__pyx_n_s_STOCHF; -static PyObject *__pyx_n_s_STOCHRSI; -static PyObject *__pyx_n_s_SUB; -static PyObject *__pyx_n_s_SUM; -static PyObject *__pyx_n_s_T3; -static PyObject *__pyx_n_s_TAN; -static PyObject *__pyx_n_s_TANH; -static PyObject *__pyx_n_s_TA_ACOS; -static PyObject *__pyx_n_s_TA_AD; -static PyObject *__pyx_n_s_TA_ADD; -static PyObject *__pyx_n_s_TA_ADOSC; -static PyObject *__pyx_n_s_TA_ADX; -static PyObject *__pyx_n_s_TA_ADXR; -static PyObject *__pyx_n_s_TA_APO; -static PyObject *__pyx_n_s_TA_AROON; -static PyObject *__pyx_n_s_TA_AROONOSC; -static PyObject *__pyx_n_s_TA_ASIN; -static PyObject *__pyx_n_s_TA_ATAN; -static PyObject *__pyx_n_s_TA_ATR; -static PyObject *__pyx_n_s_TA_AVGPRICE; -static PyObject *__pyx_n_s_TA_BBANDS; -static PyObject *__pyx_n_s_TA_BETA; -static PyObject *__pyx_n_s_TA_BOP; -static PyObject *__pyx_n_s_TA_CCI; -static PyObject *__pyx_n_s_TA_CDL2CROWS; -static PyObject *__pyx_n_s_TA_CDL3BLACKCROWS; -static PyObject *__pyx_n_s_TA_CDL3INSIDE; -static PyObject *__pyx_n_s_TA_CDL3LINESTRIKE; -static PyObject *__pyx_n_s_TA_CDL3OUTSIDE; -static PyObject *__pyx_n_s_TA_CDL3STARSINSOUTH; -static PyObject *__pyx_n_s_TA_CDL3WHITESOLDIERS; -static PyObject *__pyx_n_s_TA_CDLABANDONEDBABY; -static PyObject *__pyx_n_s_TA_CDLADVANCEBLOCK; -static PyObject *__pyx_n_s_TA_CDLBELTHOLD; -static PyObject *__pyx_n_s_TA_CDLBREAKAWAY; -static PyObject *__pyx_n_s_TA_CDLCLOSINGMARUBOZU; -static PyObject *__pyx_n_s_TA_CDLCONCEALBABYSWALL; -static PyObject *__pyx_n_s_TA_CDLCOUNTERATTACK; -static PyObject *__pyx_n_s_TA_CDLDARKCLOUDCOVER; -static PyObject *__pyx_n_s_TA_CDLDOJI; -static PyObject *__pyx_n_s_TA_CDLDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLDRAGONFLYDOJI; -static PyObject *__pyx_n_s_TA_CDLENGULFING; -static PyObject *__pyx_n_s_TA_CDLEVENINGDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLEVENINGSTAR; -static PyObject *__pyx_n_s_TA_CDLGAPSIDESIDEWHITE; -static PyObject *__pyx_n_s_TA_CDLGRAVESTONEDOJI; -static PyObject *__pyx_n_s_TA_CDLHAMMER; -static PyObject *__pyx_n_s_TA_CDLHANGINGMAN; -static PyObject *__pyx_n_s_TA_CDLHARAMI; -static PyObject *__pyx_n_s_TA_CDLHARAMICROSS; -static PyObject *__pyx_n_s_TA_CDLHIGHWAVE; -static PyObject *__pyx_n_s_TA_CDLHIKKAKE; -static PyObject *__pyx_n_s_TA_CDLHIKKAKEMOD; -static PyObject *__pyx_n_s_TA_CDLHOMINGPIGEON; -static PyObject *__pyx_n_s_TA_CDLIDENTICAL3CROWS; -static PyObject *__pyx_n_s_TA_CDLINNECK; -static PyObject *__pyx_n_s_TA_CDLINVERTEDHAMMER; -static PyObject *__pyx_n_s_TA_CDLKICKING; -static PyObject *__pyx_n_s_TA_CDLKICKINGBYLENGTH; -static PyObject *__pyx_n_s_TA_CDLLADDERBOTTOM; -static PyObject *__pyx_n_s_TA_CDLLONGLEGGEDDOJI; -static PyObject *__pyx_n_s_TA_CDLLONGLINE; -static PyObject *__pyx_n_s_TA_CDLMARUBOZU; -static PyObject *__pyx_n_s_TA_CDLMATCHINGLOW; -static PyObject *__pyx_n_s_TA_CDLMATHOLD; -static PyObject *__pyx_n_s_TA_CDLMORNINGDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLMORNINGSTAR; -static PyObject *__pyx_n_s_TA_CDLONNECK; -static PyObject *__pyx_n_s_TA_CDLPIERCING; -static PyObject *__pyx_n_s_TA_CDLRICKSHAWMAN; -static PyObject *__pyx_n_s_TA_CDLRISEFALL3METHODS; -static PyObject *__pyx_n_s_TA_CDLSEPARATINGLINES; -static PyObject *__pyx_n_s_TA_CDLSHOOTINGSTAR; -static PyObject *__pyx_n_s_TA_CDLSHORTLINE; -static PyObject *__pyx_n_s_TA_CDLSPINNINGTOP; -static PyObject *__pyx_n_s_TA_CDLSTALLEDPATTERN; -static PyObject *__pyx_n_s_TA_CDLSTICKSANDWICH; -static PyObject *__pyx_n_s_TA_CDLTAKURI; -static PyObject *__pyx_n_s_TA_CDLTASUKIGAP; -static PyObject *__pyx_n_s_TA_CDLTHRUSTING; -static PyObject *__pyx_n_s_TA_CDLTRISTAR; -static PyObject *__pyx_n_s_TA_CDLUNIQUE3RIVER; -static PyObject *__pyx_n_s_TA_CDLUPSIDEGAP2CROWS; -static PyObject *__pyx_n_s_TA_CDLXSIDEGAP3METHODS; -static PyObject *__pyx_n_s_TA_CEIL; -static PyObject *__pyx_n_s_TA_CMO; -static PyObject *__pyx_n_s_TA_CORREL; -static PyObject *__pyx_n_s_TA_COS; -static PyObject *__pyx_n_s_TA_COSH; -static PyObject *__pyx_n_s_TA_DEMA; -static PyObject *__pyx_n_s_TA_DIV; -static PyObject *__pyx_n_s_TA_DX; -static PyObject *__pyx_n_s_TA_EMA; -static PyObject *__pyx_n_s_TA_EXP; -static PyObject *__pyx_n_s_TA_FLOOR; -static PyObject *__pyx_n_s_TA_HT_DCPERIOD; -static PyObject *__pyx_n_s_TA_HT_DCPHASE; -static PyObject *__pyx_n_s_TA_HT_PHASOR; -static PyObject *__pyx_n_s_TA_HT_SINE; -static PyObject *__pyx_n_s_TA_HT_TRENDLINE; -static PyObject *__pyx_n_s_TA_HT_TRENDMODE; -static PyObject *__pyx_n_s_TA_KAMA; -static PyObject *__pyx_n_s_TA_LINEARREG; -static PyObject *__pyx_n_s_TA_LINEARREG_ANGLE; -static PyObject *__pyx_n_s_TA_LINEARREG_INTERCEPT; -static PyObject *__pyx_n_s_TA_LINEARREG_SLOPE; -static PyObject *__pyx_n_s_TA_LN; -static PyObject *__pyx_n_s_TA_LOG10; -static PyObject *__pyx_n_s_TA_MA; -static PyObject *__pyx_n_s_TA_MACD; -static PyObject *__pyx_n_s_TA_MACDEXT; -static PyObject *__pyx_n_s_TA_MACDFIX; -static PyObject *__pyx_n_s_TA_MAMA; -static PyObject *__pyx_n_s_TA_MAVP; -static PyObject *__pyx_n_s_TA_MAX; -static PyObject *__pyx_n_s_TA_MAXINDEX; -static PyObject *__pyx_n_s_TA_MEDPRICE; -static PyObject *__pyx_n_s_TA_MFI; -static PyObject *__pyx_n_s_TA_MIDPOINT; -static PyObject *__pyx_n_s_TA_MIDPRICE; -static PyObject *__pyx_n_s_TA_MIN; -static PyObject *__pyx_n_s_TA_MININDEX; -static PyObject *__pyx_n_s_TA_MINMAX; -static PyObject *__pyx_n_s_TA_MINMAXINDEX; -static PyObject *__pyx_n_s_TA_MINUS_DI; -static PyObject *__pyx_n_s_TA_MINUS_DM; -static PyObject *__pyx_n_s_TA_MOM; -static PyObject *__pyx_n_s_TA_MULT; -static PyObject *__pyx_n_s_TA_NATR; -static PyObject *__pyx_n_s_TA_OBV; -static PyObject *__pyx_n_s_TA_PLUS_DI; -static PyObject *__pyx_n_s_TA_PLUS_DM; -static PyObject *__pyx_n_s_TA_PPO; -static PyObject *__pyx_n_s_TA_ROC; -static PyObject *__pyx_n_s_TA_ROCP; -static PyObject *__pyx_n_s_TA_ROCR; -static PyObject *__pyx_n_s_TA_ROCR100; -static PyObject *__pyx_n_s_TA_RSI; -static PyObject *__pyx_n_s_TA_SAR; -static PyObject *__pyx_n_s_TA_SAREXT; -static PyObject *__pyx_n_s_TA_SIN; -static PyObject *__pyx_n_s_TA_SINH; -static PyObject *__pyx_n_s_TA_SMA; -static PyObject *__pyx_n_s_TA_SQRT; -static PyObject *__pyx_n_s_TA_STDDEV; -static PyObject *__pyx_n_s_TA_STOCH; -static PyObject *__pyx_n_s_TA_STOCHF; -static PyObject *__pyx_n_s_TA_STOCHRSI; -static PyObject *__pyx_n_s_TA_SUB; -static PyObject *__pyx_n_s_TA_SUM; -static PyObject *__pyx_n_s_TA_T3; -static PyObject *__pyx_n_s_TA_TAN; -static PyObject *__pyx_n_s_TA_TANH; -static PyObject *__pyx_n_s_TA_TEMA; -static PyObject *__pyx_n_s_TA_TRANGE; -static PyObject *__pyx_n_s_TA_TRIMA; -static PyObject *__pyx_n_s_TA_TRIX; -static PyObject *__pyx_n_s_TA_TSF; -static PyObject *__pyx_n_s_TA_TYPPRICE; -static PyObject *__pyx_n_s_TA_ULTOSC; -static PyObject *__pyx_n_s_TA_VAR; -static PyObject *__pyx_n_s_TA_WCLPRICE; -static PyObject *__pyx_n_s_TA_WILLR; -static PyObject *__pyx_n_s_TA_WMA; -static PyObject *__pyx_n_s_TEMA; -static PyObject *__pyx_n_s_TRANGE; -static PyObject *__pyx_n_s_TRIMA; -static PyObject *__pyx_n_s_TRIX; -static PyObject *__pyx_n_s_TSF; -static PyObject *__pyx_n_s_TYPPRICE; -static PyObject *__pyx_n_s_ULTOSC; -static PyObject *__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib; -static PyObject *__pyx_n_s_VAR; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_WCLPRICE; -static PyObject *__pyx_n_s_WILLR; -static PyObject *__pyx_n_s_WMA; -static PyObject *__pyx_n_s_acceleration; -static PyObject *__pyx_n_s_accelerationinitlong; -static PyObject *__pyx_n_s_accelerationinitshort; -static PyObject *__pyx_n_s_accelerationlong; -static PyObject *__pyx_n_s_accelerationmaxlong; -static PyObject *__pyx_n_s_accelerationmaxshort; -static PyObject *__pyx_n_s_accelerationshort; -static PyObject *__pyx_n_s_all; -static PyObject *__pyx_n_s_begidx; -static PyObject *__pyx_n_s_close; -static PyObject *__pyx_n_s_close_data; -static PyObject *__pyx_kp_s_close_has_wrong_dimensions; -static PyObject *__pyx_kp_s_close_is_not_double; -static PyObject *__pyx_n_s_endidx; -static PyObject *__pyx_n_s_fastd_matype; -static PyObject *__pyx_n_s_fastd_period; -static PyObject *__pyx_n_s_fastk_period; -static PyObject *__pyx_n_s_fastlimit; -static PyObject *__pyx_n_s_fastmatype; -static PyObject *__pyx_n_s_fastperiod; -static PyObject *__pyx_n_s_high; -static PyObject *__pyx_n_s_high_data; -static PyObject *__pyx_kp_s_high_has_wrong_dimensions; -static PyObject *__pyx_kp_s_high_is_not_double; -static PyObject *__pyx_n_s_i; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_kp_s_input_lengths_are_different; -static PyObject *__pyx_kp_s_inputs_are_all_NaN; -static PyObject *__pyx_n_s_length; -static PyObject *__pyx_n_s_lookback; -static PyObject *__pyx_n_s_low; -static PyObject *__pyx_n_s_low_data; -static PyObject *__pyx_kp_s_low_has_wrong_dimensions; -static PyObject *__pyx_kp_s_low_is_not_double; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_matype; -static PyObject *__pyx_n_s_maximum; -static PyObject *__pyx_n_s_maxperiod; -static PyObject *__pyx_n_s_minperiod; -static PyObject *__pyx_n_s_nan; -static PyObject *__pyx_n_s_nbdev; -static PyObject *__pyx_n_s_nbdevdn; -static PyObject *__pyx_n_s_nbdevup; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_offsetonreverse; -static PyObject *__pyx_n_s_open; -static PyObject *__pyx_n_s_open_data; -static PyObject *__pyx_kp_s_open_has_wrong_dimensions; -static PyObject *__pyx_kp_s_open_is_not_double; -static PyObject *__pyx_n_s_outaroondown; -static PyObject *__pyx_n_s_outaroondown_data; -static PyObject *__pyx_n_s_outaroonup; -static PyObject *__pyx_n_s_outaroonup_data; -static PyObject *__pyx_n_s_outbegidx; -static PyObject *__pyx_n_s_outfama; -static PyObject *__pyx_n_s_outfama_data; -static PyObject *__pyx_n_s_outfastd; -static PyObject *__pyx_n_s_outfastd_data; -static PyObject *__pyx_n_s_outfastk; -static PyObject *__pyx_n_s_outfastk_data; -static PyObject *__pyx_n_s_outinphase; -static PyObject *__pyx_n_s_outinphase_data; -static PyObject *__pyx_n_s_outinteger; -static PyObject *__pyx_n_s_outinteger_data; -static PyObject *__pyx_n_s_outleadsine; -static PyObject *__pyx_n_s_outleadsine_data; -static PyObject *__pyx_n_s_outmacd; -static PyObject *__pyx_n_s_outmacd_data; -static PyObject *__pyx_n_s_outmacdhist; -static PyObject *__pyx_n_s_outmacdhist_data; -static PyObject *__pyx_n_s_outmacdsignal; -static PyObject *__pyx_n_s_outmacdsignal_data; -static PyObject *__pyx_n_s_outmama; -static PyObject *__pyx_n_s_outmama_data; -static PyObject *__pyx_n_s_outmax; -static PyObject *__pyx_n_s_outmax_data; -static PyObject *__pyx_n_s_outmaxidx; -static PyObject *__pyx_n_s_outmaxidx_data; -static PyObject *__pyx_n_s_outmin; -static PyObject *__pyx_n_s_outmin_data; -static PyObject *__pyx_n_s_outminidx; -static PyObject *__pyx_n_s_outminidx_data; -static PyObject *__pyx_n_s_outnbelement; -static PyObject *__pyx_n_s_outquadrature; -static PyObject *__pyx_n_s_outquadrature_data; -static PyObject *__pyx_n_s_outreal; -static PyObject *__pyx_n_s_outreal_data; -static PyObject *__pyx_n_s_outreallowerband; -static PyObject *__pyx_n_s_outreallowerband_data; -static PyObject *__pyx_n_s_outrealmiddleband; -static PyObject *__pyx_n_s_outrealmiddleband_data; -static PyObject *__pyx_n_s_outrealupperband; -static PyObject *__pyx_n_s_outrealupperband_data; -static PyObject *__pyx_n_s_outsine; -static PyObject *__pyx_n_s_outsine_data; -static PyObject *__pyx_n_s_outslowd; -static PyObject *__pyx_n_s_outslowd_data; -static PyObject *__pyx_n_s_outslowk; -static PyObject *__pyx_n_s_outslowk_data; -static PyObject *__pyx_n_s_penetration; -static PyObject *__pyx_n_s_periods; -static PyObject *__pyx_n_s_periods_data; -static PyObject *__pyx_kp_s_periods_has_wrong_dimensions; -static PyObject *__pyx_kp_s_periods_is_not_double; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_real; -static PyObject *__pyx_n_s_real0; -static PyObject *__pyx_n_s_real0_data; -static PyObject *__pyx_kp_s_real0_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real0_is_not_double; -static PyObject *__pyx_n_s_real1; -static PyObject *__pyx_n_s_real1_data; -static PyObject *__pyx_kp_s_real1_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real1_is_not_double; -static PyObject *__pyx_n_s_real_data; -static PyObject *__pyx_kp_s_real_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real_is_not_double; -static PyObject *__pyx_n_s_retCode; -static PyObject *__pyx_n_s_signalmatype; -static PyObject *__pyx_n_s_signalperiod; -static PyObject *__pyx_n_s_slowd_matype; -static PyObject *__pyx_n_s_slowd_period; -static PyObject *__pyx_n_s_slowk_matype; -static PyObject *__pyx_n_s_slowk_period; -static PyObject *__pyx_n_s_slowlimit; -static PyObject *__pyx_n_s_slowmatype; -static PyObject *__pyx_n_s_slowperiod; -static PyObject *__pyx_n_s_startvalue; -static PyObject *__pyx_n_s_talib_func; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_timeperiod; -static PyObject *__pyx_n_s_timeperiod1; -static PyObject *__pyx_n_s_timeperiod2; -static PyObject *__pyx_n_s_timeperiod3; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_val; -static PyObject *__pyx_n_s_vfactor; -static PyObject *__pyx_n_s_volume; -static PyObject *__pyx_n_s_volume_data; -static PyObject *__pyx_kp_s_volume_has_wrong_dimensions; -static PyObject *__pyx_kp_s_volume_is_not_double; -static PyObject *__pyx_pf_5talib_4func_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_2AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume); /* proto */ -static PyObject *__pyx_pf_5talib_4func_4ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_4func_6ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_8ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_10ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_12APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_14AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_16AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_18ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_20ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_22ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_24AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_26BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_28BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_30BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_32CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_34CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_36CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_38CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_40CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_42CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_44CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_46CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_48CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_50CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_52CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_54CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_56CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_58CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_60CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_62CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_64CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_66CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_68CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_70CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_72CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_74CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_76CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_78CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_80CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_82CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_84CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_86CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_88CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_90CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_92CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_94CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_96CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_98CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_100CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_102CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_104CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_106CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_108CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_110CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_112CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_114CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_116CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_118CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_120CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_4func_122CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_124CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_126CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_128CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_130CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_132CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_134CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_136CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_138CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_140CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_142CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_144CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_146CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_148CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_150CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_152CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_154CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_156CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_158CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_160CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_162COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_164COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_166DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_168DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_4func_170DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_172EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_174EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_176FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_178HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_180HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_182HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_184HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_186HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_188HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_190KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_192LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_194LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_196LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_198LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_200LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_202LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_204MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_206MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_208MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_210MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_212MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit); /* proto */ -static PyObject *__pyx_pf_5talib_4func_214MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_216MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_218MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_220MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low); /* proto */ -static PyObject *__pyx_pf_5talib_4func_222MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_224MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_226MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_228MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_230MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_232MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_234MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_236MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_238MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_240MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_242MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_4func_244NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_246OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume); /* proto */ -static PyObject *__pyx_pf_5talib_4func_248PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_250PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_252PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_254ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_256ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_258ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_260ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_262RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_264SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum); /* proto */ -static PyObject *__pyx_pf_5talib_4func_266SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort); /* proto */ -static PyObject *__pyx_pf_5talib_4func_268SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_270SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_272SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_274SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_276STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ -static PyObject *__pyx_pf_5talib_4func_278STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_280STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_282STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_4func_284SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_4func_286SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_288T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor); /* proto */ -static PyObject *__pyx_pf_5talib_4func_290TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_292TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_4func_294TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_296TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_298TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_300TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_302TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_304TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_306ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3); /* proto */ -static PyObject *__pyx_pf_5talib_4func_308VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ -static PyObject *__pyx_pf_5talib_4func_310WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_4func_312WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_4func_314WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; -static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__15; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__17; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__24; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__28; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__30; -static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__33; -static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__35; -static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__37; -static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__39; -static PyObject *__pyx_tuple__40; -static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__45; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__47; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_tuple__49; -static PyObject *__pyx_tuple__50; -static PyObject *__pyx_tuple__51; -static PyObject *__pyx_tuple__52; -static PyObject *__pyx_tuple__53; -static PyObject *__pyx_tuple__54; -static PyObject *__pyx_tuple__55; -static PyObject *__pyx_tuple__56; -static PyObject *__pyx_tuple__57; -static PyObject *__pyx_tuple__58; -static PyObject *__pyx_tuple__59; -static PyObject *__pyx_tuple__60; -static PyObject *__pyx_tuple__61; -static PyObject *__pyx_tuple__62; -static PyObject *__pyx_tuple__63; -static PyObject *__pyx_tuple__64; -static PyObject *__pyx_tuple__65; -static PyObject *__pyx_tuple__66; -static PyObject *__pyx_tuple__67; -static PyObject *__pyx_tuple__68; -static PyObject *__pyx_tuple__69; -static PyObject *__pyx_tuple__70; -static PyObject *__pyx_tuple__71; -static PyObject *__pyx_tuple__72; -static PyObject *__pyx_tuple__73; -static PyObject *__pyx_tuple__74; -static PyObject *__pyx_tuple__75; -static PyObject *__pyx_tuple__76; -static PyObject *__pyx_tuple__77; -static PyObject *__pyx_tuple__78; -static PyObject *__pyx_tuple__79; -static PyObject *__pyx_tuple__80; -static PyObject *__pyx_tuple__81; -static PyObject *__pyx_tuple__82; -static PyObject *__pyx_tuple__83; -static PyObject *__pyx_tuple__84; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__86; -static PyObject *__pyx_tuple__87; -static PyObject *__pyx_tuple__88; -static PyObject *__pyx_tuple__89; -static PyObject *__pyx_tuple__90; -static PyObject *__pyx_tuple__91; -static PyObject *__pyx_tuple__92; -static PyObject *__pyx_tuple__93; -static PyObject *__pyx_tuple__94; -static PyObject *__pyx_tuple__95; -static PyObject *__pyx_tuple__96; -static PyObject *__pyx_tuple__97; -static PyObject *__pyx_tuple__98; -static PyObject *__pyx_tuple__99; -static PyObject *__pyx_tuple__100; -static PyObject *__pyx_tuple__101; -static PyObject *__pyx_tuple__102; -static PyObject *__pyx_tuple__103; -static PyObject *__pyx_tuple__104; -static PyObject *__pyx_tuple__105; -static PyObject *__pyx_tuple__106; -static PyObject *__pyx_tuple__107; -static PyObject *__pyx_tuple__108; -static PyObject *__pyx_tuple__109; -static PyObject *__pyx_tuple__110; -static PyObject *__pyx_tuple__111; -static PyObject *__pyx_tuple__112; -static PyObject *__pyx_tuple__113; -static PyObject *__pyx_tuple__114; -static PyObject *__pyx_tuple__115; -static PyObject *__pyx_tuple__116; -static PyObject *__pyx_tuple__117; -static PyObject *__pyx_tuple__118; -static PyObject *__pyx_tuple__119; -static PyObject *__pyx_tuple__120; -static PyObject *__pyx_tuple__121; -static PyObject *__pyx_tuple__122; -static PyObject *__pyx_tuple__123; -static PyObject *__pyx_tuple__124; -static PyObject *__pyx_tuple__125; -static PyObject *__pyx_tuple__126; -static PyObject *__pyx_tuple__127; -static PyObject *__pyx_tuple__128; -static PyObject *__pyx_tuple__129; -static PyObject *__pyx_tuple__130; -static PyObject *__pyx_tuple__131; -static PyObject *__pyx_tuple__132; -static PyObject *__pyx_tuple__133; -static PyObject *__pyx_tuple__134; -static PyObject *__pyx_tuple__135; -static PyObject *__pyx_tuple__136; -static PyObject *__pyx_tuple__137; -static PyObject *__pyx_tuple__138; -static PyObject *__pyx_tuple__139; -static PyObject *__pyx_tuple__140; -static PyObject *__pyx_tuple__141; -static PyObject *__pyx_tuple__142; -static PyObject *__pyx_tuple__143; -static PyObject *__pyx_tuple__144; -static PyObject *__pyx_tuple__145; -static PyObject *__pyx_tuple__146; -static PyObject *__pyx_tuple__147; -static PyObject *__pyx_tuple__148; -static PyObject *__pyx_tuple__149; -static PyObject *__pyx_tuple__150; -static PyObject *__pyx_tuple__151; -static PyObject *__pyx_tuple__152; -static PyObject *__pyx_tuple__153; -static PyObject *__pyx_tuple__154; -static PyObject *__pyx_tuple__155; -static PyObject *__pyx_tuple__156; -static PyObject *__pyx_tuple__157; -static PyObject *__pyx_tuple__158; -static PyObject *__pyx_tuple__159; -static PyObject *__pyx_tuple__160; -static PyObject *__pyx_tuple__161; -static PyObject *__pyx_tuple__162; -static PyObject *__pyx_tuple__163; -static PyObject *__pyx_tuple__164; -static PyObject *__pyx_tuple__165; -static PyObject *__pyx_tuple__166; -static PyObject *__pyx_tuple__167; -static PyObject *__pyx_tuple__168; -static PyObject *__pyx_tuple__169; -static PyObject *__pyx_tuple__170; -static PyObject *__pyx_tuple__171; -static PyObject *__pyx_tuple__172; -static PyObject *__pyx_tuple__173; -static PyObject *__pyx_tuple__174; -static PyObject *__pyx_tuple__175; -static PyObject *__pyx_tuple__176; -static PyObject *__pyx_tuple__177; -static PyObject *__pyx_tuple__178; -static PyObject *__pyx_tuple__179; -static PyObject *__pyx_tuple__180; -static PyObject *__pyx_tuple__181; -static PyObject *__pyx_tuple__182; -static PyObject *__pyx_tuple__183; -static PyObject *__pyx_tuple__184; -static PyObject *__pyx_tuple__185; -static PyObject *__pyx_tuple__186; -static PyObject *__pyx_tuple__187; -static PyObject *__pyx_tuple__188; -static PyObject *__pyx_tuple__189; -static PyObject *__pyx_tuple__190; -static PyObject *__pyx_tuple__191; -static PyObject *__pyx_tuple__192; -static PyObject *__pyx_tuple__193; -static PyObject *__pyx_tuple__194; -static PyObject *__pyx_tuple__195; -static PyObject *__pyx_tuple__196; -static PyObject *__pyx_tuple__197; -static PyObject *__pyx_tuple__198; -static PyObject *__pyx_tuple__199; -static PyObject *__pyx_tuple__200; -static PyObject *__pyx_tuple__201; -static PyObject *__pyx_tuple__202; -static PyObject *__pyx_tuple__203; -static PyObject *__pyx_tuple__204; -static PyObject *__pyx_tuple__205; -static PyObject *__pyx_tuple__206; -static PyObject *__pyx_tuple__207; -static PyObject *__pyx_tuple__208; -static PyObject *__pyx_tuple__209; -static PyObject *__pyx_tuple__210; -static PyObject *__pyx_tuple__211; -static PyObject *__pyx_tuple__212; -static PyObject *__pyx_tuple__213; -static PyObject *__pyx_tuple__214; -static PyObject *__pyx_tuple__215; -static PyObject *__pyx_tuple__216; -static PyObject *__pyx_tuple__217; -static PyObject *__pyx_tuple__218; -static PyObject *__pyx_tuple__219; -static PyObject *__pyx_tuple__220; -static PyObject *__pyx_tuple__221; -static PyObject *__pyx_tuple__222; -static PyObject *__pyx_tuple__223; -static PyObject *__pyx_tuple__224; -static PyObject *__pyx_tuple__225; -static PyObject *__pyx_tuple__226; -static PyObject *__pyx_tuple__227; -static PyObject *__pyx_tuple__228; -static PyObject *__pyx_tuple__229; -static PyObject *__pyx_tuple__230; -static PyObject *__pyx_tuple__231; -static PyObject *__pyx_tuple__232; -static PyObject *__pyx_tuple__233; -static PyObject *__pyx_tuple__234; -static PyObject *__pyx_tuple__235; -static PyObject *__pyx_tuple__236; -static PyObject *__pyx_tuple__237; -static PyObject *__pyx_tuple__238; -static PyObject *__pyx_tuple__239; -static PyObject *__pyx_tuple__240; -static PyObject *__pyx_tuple__241; -static PyObject *__pyx_tuple__242; -static PyObject *__pyx_tuple__243; -static PyObject *__pyx_tuple__244; -static PyObject *__pyx_tuple__245; -static PyObject *__pyx_tuple__246; -static PyObject *__pyx_tuple__247; -static PyObject *__pyx_tuple__248; -static PyObject *__pyx_tuple__249; -static PyObject *__pyx_tuple__250; -static PyObject *__pyx_tuple__251; -static PyObject *__pyx_tuple__252; -static PyObject *__pyx_tuple__253; -static PyObject *__pyx_tuple__254; -static PyObject *__pyx_tuple__255; -static PyObject *__pyx_tuple__256; -static PyObject *__pyx_tuple__257; -static PyObject *__pyx_tuple__258; -static PyObject *__pyx_tuple__259; -static PyObject *__pyx_tuple__260; -static PyObject *__pyx_tuple__261; -static PyObject *__pyx_tuple__262; -static PyObject *__pyx_tuple__263; -static PyObject *__pyx_tuple__264; -static PyObject *__pyx_tuple__265; -static PyObject *__pyx_tuple__266; -static PyObject *__pyx_tuple__267; -static PyObject *__pyx_tuple__268; -static PyObject *__pyx_tuple__269; -static PyObject *__pyx_tuple__270; -static PyObject *__pyx_tuple__271; -static PyObject *__pyx_tuple__272; -static PyObject *__pyx_tuple__273; -static PyObject *__pyx_tuple__274; -static PyObject *__pyx_tuple__275; -static PyObject *__pyx_tuple__276; -static PyObject *__pyx_tuple__277; -static PyObject *__pyx_tuple__278; -static PyObject *__pyx_tuple__279; -static PyObject *__pyx_tuple__280; -static PyObject *__pyx_tuple__281; -static PyObject *__pyx_tuple__282; -static PyObject *__pyx_tuple__283; -static PyObject *__pyx_tuple__284; -static PyObject *__pyx_tuple__285; -static PyObject *__pyx_tuple__286; -static PyObject *__pyx_tuple__287; -static PyObject *__pyx_tuple__288; -static PyObject *__pyx_tuple__289; -static PyObject *__pyx_tuple__290; -static PyObject *__pyx_tuple__291; -static PyObject *__pyx_tuple__292; -static PyObject *__pyx_tuple__293; -static PyObject *__pyx_tuple__294; -static PyObject *__pyx_tuple__295; -static PyObject *__pyx_tuple__296; -static PyObject *__pyx_tuple__297; -static PyObject *__pyx_tuple__298; -static PyObject *__pyx_tuple__299; -static PyObject *__pyx_tuple__300; -static PyObject *__pyx_tuple__301; -static PyObject *__pyx_tuple__302; -static PyObject *__pyx_tuple__303; -static PyObject *__pyx_tuple__304; -static PyObject *__pyx_tuple__305; -static PyObject *__pyx_tuple__306; -static PyObject *__pyx_tuple__307; -static PyObject *__pyx_tuple__308; -static PyObject *__pyx_tuple__309; -static PyObject *__pyx_tuple__310; -static PyObject *__pyx_tuple__311; -static PyObject *__pyx_tuple__312; -static PyObject *__pyx_tuple__313; -static PyObject *__pyx_tuple__314; -static PyObject *__pyx_tuple__315; -static PyObject *__pyx_tuple__316; -static PyObject *__pyx_tuple__317; -static PyObject *__pyx_tuple__318; -static PyObject *__pyx_tuple__319; -static PyObject *__pyx_tuple__320; -static PyObject *__pyx_tuple__321; -static PyObject *__pyx_tuple__322; -static PyObject *__pyx_tuple__323; -static PyObject *__pyx_tuple__324; -static PyObject *__pyx_tuple__325; -static PyObject *__pyx_tuple__326; -static PyObject *__pyx_tuple__327; -static PyObject *__pyx_tuple__328; -static PyObject *__pyx_tuple__329; -static PyObject *__pyx_tuple__330; -static PyObject *__pyx_tuple__331; -static PyObject *__pyx_tuple__332; -static PyObject *__pyx_tuple__333; -static PyObject *__pyx_tuple__334; -static PyObject *__pyx_tuple__335; -static PyObject *__pyx_tuple__336; -static PyObject *__pyx_tuple__337; -static PyObject *__pyx_tuple__338; -static PyObject *__pyx_tuple__339; -static PyObject *__pyx_tuple__340; -static PyObject *__pyx_tuple__341; -static PyObject *__pyx_tuple__342; -static PyObject *__pyx_tuple__343; -static PyObject *__pyx_tuple__344; -static PyObject *__pyx_tuple__345; -static PyObject *__pyx_tuple__346; -static PyObject *__pyx_tuple__347; -static PyObject *__pyx_tuple__348; -static PyObject *__pyx_tuple__349; -static PyObject *__pyx_tuple__350; -static PyObject *__pyx_tuple__351; -static PyObject *__pyx_tuple__352; -static PyObject *__pyx_tuple__353; -static PyObject *__pyx_tuple__354; -static PyObject *__pyx_tuple__355; -static PyObject *__pyx_tuple__356; -static PyObject *__pyx_tuple__357; -static PyObject *__pyx_tuple__358; -static PyObject *__pyx_tuple__359; -static PyObject *__pyx_tuple__360; -static PyObject *__pyx_tuple__361; -static PyObject *__pyx_tuple__362; -static PyObject *__pyx_tuple__363; -static PyObject *__pyx_tuple__364; -static PyObject *__pyx_tuple__365; -static PyObject *__pyx_tuple__366; -static PyObject *__pyx_tuple__367; -static PyObject *__pyx_tuple__368; -static PyObject *__pyx_tuple__369; -static PyObject *__pyx_tuple__370; -static PyObject *__pyx_tuple__371; -static PyObject *__pyx_tuple__372; -static PyObject *__pyx_tuple__373; -static PyObject *__pyx_tuple__374; -static PyObject *__pyx_tuple__375; -static PyObject *__pyx_tuple__376; -static PyObject *__pyx_tuple__377; -static PyObject *__pyx_tuple__378; -static PyObject *__pyx_tuple__379; -static PyObject *__pyx_tuple__380; -static PyObject *__pyx_tuple__381; -static PyObject *__pyx_tuple__382; -static PyObject *__pyx_tuple__383; -static PyObject *__pyx_tuple__384; -static PyObject *__pyx_tuple__385; -static PyObject *__pyx_tuple__386; -static PyObject *__pyx_tuple__387; -static PyObject *__pyx_tuple__388; -static PyObject *__pyx_tuple__389; -static PyObject *__pyx_tuple__390; -static PyObject *__pyx_tuple__391; -static PyObject *__pyx_tuple__392; -static PyObject *__pyx_tuple__393; -static PyObject *__pyx_tuple__394; -static PyObject *__pyx_tuple__395; -static PyObject *__pyx_tuple__396; -static PyObject *__pyx_tuple__397; -static PyObject *__pyx_tuple__398; -static PyObject *__pyx_tuple__399; -static PyObject *__pyx_tuple__400; -static PyObject *__pyx_tuple__401; -static PyObject *__pyx_tuple__402; -static PyObject *__pyx_tuple__403; -static PyObject *__pyx_tuple__404; -static PyObject *__pyx_tuple__405; -static PyObject *__pyx_tuple__406; -static PyObject *__pyx_tuple__407; -static PyObject *__pyx_tuple__408; -static PyObject *__pyx_tuple__409; -static PyObject *__pyx_tuple__410; -static PyObject *__pyx_tuple__411; -static PyObject *__pyx_tuple__412; -static PyObject *__pyx_tuple__413; -static PyObject *__pyx_tuple__414; -static PyObject *__pyx_tuple__415; -static PyObject *__pyx_tuple__416; -static PyObject *__pyx_tuple__417; -static PyObject *__pyx_tuple__418; -static PyObject *__pyx_tuple__419; -static PyObject *__pyx_tuple__420; -static PyObject *__pyx_tuple__421; -static PyObject *__pyx_tuple__422; -static PyObject *__pyx_tuple__423; -static PyObject *__pyx_tuple__424; -static PyObject *__pyx_tuple__425; -static PyObject *__pyx_tuple__426; -static PyObject *__pyx_tuple__427; -static PyObject *__pyx_tuple__428; -static PyObject *__pyx_tuple__429; -static PyObject *__pyx_tuple__430; -static PyObject *__pyx_tuple__431; -static PyObject *__pyx_tuple__432; -static PyObject *__pyx_tuple__433; -static PyObject *__pyx_tuple__434; -static PyObject *__pyx_tuple__435; -static PyObject *__pyx_tuple__436; -static PyObject *__pyx_tuple__437; -static PyObject *__pyx_tuple__438; -static PyObject *__pyx_tuple__439; -static PyObject *__pyx_tuple__440; -static PyObject *__pyx_tuple__441; -static PyObject *__pyx_tuple__442; -static PyObject *__pyx_tuple__443; -static PyObject *__pyx_tuple__444; -static PyObject *__pyx_tuple__445; -static PyObject *__pyx_tuple__446; -static PyObject *__pyx_tuple__447; -static PyObject *__pyx_tuple__448; -static PyObject *__pyx_tuple__449; -static PyObject *__pyx_tuple__450; -static PyObject *__pyx_tuple__451; -static PyObject *__pyx_tuple__452; -static PyObject *__pyx_tuple__453; -static PyObject *__pyx_tuple__454; -static PyObject *__pyx_tuple__455; -static PyObject *__pyx_tuple__456; -static PyObject *__pyx_tuple__457; -static PyObject *__pyx_tuple__458; -static PyObject *__pyx_tuple__459; -static PyObject *__pyx_tuple__460; -static PyObject *__pyx_tuple__461; -static PyObject *__pyx_tuple__462; -static PyObject *__pyx_tuple__463; -static PyObject *__pyx_tuple__464; -static PyObject *__pyx_tuple__465; -static PyObject *__pyx_tuple__466; -static PyObject *__pyx_tuple__467; -static PyObject *__pyx_tuple__468; -static PyObject *__pyx_tuple__469; -static PyObject *__pyx_tuple__470; -static PyObject *__pyx_tuple__471; -static PyObject *__pyx_tuple__472; -static PyObject *__pyx_tuple__473; -static PyObject *__pyx_tuple__474; -static PyObject *__pyx_tuple__475; -static PyObject *__pyx_tuple__476; -static PyObject *__pyx_tuple__477; -static PyObject *__pyx_tuple__478; -static PyObject *__pyx_tuple__479; -static PyObject *__pyx_tuple__480; -static PyObject *__pyx_tuple__481; -static PyObject *__pyx_tuple__482; -static PyObject *__pyx_tuple__483; -static PyObject *__pyx_tuple__484; -static PyObject *__pyx_tuple__485; -static PyObject *__pyx_tuple__486; -static PyObject *__pyx_tuple__487; -static PyObject *__pyx_tuple__488; -static PyObject *__pyx_tuple__489; -static PyObject *__pyx_tuple__490; -static PyObject *__pyx_tuple__491; -static PyObject *__pyx_tuple__492; -static PyObject *__pyx_tuple__493; -static PyObject *__pyx_tuple__494; -static PyObject *__pyx_tuple__495; -static PyObject *__pyx_tuple__496; -static PyObject *__pyx_tuple__497; -static PyObject *__pyx_tuple__498; -static PyObject *__pyx_tuple__499; -static PyObject *__pyx_tuple__500; -static PyObject *__pyx_tuple__501; -static PyObject *__pyx_tuple__502; -static PyObject *__pyx_tuple__503; -static PyObject *__pyx_tuple__504; -static PyObject *__pyx_tuple__505; -static PyObject *__pyx_tuple__506; -static PyObject *__pyx_tuple__507; -static PyObject *__pyx_tuple__508; -static PyObject *__pyx_tuple__509; -static PyObject *__pyx_tuple__510; -static PyObject *__pyx_tuple__511; -static PyObject *__pyx_tuple__512; -static PyObject *__pyx_tuple__513; -static PyObject *__pyx_tuple__514; -static PyObject *__pyx_tuple__515; -static PyObject *__pyx_tuple__516; -static PyObject *__pyx_tuple__517; -static PyObject *__pyx_tuple__518; -static PyObject *__pyx_tuple__519; -static PyObject *__pyx_tuple__520; -static PyObject *__pyx_tuple__521; -static PyObject *__pyx_tuple__522; -static PyObject *__pyx_tuple__523; -static PyObject *__pyx_tuple__524; -static PyObject *__pyx_tuple__525; -static PyObject *__pyx_tuple__526; -static PyObject *__pyx_tuple__527; -static PyObject *__pyx_tuple__528; -static PyObject *__pyx_tuple__529; -static PyObject *__pyx_tuple__530; -static PyObject *__pyx_tuple__531; -static PyObject *__pyx_tuple__532; -static PyObject *__pyx_tuple__533; -static PyObject *__pyx_tuple__534; -static PyObject *__pyx_tuple__535; -static PyObject *__pyx_tuple__536; -static PyObject *__pyx_tuple__537; -static PyObject *__pyx_tuple__538; -static PyObject *__pyx_tuple__539; -static PyObject *__pyx_tuple__540; -static PyObject *__pyx_tuple__541; -static PyObject *__pyx_tuple__542; -static PyObject *__pyx_tuple__543; -static PyObject *__pyx_tuple__544; -static PyObject *__pyx_tuple__545; -static PyObject *__pyx_tuple__546; -static PyObject *__pyx_tuple__547; -static PyObject *__pyx_tuple__548; -static PyObject *__pyx_tuple__549; -static PyObject *__pyx_tuple__550; -static PyObject *__pyx_tuple__551; -static PyObject *__pyx_tuple__552; -static PyObject *__pyx_tuple__553; -static PyObject *__pyx_tuple__554; -static PyObject *__pyx_tuple__555; -static PyObject *__pyx_tuple__556; -static PyObject *__pyx_tuple__557; -static PyObject *__pyx_tuple__558; -static PyObject *__pyx_tuple__559; -static PyObject *__pyx_tuple__560; -static PyObject *__pyx_tuple__561; -static PyObject *__pyx_tuple__562; -static PyObject *__pyx_tuple__563; -static PyObject *__pyx_tuple__564; -static PyObject *__pyx_tuple__565; -static PyObject *__pyx_tuple__566; -static PyObject *__pyx_tuple__567; -static PyObject *__pyx_tuple__568; -static PyObject *__pyx_tuple__569; -static PyObject *__pyx_tuple__570; -static PyObject *__pyx_tuple__571; -static PyObject *__pyx_tuple__572; -static PyObject *__pyx_tuple__573; -static PyObject *__pyx_tuple__574; -static PyObject *__pyx_tuple__575; -static PyObject *__pyx_tuple__576; -static PyObject *__pyx_tuple__577; -static PyObject *__pyx_tuple__578; -static PyObject *__pyx_tuple__579; -static PyObject *__pyx_tuple__580; -static PyObject *__pyx_tuple__581; -static PyObject *__pyx_tuple__582; -static PyObject *__pyx_tuple__583; -static PyObject *__pyx_tuple__584; -static PyObject *__pyx_tuple__585; -static PyObject *__pyx_tuple__586; -static PyObject *__pyx_tuple__587; -static PyObject *__pyx_tuple__588; -static PyObject *__pyx_tuple__589; -static PyObject *__pyx_tuple__590; -static PyObject *__pyx_tuple__591; -static PyObject *__pyx_tuple__592; -static PyObject *__pyx_tuple__593; -static PyObject *__pyx_tuple__594; -static PyObject *__pyx_tuple__595; -static PyObject *__pyx_tuple__596; -static PyObject *__pyx_tuple__597; -static PyObject *__pyx_tuple__598; -static PyObject *__pyx_tuple__599; -static PyObject *__pyx_tuple__600; -static PyObject *__pyx_tuple__601; -static PyObject *__pyx_tuple__602; -static PyObject *__pyx_tuple__603; -static PyObject *__pyx_tuple__604; -static PyObject *__pyx_tuple__605; -static PyObject *__pyx_tuple__606; -static PyObject *__pyx_tuple__607; -static PyObject *__pyx_tuple__608; -static PyObject *__pyx_tuple__609; -static PyObject *__pyx_tuple__610; -static PyObject *__pyx_tuple__611; -static PyObject *__pyx_tuple__612; -static PyObject *__pyx_tuple__613; -static PyObject *__pyx_tuple__614; -static PyObject *__pyx_tuple__615; -static PyObject *__pyx_tuple__616; -static PyObject *__pyx_tuple__617; -static PyObject *__pyx_tuple__618; -static PyObject *__pyx_tuple__619; -static PyObject *__pyx_tuple__620; -static PyObject *__pyx_tuple__621; -static PyObject *__pyx_tuple__622; -static PyObject *__pyx_tuple__623; -static PyObject *__pyx_tuple__624; -static PyObject *__pyx_tuple__625; -static PyObject *__pyx_tuple__626; -static PyObject *__pyx_tuple__627; -static PyObject *__pyx_tuple__628; -static PyObject *__pyx_tuple__629; -static PyObject *__pyx_tuple__630; -static PyObject *__pyx_tuple__631; -static PyObject *__pyx_tuple__632; -static PyObject *__pyx_tuple__633; -static PyObject *__pyx_tuple__634; -static PyObject *__pyx_tuple__635; -static PyObject *__pyx_tuple__636; -static PyObject *__pyx_tuple__637; -static PyObject *__pyx_tuple__638; -static PyObject *__pyx_tuple__639; -static PyObject *__pyx_tuple__640; -static PyObject *__pyx_tuple__641; -static PyObject *__pyx_tuple__642; -static PyObject *__pyx_tuple__643; -static PyObject *__pyx_tuple__644; -static PyObject *__pyx_tuple__645; -static PyObject *__pyx_tuple__646; -static PyObject *__pyx_tuple__647; -static PyObject *__pyx_tuple__648; -static PyObject *__pyx_tuple__649; -static PyObject *__pyx_tuple__650; -static PyObject *__pyx_tuple__651; -static PyObject *__pyx_tuple__652; -static PyObject *__pyx_tuple__653; -static PyObject *__pyx_tuple__654; -static PyObject *__pyx_tuple__655; -static PyObject *__pyx_tuple__656; -static PyObject *__pyx_tuple__657; -static PyObject *__pyx_tuple__658; -static PyObject *__pyx_tuple__659; -static PyObject *__pyx_tuple__660; -static PyObject *__pyx_tuple__661; -static PyObject *__pyx_tuple__662; -static PyObject *__pyx_tuple__663; -static PyObject *__pyx_tuple__664; -static PyObject *__pyx_tuple__665; -static PyObject *__pyx_tuple__666; -static PyObject *__pyx_tuple__667; -static PyObject *__pyx_tuple__668; -static PyObject *__pyx_tuple__669; -static PyObject *__pyx_tuple__670; -static PyObject *__pyx_tuple__671; -static PyObject *__pyx_tuple__672; -static PyObject *__pyx_tuple__673; -static PyObject *__pyx_tuple__674; -static PyObject *__pyx_tuple__675; -static PyObject *__pyx_tuple__676; -static PyObject *__pyx_tuple__677; -static PyObject *__pyx_tuple__678; -static PyObject *__pyx_tuple__679; -static PyObject *__pyx_tuple__680; -static PyObject *__pyx_tuple__681; -static PyObject *__pyx_tuple__682; -static PyObject *__pyx_tuple__683; -static PyObject *__pyx_tuple__684; -static PyObject *__pyx_tuple__685; -static PyObject *__pyx_tuple__686; -static PyObject *__pyx_tuple__687; -static PyObject *__pyx_tuple__688; -static PyObject *__pyx_tuple__689; -static PyObject *__pyx_tuple__690; -static PyObject *__pyx_tuple__691; -static PyObject *__pyx_tuple__692; -static PyObject *__pyx_tuple__693; -static PyObject *__pyx_tuple__694; -static PyObject *__pyx_tuple__695; -static PyObject *__pyx_tuple__696; -static PyObject *__pyx_tuple__697; -static PyObject *__pyx_tuple__698; -static PyObject *__pyx_tuple__699; -static PyObject *__pyx_tuple__700; -static PyObject *__pyx_tuple__701; -static PyObject *__pyx_tuple__702; -static PyObject *__pyx_tuple__703; -static PyObject *__pyx_tuple__704; -static PyObject *__pyx_tuple__705; -static PyObject *__pyx_tuple__706; -static PyObject *__pyx_tuple__707; -static PyObject *__pyx_tuple__708; -static PyObject *__pyx_tuple__709; -static PyObject *__pyx_tuple__710; -static PyObject *__pyx_tuple__711; -static PyObject *__pyx_tuple__712; -static PyObject *__pyx_tuple__713; -static PyObject *__pyx_tuple__714; -static PyObject *__pyx_tuple__715; -static PyObject *__pyx_tuple__716; -static PyObject *__pyx_tuple__717; -static PyObject *__pyx_tuple__718; -static PyObject *__pyx_tuple__719; -static PyObject *__pyx_tuple__720; -static PyObject *__pyx_tuple__721; -static PyObject *__pyx_tuple__722; -static PyObject *__pyx_tuple__723; -static PyObject *__pyx_tuple__724; -static PyObject *__pyx_tuple__725; -static PyObject *__pyx_tuple__726; -static PyObject *__pyx_tuple__727; -static PyObject *__pyx_tuple__728; -static PyObject *__pyx_tuple__729; -static PyObject *__pyx_tuple__730; -static PyObject *__pyx_tuple__731; -static PyObject *__pyx_tuple__732; -static PyObject *__pyx_tuple__733; -static PyObject *__pyx_tuple__734; -static PyObject *__pyx_tuple__735; -static PyObject *__pyx_tuple__736; -static PyObject *__pyx_tuple__737; -static PyObject *__pyx_tuple__738; -static PyObject *__pyx_tuple__739; -static PyObject *__pyx_tuple__740; -static PyObject *__pyx_tuple__741; -static PyObject *__pyx_tuple__742; -static PyObject *__pyx_tuple__743; -static PyObject *__pyx_tuple__744; -static PyObject *__pyx_tuple__745; -static PyObject *__pyx_tuple__746; -static PyObject *__pyx_tuple__747; -static PyObject *__pyx_tuple__748; -static PyObject *__pyx_tuple__749; -static PyObject *__pyx_tuple__750; -static PyObject *__pyx_tuple__751; -static PyObject *__pyx_tuple__752; -static PyObject *__pyx_tuple__753; -static PyObject *__pyx_tuple__754; -static PyObject *__pyx_tuple__755; -static PyObject *__pyx_tuple__756; -static PyObject *__pyx_tuple__757; -static PyObject *__pyx_tuple__758; -static PyObject *__pyx_tuple__759; -static PyObject *__pyx_tuple__760; -static PyObject *__pyx_tuple__761; -static PyObject *__pyx_tuple__762; -static PyObject *__pyx_tuple__763; -static PyObject *__pyx_tuple__764; -static PyObject *__pyx_tuple__765; -static PyObject *__pyx_tuple__766; -static PyObject *__pyx_tuple__767; -static PyObject *__pyx_tuple__768; -static PyObject *__pyx_tuple__769; -static PyObject *__pyx_tuple__770; -static PyObject *__pyx_tuple__771; -static PyObject *__pyx_tuple__772; -static PyObject *__pyx_tuple__773; -static PyObject *__pyx_tuple__774; -static PyObject *__pyx_tuple__775; -static PyObject *__pyx_tuple__776; -static PyObject *__pyx_tuple__777; -static PyObject *__pyx_tuple__778; -static PyObject *__pyx_tuple__779; -static PyObject *__pyx_tuple__780; -static PyObject *__pyx_tuple__781; -static PyObject *__pyx_tuple__782; -static PyObject *__pyx_tuple__783; -static PyObject *__pyx_tuple__784; -static PyObject *__pyx_tuple__785; -static PyObject *__pyx_tuple__786; -static PyObject *__pyx_tuple__787; -static PyObject *__pyx_tuple__788; -static PyObject *__pyx_tuple__789; -static PyObject *__pyx_tuple__790; -static PyObject *__pyx_tuple__791; -static PyObject *__pyx_tuple__792; -static PyObject *__pyx_tuple__793; -static PyObject *__pyx_tuple__794; -static PyObject *__pyx_tuple__795; -static PyObject *__pyx_tuple__796; -static PyObject *__pyx_tuple__797; -static PyObject *__pyx_tuple__798; -static PyObject *__pyx_tuple__799; -static PyObject *__pyx_tuple__800; -static PyObject *__pyx_tuple__801; -static PyObject *__pyx_tuple__802; -static PyObject *__pyx_tuple__803; -static PyObject *__pyx_tuple__804; -static PyObject *__pyx_tuple__805; -static PyObject *__pyx_tuple__806; -static PyObject *__pyx_tuple__807; -static PyObject *__pyx_tuple__808; -static PyObject *__pyx_tuple__809; -static PyObject *__pyx_tuple__810; -static PyObject *__pyx_tuple__811; -static PyObject *__pyx_tuple__812; -static PyObject *__pyx_tuple__813; -static PyObject *__pyx_tuple__814; -static PyObject *__pyx_tuple__815; -static PyObject *__pyx_tuple__816; -static PyObject *__pyx_tuple__817; -static PyObject *__pyx_tuple__818; -static PyObject *__pyx_tuple__819; -static PyObject *__pyx_tuple__820; -static PyObject *__pyx_tuple__821; -static PyObject *__pyx_tuple__822; -static PyObject *__pyx_tuple__823; -static PyObject *__pyx_tuple__824; -static PyObject *__pyx_tuple__825; -static PyObject *__pyx_tuple__826; -static PyObject *__pyx_tuple__827; -static PyObject *__pyx_tuple__828; -static PyObject *__pyx_tuple__829; -static PyObject *__pyx_tuple__830; -static PyObject *__pyx_tuple__831; -static PyObject *__pyx_tuple__832; -static PyObject *__pyx_tuple__833; -static PyObject *__pyx_tuple__834; -static PyObject *__pyx_tuple__835; -static PyObject *__pyx_tuple__836; -static PyObject *__pyx_tuple__837; -static PyObject *__pyx_tuple__838; -static PyObject *__pyx_tuple__839; -static PyObject *__pyx_tuple__840; -static PyObject *__pyx_tuple__841; -static PyObject *__pyx_tuple__842; -static PyObject *__pyx_tuple__843; -static PyObject *__pyx_tuple__844; -static PyObject *__pyx_tuple__845; -static PyObject *__pyx_tuple__846; -static PyObject *__pyx_tuple__847; -static PyObject *__pyx_tuple__848; -static PyObject *__pyx_tuple__849; -static PyObject *__pyx_tuple__850; -static PyObject *__pyx_tuple__851; -static PyObject *__pyx_tuple__852; -static PyObject *__pyx_tuple__853; -static PyObject *__pyx_tuple__854; -static PyObject *__pyx_tuple__855; -static PyObject *__pyx_tuple__856; -static PyObject *__pyx_tuple__857; -static PyObject *__pyx_tuple__858; -static PyObject *__pyx_tuple__859; -static PyObject *__pyx_tuple__860; -static PyObject *__pyx_tuple__861; -static PyObject *__pyx_tuple__862; -static PyObject *__pyx_tuple__863; -static PyObject *__pyx_tuple__864; -static PyObject *__pyx_tuple__865; -static PyObject *__pyx_tuple__866; -static PyObject *__pyx_tuple__867; -static PyObject *__pyx_tuple__868; -static PyObject *__pyx_tuple__869; -static PyObject *__pyx_tuple__870; -static PyObject *__pyx_tuple__871; -static PyObject *__pyx_tuple__872; -static PyObject *__pyx_tuple__873; -static PyObject *__pyx_tuple__874; -static PyObject *__pyx_tuple__875; -static PyObject *__pyx_tuple__876; -static PyObject *__pyx_tuple__877; -static PyObject *__pyx_tuple__878; -static PyObject *__pyx_tuple__879; -static PyObject *__pyx_tuple__880; -static PyObject *__pyx_tuple__881; -static PyObject *__pyx_tuple__882; -static PyObject *__pyx_tuple__883; -static PyObject *__pyx_tuple__884; -static PyObject *__pyx_tuple__885; -static PyObject *__pyx_tuple__886; -static PyObject *__pyx_tuple__887; -static PyObject *__pyx_tuple__888; -static PyObject *__pyx_tuple__889; -static PyObject *__pyx_tuple__890; -static PyObject *__pyx_tuple__891; -static PyObject *__pyx_tuple__892; -static PyObject *__pyx_tuple__893; -static PyObject *__pyx_tuple__894; -static PyObject *__pyx_tuple__895; -static PyObject *__pyx_tuple__896; -static PyObject *__pyx_tuple__897; -static PyObject *__pyx_tuple__898; -static PyObject *__pyx_tuple__899; -static PyObject *__pyx_tuple__900; -static PyObject *__pyx_tuple__901; -static PyObject *__pyx_tuple__902; -static PyObject *__pyx_tuple__903; -static PyObject *__pyx_tuple__904; -static PyObject *__pyx_tuple__905; -static PyObject *__pyx_tuple__906; -static PyObject *__pyx_tuple__907; -static PyObject *__pyx_tuple__908; -static PyObject *__pyx_tuple__909; -static PyObject *__pyx_tuple__910; -static PyObject *__pyx_tuple__911; -static PyObject *__pyx_tuple__912; -static PyObject *__pyx_tuple__913; -static PyObject *__pyx_tuple__914; -static PyObject *__pyx_tuple__915; -static PyObject *__pyx_tuple__916; -static PyObject *__pyx_tuple__917; -static PyObject *__pyx_tuple__918; -static PyObject *__pyx_tuple__919; -static PyObject *__pyx_tuple__920; -static PyObject *__pyx_tuple__921; -static PyObject *__pyx_tuple__922; -static PyObject *__pyx_tuple__923; -static PyObject *__pyx_tuple__924; -static PyObject *__pyx_tuple__925; -static PyObject *__pyx_tuple__926; -static PyObject *__pyx_tuple__927; -static PyObject *__pyx_tuple__928; -static PyObject *__pyx_tuple__929; -static PyObject *__pyx_tuple__930; -static PyObject *__pyx_tuple__931; -static PyObject *__pyx_tuple__932; -static PyObject *__pyx_tuple__933; -static PyObject *__pyx_tuple__934; -static PyObject *__pyx_tuple__935; -static PyObject *__pyx_tuple__936; -static PyObject *__pyx_tuple__937; -static PyObject *__pyx_tuple__938; -static PyObject *__pyx_tuple__939; -static PyObject *__pyx_tuple__940; -static PyObject *__pyx_tuple__941; -static PyObject *__pyx_tuple__942; -static PyObject *__pyx_tuple__943; -static PyObject *__pyx_tuple__944; -static PyObject *__pyx_tuple__945; -static PyObject *__pyx_tuple__946; -static PyObject *__pyx_tuple__947; -static PyObject *__pyx_tuple__948; -static PyObject *__pyx_tuple__949; -static PyObject *__pyx_tuple__950; -static PyObject *__pyx_tuple__951; -static PyObject *__pyx_tuple__952; -static PyObject *__pyx_tuple__953; -static PyObject *__pyx_tuple__954; -static PyObject *__pyx_tuple__955; -static PyObject *__pyx_tuple__956; -static PyObject *__pyx_tuple__957; -static PyObject *__pyx_tuple__958; -static PyObject *__pyx_tuple__959; -static PyObject *__pyx_tuple__960; -static PyObject *__pyx_tuple__961; -static PyObject *__pyx_tuple__962; -static PyObject *__pyx_tuple__963; -static PyObject *__pyx_tuple__964; -static PyObject *__pyx_tuple__965; -static PyObject *__pyx_tuple__966; -static PyObject *__pyx_tuple__967; -static PyObject *__pyx_tuple__968; -static PyObject *__pyx_tuple__969; -static PyObject *__pyx_tuple__970; -static PyObject *__pyx_tuple__971; -static PyObject *__pyx_tuple__972; -static PyObject *__pyx_tuple__973; -static PyObject *__pyx_tuple__974; -static PyObject *__pyx_tuple__975; -static PyObject *__pyx_tuple__976; -static PyObject *__pyx_tuple__977; -static PyObject *__pyx_tuple__978; -static PyObject *__pyx_tuple__979; -static PyObject *__pyx_tuple__980; -static PyObject *__pyx_tuple__981; -static PyObject *__pyx_tuple__982; -static PyObject *__pyx_tuple__983; -static PyObject *__pyx_tuple__984; -static PyObject *__pyx_tuple__985; -static PyObject *__pyx_tuple__986; -static PyObject *__pyx_tuple__987; -static PyObject *__pyx_tuple__988; -static PyObject *__pyx_tuple__989; -static PyObject *__pyx_tuple__990; -static PyObject *__pyx_tuple__991; -static PyObject *__pyx_tuple__992; -static PyObject *__pyx_tuple__993; -static PyObject *__pyx_tuple__994; -static PyObject *__pyx_tuple__995; -static PyObject *__pyx_tuple__996; -static PyObject *__pyx_tuple__997; -static PyObject *__pyx_tuple__998; -static PyObject *__pyx_tuple__999; -static PyObject *__pyx_tuple__1000; -static PyObject *__pyx_tuple__1001; -static PyObject *__pyx_tuple__1002; -static PyObject *__pyx_tuple__1003; -static PyObject *__pyx_tuple__1004; -static PyObject *__pyx_tuple__1005; -static PyObject *__pyx_tuple__1006; -static PyObject *__pyx_tuple__1007; -static PyObject *__pyx_tuple__1008; -static PyObject *__pyx_tuple__1009; -static PyObject *__pyx_tuple__1010; -static PyObject *__pyx_tuple__1011; -static PyObject *__pyx_tuple__1012; -static PyObject *__pyx_tuple__1013; -static PyObject *__pyx_tuple__1014; -static PyObject *__pyx_tuple__1015; -static PyObject *__pyx_tuple__1016; -static PyObject *__pyx_tuple__1017; -static PyObject *__pyx_tuple__1018; -static PyObject *__pyx_tuple__1019; -static PyObject *__pyx_tuple__1020; -static PyObject *__pyx_tuple__1021; -static PyObject *__pyx_tuple__1022; -static PyObject *__pyx_tuple__1023; -static PyObject *__pyx_tuple__1024; -static PyObject *__pyx_tuple__1025; -static PyObject *__pyx_tuple__1026; -static PyObject *__pyx_tuple__1027; -static PyObject *__pyx_tuple__1028; -static PyObject *__pyx_tuple__1029; -static PyObject *__pyx_tuple__1030; -static PyObject *__pyx_tuple__1031; -static PyObject *__pyx_tuple__1032; -static PyObject *__pyx_tuple__1033; -static PyObject *__pyx_tuple__1034; -static PyObject *__pyx_tuple__1035; -static PyObject *__pyx_tuple__1036; -static PyObject *__pyx_tuple__1037; -static PyObject *__pyx_tuple__1038; -static PyObject *__pyx_tuple__1039; -static PyObject *__pyx_tuple__1040; -static PyObject *__pyx_tuple__1041; -static PyObject *__pyx_tuple__1042; -static PyObject *__pyx_tuple__1043; -static PyObject *__pyx_tuple__1044; -static PyObject *__pyx_tuple__1045; -static PyObject *__pyx_tuple__1046; -static PyObject *__pyx_tuple__1047; -static PyObject *__pyx_tuple__1048; -static PyObject *__pyx_tuple__1049; -static PyObject *__pyx_tuple__1050; -static PyObject *__pyx_tuple__1051; -static PyObject *__pyx_tuple__1052; -static PyObject *__pyx_tuple__1053; -static PyObject *__pyx_tuple__1054; -static PyObject *__pyx_tuple__1055; -static PyObject *__pyx_tuple__1056; -static PyObject *__pyx_tuple__1057; -static PyObject *__pyx_tuple__1058; -static PyObject *__pyx_tuple__1059; -static PyObject *__pyx_tuple__1060; -static PyObject *__pyx_tuple__1061; -static PyObject *__pyx_tuple__1062; -static PyObject *__pyx_tuple__1063; -static PyObject *__pyx_tuple__1064; -static PyObject *__pyx_tuple__1065; -static PyObject *__pyx_tuple__1066; -static PyObject *__pyx_tuple__1067; -static PyObject *__pyx_tuple__1068; -static PyObject *__pyx_tuple__1069; -static PyObject *__pyx_tuple__1070; -static PyObject *__pyx_tuple__1071; -static PyObject *__pyx_tuple__1072; -static PyObject *__pyx_tuple__1073; -static PyObject *__pyx_tuple__1074; -static PyObject *__pyx_tuple__1075; -static PyObject *__pyx_tuple__1076; -static PyObject *__pyx_tuple__1077; -static PyObject *__pyx_tuple__1078; -static PyObject *__pyx_tuple__1079; -static PyObject *__pyx_tuple__1080; -static PyObject *__pyx_tuple__1081; -static PyObject *__pyx_tuple__1082; -static PyObject *__pyx_tuple__1083; -static PyObject *__pyx_tuple__1084; -static PyObject *__pyx_tuple__1085; -static PyObject *__pyx_tuple__1086; -static PyObject *__pyx_tuple__1087; -static PyObject *__pyx_tuple__1088; -static PyObject *__pyx_tuple__1089; -static PyObject *__pyx_tuple__1090; -static PyObject *__pyx_tuple__1091; -static PyObject *__pyx_tuple__1092; -static PyObject *__pyx_tuple__1093; -static PyObject *__pyx_tuple__1094; -static PyObject *__pyx_tuple__1095; -static PyObject *__pyx_tuple__1096; -static PyObject *__pyx_tuple__1097; -static PyObject *__pyx_tuple__1098; -static PyObject *__pyx_tuple__1099; -static PyObject *__pyx_tuple__1100; -static PyObject *__pyx_tuple__1101; -static PyObject *__pyx_tuple__1102; -static PyObject *__pyx_tuple__1103; -static PyObject *__pyx_tuple__1104; -static PyObject *__pyx_tuple__1105; -static PyObject *__pyx_tuple__1106; -static PyObject *__pyx_tuple__1107; -static PyObject *__pyx_tuple__1108; -static PyObject *__pyx_tuple__1109; -static PyObject *__pyx_tuple__1110; -static PyObject *__pyx_tuple__1111; -static PyObject *__pyx_tuple__1112; -static PyObject *__pyx_tuple__1113; -static PyObject *__pyx_tuple__1114; -static PyObject *__pyx_tuple__1115; -static PyObject *__pyx_tuple__1116; -static PyObject *__pyx_tuple__1117; -static PyObject *__pyx_tuple__1118; -static PyObject *__pyx_tuple__1119; -static PyObject *__pyx_tuple__1120; -static PyObject *__pyx_tuple__1121; -static PyObject *__pyx_tuple__1122; -static PyObject *__pyx_tuple__1123; -static PyObject *__pyx_tuple__1124; -static PyObject *__pyx_tuple__1125; -static PyObject *__pyx_tuple__1126; -static PyObject *__pyx_tuple__1127; -static PyObject *__pyx_tuple__1128; -static PyObject *__pyx_tuple__1129; -static PyObject *__pyx_tuple__1130; -static PyObject *__pyx_tuple__1131; -static PyObject *__pyx_tuple__1132; -static PyObject *__pyx_tuple__1133; -static PyObject *__pyx_tuple__1134; -static PyObject *__pyx_tuple__1135; -static PyObject *__pyx_tuple__1136; -static PyObject *__pyx_tuple__1137; -static PyObject *__pyx_tuple__1138; -static PyObject *__pyx_tuple__1139; -static PyObject *__pyx_tuple__1140; -static PyObject *__pyx_tuple__1141; -static PyObject *__pyx_tuple__1142; -static PyObject *__pyx_tuple__1143; -static PyObject *__pyx_tuple__1144; -static PyObject *__pyx_tuple__1145; -static PyObject *__pyx_tuple__1146; -static PyObject *__pyx_tuple__1147; -static PyObject *__pyx_tuple__1148; -static PyObject *__pyx_tuple__1149; -static PyObject *__pyx_tuple__1150; -static PyObject *__pyx_tuple__1151; -static PyObject *__pyx_tuple__1152; -static PyObject *__pyx_tuple__1153; -static PyObject *__pyx_tuple__1154; -static PyObject *__pyx_tuple__1155; -static PyObject *__pyx_tuple__1156; -static PyObject *__pyx_tuple__1157; -static PyObject *__pyx_tuple__1158; -static PyObject *__pyx_tuple__1159; -static PyObject *__pyx_tuple__1160; -static PyObject *__pyx_tuple__1161; -static PyObject *__pyx_tuple__1162; -static PyObject *__pyx_tuple__1163; -static PyObject *__pyx_tuple__1164; -static PyObject *__pyx_tuple__1165; -static PyObject *__pyx_tuple__1166; -static PyObject *__pyx_tuple__1167; -static PyObject *__pyx_tuple__1168; -static PyObject *__pyx_tuple__1169; -static PyObject *__pyx_tuple__1170; -static PyObject *__pyx_tuple__1171; -static PyObject *__pyx_tuple__1172; -static PyObject *__pyx_tuple__1173; -static PyObject *__pyx_tuple__1174; -static PyObject *__pyx_tuple__1175; -static PyObject *__pyx_tuple__1176; -static PyObject *__pyx_tuple__1177; -static PyObject *__pyx_tuple__1178; -static PyObject *__pyx_tuple__1179; -static PyObject *__pyx_tuple__1180; -static PyObject *__pyx_tuple__1181; -static PyObject *__pyx_tuple__1182; -static PyObject *__pyx_tuple__1183; -static PyObject *__pyx_tuple__1184; -static PyObject *__pyx_tuple__1185; -static PyObject *__pyx_tuple__1186; -static PyObject *__pyx_tuple__1187; -static PyObject *__pyx_tuple__1188; -static PyObject *__pyx_tuple__1189; -static PyObject *__pyx_tuple__1190; -static PyObject *__pyx_tuple__1191; -static PyObject *__pyx_tuple__1192; -static PyObject *__pyx_tuple__1193; -static PyObject *__pyx_tuple__1194; -static PyObject *__pyx_tuple__1195; -static PyObject *__pyx_tuple__1196; -static PyObject *__pyx_tuple__1197; -static PyObject *__pyx_tuple__1198; -static PyObject *__pyx_tuple__1199; -static PyObject *__pyx_tuple__1200; -static PyObject *__pyx_tuple__1201; -static PyObject *__pyx_tuple__1202; -static PyObject *__pyx_tuple__1203; -static PyObject *__pyx_tuple__1204; -static PyObject *__pyx_tuple__1205; -static PyObject *__pyx_tuple__1206; -static PyObject *__pyx_tuple__1207; -static PyObject *__pyx_tuple__1208; -static PyObject *__pyx_tuple__1209; -static PyObject *__pyx_tuple__1210; -static PyObject *__pyx_tuple__1211; -static PyObject *__pyx_tuple__1212; -static PyObject *__pyx_tuple__1213; -static PyObject *__pyx_tuple__1215; -static PyObject *__pyx_tuple__1217; -static PyObject *__pyx_tuple__1219; -static PyObject *__pyx_tuple__1221; -static PyObject *__pyx_tuple__1223; -static PyObject *__pyx_tuple__1225; -static PyObject *__pyx_tuple__1227; -static PyObject *__pyx_tuple__1229; -static PyObject *__pyx_tuple__1231; -static PyObject *__pyx_tuple__1233; -static PyObject *__pyx_tuple__1235; -static PyObject *__pyx_tuple__1237; -static PyObject *__pyx_tuple__1239; -static PyObject *__pyx_tuple__1241; -static PyObject *__pyx_tuple__1243; -static PyObject *__pyx_tuple__1245; -static PyObject *__pyx_tuple__1247; -static PyObject *__pyx_tuple__1249; -static PyObject *__pyx_tuple__1251; -static PyObject *__pyx_tuple__1253; -static PyObject *__pyx_tuple__1255; -static PyObject *__pyx_tuple__1257; -static PyObject *__pyx_tuple__1259; -static PyObject *__pyx_tuple__1261; -static PyObject *__pyx_tuple__1263; -static PyObject *__pyx_tuple__1265; -static PyObject *__pyx_tuple__1267; -static PyObject *__pyx_tuple__1269; -static PyObject *__pyx_tuple__1271; -static PyObject *__pyx_tuple__1273; -static PyObject *__pyx_tuple__1275; -static PyObject *__pyx_tuple__1277; -static PyObject *__pyx_tuple__1279; -static PyObject *__pyx_tuple__1281; -static PyObject *__pyx_tuple__1283; -static PyObject *__pyx_tuple__1285; -static PyObject *__pyx_tuple__1287; -static PyObject *__pyx_tuple__1289; -static PyObject *__pyx_tuple__1291; -static PyObject *__pyx_tuple__1293; -static PyObject *__pyx_tuple__1295; -static PyObject *__pyx_tuple__1297; -static PyObject *__pyx_tuple__1299; -static PyObject *__pyx_tuple__1301; -static PyObject *__pyx_tuple__1303; -static PyObject *__pyx_tuple__1305; -static PyObject *__pyx_tuple__1307; -static PyObject *__pyx_tuple__1309; -static PyObject *__pyx_tuple__1311; -static PyObject *__pyx_tuple__1313; -static PyObject *__pyx_tuple__1315; -static PyObject *__pyx_tuple__1317; -static PyObject *__pyx_tuple__1319; -static PyObject *__pyx_tuple__1321; -static PyObject *__pyx_tuple__1323; -static PyObject *__pyx_tuple__1325; -static PyObject *__pyx_tuple__1327; -static PyObject *__pyx_tuple__1329; -static PyObject *__pyx_tuple__1331; -static PyObject *__pyx_tuple__1333; -static PyObject *__pyx_tuple__1335; -static PyObject *__pyx_tuple__1337; -static PyObject *__pyx_tuple__1339; -static PyObject *__pyx_tuple__1341; -static PyObject *__pyx_tuple__1343; -static PyObject *__pyx_tuple__1345; -static PyObject *__pyx_tuple__1347; -static PyObject *__pyx_tuple__1349; -static PyObject *__pyx_tuple__1351; -static PyObject *__pyx_tuple__1353; -static PyObject *__pyx_tuple__1355; -static PyObject *__pyx_tuple__1357; -static PyObject *__pyx_tuple__1359; -static PyObject *__pyx_tuple__1361; -static PyObject *__pyx_tuple__1363; -static PyObject *__pyx_tuple__1365; -static PyObject *__pyx_tuple__1367; -static PyObject *__pyx_tuple__1369; -static PyObject *__pyx_tuple__1371; -static PyObject *__pyx_tuple__1373; -static PyObject *__pyx_tuple__1375; -static PyObject *__pyx_tuple__1377; -static PyObject *__pyx_tuple__1379; -static PyObject *__pyx_tuple__1381; -static PyObject *__pyx_tuple__1383; -static PyObject *__pyx_tuple__1385; -static PyObject *__pyx_tuple__1387; -static PyObject *__pyx_tuple__1389; -static PyObject *__pyx_tuple__1391; -static PyObject *__pyx_tuple__1393; -static PyObject *__pyx_tuple__1395; -static PyObject *__pyx_tuple__1397; -static PyObject *__pyx_tuple__1399; -static PyObject *__pyx_tuple__1401; -static PyObject *__pyx_tuple__1403; -static PyObject *__pyx_tuple__1405; -static PyObject *__pyx_tuple__1407; -static PyObject *__pyx_tuple__1409; -static PyObject *__pyx_tuple__1411; -static PyObject *__pyx_tuple__1413; -static PyObject *__pyx_tuple__1415; -static PyObject *__pyx_tuple__1417; -static PyObject *__pyx_tuple__1419; -static PyObject *__pyx_tuple__1421; -static PyObject *__pyx_tuple__1423; -static PyObject *__pyx_tuple__1425; -static PyObject *__pyx_tuple__1427; -static PyObject *__pyx_tuple__1429; -static PyObject *__pyx_tuple__1431; -static PyObject *__pyx_tuple__1433; -static PyObject *__pyx_tuple__1435; -static PyObject *__pyx_tuple__1437; -static PyObject *__pyx_tuple__1439; -static PyObject *__pyx_tuple__1441; -static PyObject *__pyx_tuple__1443; -static PyObject *__pyx_tuple__1445; -static PyObject *__pyx_tuple__1447; -static PyObject *__pyx_tuple__1449; -static PyObject *__pyx_tuple__1451; -static PyObject *__pyx_tuple__1453; -static PyObject *__pyx_tuple__1455; -static PyObject *__pyx_tuple__1457; -static PyObject *__pyx_tuple__1459; -static PyObject *__pyx_tuple__1461; -static PyObject *__pyx_tuple__1463; -static PyObject *__pyx_tuple__1465; -static PyObject *__pyx_tuple__1467; -static PyObject *__pyx_tuple__1469; -static PyObject *__pyx_tuple__1471; -static PyObject *__pyx_tuple__1473; -static PyObject *__pyx_tuple__1475; -static PyObject *__pyx_tuple__1477; -static PyObject *__pyx_tuple__1479; -static PyObject *__pyx_tuple__1481; -static PyObject *__pyx_tuple__1483; -static PyObject *__pyx_tuple__1485; -static PyObject *__pyx_tuple__1487; -static PyObject *__pyx_tuple__1489; -static PyObject *__pyx_tuple__1491; -static PyObject *__pyx_tuple__1493; -static PyObject *__pyx_tuple__1495; -static PyObject *__pyx_tuple__1497; -static PyObject *__pyx_tuple__1499; -static PyObject *__pyx_tuple__1501; -static PyObject *__pyx_tuple__1503; -static PyObject *__pyx_tuple__1505; -static PyObject *__pyx_tuple__1507; -static PyObject *__pyx_tuple__1509; -static PyObject *__pyx_tuple__1511; -static PyObject *__pyx_tuple__1513; -static PyObject *__pyx_tuple__1515; -static PyObject *__pyx_tuple__1517; -static PyObject *__pyx_tuple__1519; -static PyObject *__pyx_tuple__1521; -static PyObject *__pyx_tuple__1523; -static PyObject *__pyx_tuple__1525; -static PyObject *__pyx_tuple__1527; -static PyObject *__pyx_codeobj__1214; -static PyObject *__pyx_codeobj__1216; -static PyObject *__pyx_codeobj__1218; -static PyObject *__pyx_codeobj__1220; -static PyObject *__pyx_codeobj__1222; -static PyObject *__pyx_codeobj__1224; -static PyObject *__pyx_codeobj__1226; -static PyObject *__pyx_codeobj__1228; -static PyObject *__pyx_codeobj__1230; -static PyObject *__pyx_codeobj__1232; -static PyObject *__pyx_codeobj__1234; -static PyObject *__pyx_codeobj__1236; -static PyObject *__pyx_codeobj__1238; -static PyObject *__pyx_codeobj__1240; -static PyObject *__pyx_codeobj__1242; -static PyObject *__pyx_codeobj__1244; -static PyObject *__pyx_codeobj__1246; -static PyObject *__pyx_codeobj__1248; -static PyObject *__pyx_codeobj__1250; -static PyObject *__pyx_codeobj__1252; -static PyObject *__pyx_codeobj__1254; -static PyObject *__pyx_codeobj__1256; -static PyObject *__pyx_codeobj__1258; -static PyObject *__pyx_codeobj__1260; -static PyObject *__pyx_codeobj__1262; -static PyObject *__pyx_codeobj__1264; -static PyObject *__pyx_codeobj__1266; -static PyObject *__pyx_codeobj__1268; -static PyObject *__pyx_codeobj__1270; -static PyObject *__pyx_codeobj__1272; -static PyObject *__pyx_codeobj__1274; -static PyObject *__pyx_codeobj__1276; -static PyObject *__pyx_codeobj__1278; -static PyObject *__pyx_codeobj__1280; -static PyObject *__pyx_codeobj__1282; -static PyObject *__pyx_codeobj__1284; -static PyObject *__pyx_codeobj__1286; -static PyObject *__pyx_codeobj__1288; -static PyObject *__pyx_codeobj__1290; -static PyObject *__pyx_codeobj__1292; -static PyObject *__pyx_codeobj__1294; -static PyObject *__pyx_codeobj__1296; -static PyObject *__pyx_codeobj__1298; -static PyObject *__pyx_codeobj__1300; -static PyObject *__pyx_codeobj__1302; -static PyObject *__pyx_codeobj__1304; -static PyObject *__pyx_codeobj__1306; -static PyObject *__pyx_codeobj__1308; -static PyObject *__pyx_codeobj__1310; -static PyObject *__pyx_codeobj__1312; -static PyObject *__pyx_codeobj__1314; -static PyObject *__pyx_codeobj__1316; -static PyObject *__pyx_codeobj__1318; -static PyObject *__pyx_codeobj__1320; -static PyObject *__pyx_codeobj__1322; -static PyObject *__pyx_codeobj__1324; -static PyObject *__pyx_codeobj__1326; -static PyObject *__pyx_codeobj__1328; -static PyObject *__pyx_codeobj__1330; -static PyObject *__pyx_codeobj__1332; -static PyObject *__pyx_codeobj__1334; -static PyObject *__pyx_codeobj__1336; -static PyObject *__pyx_codeobj__1338; -static PyObject *__pyx_codeobj__1340; -static PyObject *__pyx_codeobj__1342; -static PyObject *__pyx_codeobj__1344; -static PyObject *__pyx_codeobj__1346; -static PyObject *__pyx_codeobj__1348; -static PyObject *__pyx_codeobj__1350; -static PyObject *__pyx_codeobj__1352; -static PyObject *__pyx_codeobj__1354; -static PyObject *__pyx_codeobj__1356; -static PyObject *__pyx_codeobj__1358; -static PyObject *__pyx_codeobj__1360; -static PyObject *__pyx_codeobj__1362; -static PyObject *__pyx_codeobj__1364; -static PyObject *__pyx_codeobj__1366; -static PyObject *__pyx_codeobj__1368; -static PyObject *__pyx_codeobj__1370; -static PyObject *__pyx_codeobj__1372; -static PyObject *__pyx_codeobj__1374; -static PyObject *__pyx_codeobj__1376; -static PyObject *__pyx_codeobj__1378; -static PyObject *__pyx_codeobj__1380; -static PyObject *__pyx_codeobj__1382; -static PyObject *__pyx_codeobj__1384; -static PyObject *__pyx_codeobj__1386; -static PyObject *__pyx_codeobj__1388; -static PyObject *__pyx_codeobj__1390; -static PyObject *__pyx_codeobj__1392; -static PyObject *__pyx_codeobj__1394; -static PyObject *__pyx_codeobj__1396; -static PyObject *__pyx_codeobj__1398; -static PyObject *__pyx_codeobj__1400; -static PyObject *__pyx_codeobj__1402; -static PyObject *__pyx_codeobj__1404; -static PyObject *__pyx_codeobj__1406; -static PyObject *__pyx_codeobj__1408; -static PyObject *__pyx_codeobj__1410; -static PyObject *__pyx_codeobj__1412; -static PyObject *__pyx_codeobj__1414; -static PyObject *__pyx_codeobj__1416; -static PyObject *__pyx_codeobj__1418; -static PyObject *__pyx_codeobj__1420; -static PyObject *__pyx_codeobj__1422; -static PyObject *__pyx_codeobj__1424; -static PyObject *__pyx_codeobj__1426; -static PyObject *__pyx_codeobj__1428; -static PyObject *__pyx_codeobj__1430; -static PyObject *__pyx_codeobj__1432; -static PyObject *__pyx_codeobj__1434; -static PyObject *__pyx_codeobj__1436; -static PyObject *__pyx_codeobj__1438; -static PyObject *__pyx_codeobj__1440; -static PyObject *__pyx_codeobj__1442; -static PyObject *__pyx_codeobj__1444; -static PyObject *__pyx_codeobj__1446; -static PyObject *__pyx_codeobj__1448; -static PyObject *__pyx_codeobj__1450; -static PyObject *__pyx_codeobj__1452; -static PyObject *__pyx_codeobj__1454; -static PyObject *__pyx_codeobj__1456; -static PyObject *__pyx_codeobj__1458; -static PyObject *__pyx_codeobj__1460; -static PyObject *__pyx_codeobj__1462; -static PyObject *__pyx_codeobj__1464; -static PyObject *__pyx_codeobj__1466; -static PyObject *__pyx_codeobj__1468; -static PyObject *__pyx_codeobj__1470; -static PyObject *__pyx_codeobj__1472; -static PyObject *__pyx_codeobj__1474; -static PyObject *__pyx_codeobj__1476; -static PyObject *__pyx_codeobj__1478; -static PyObject *__pyx_codeobj__1480; -static PyObject *__pyx_codeobj__1482; -static PyObject *__pyx_codeobj__1484; -static PyObject *__pyx_codeobj__1486; -static PyObject *__pyx_codeobj__1488; -static PyObject *__pyx_codeobj__1490; -static PyObject *__pyx_codeobj__1492; -static PyObject *__pyx_codeobj__1494; -static PyObject *__pyx_codeobj__1496; -static PyObject *__pyx_codeobj__1498; -static PyObject *__pyx_codeobj__1500; -static PyObject *__pyx_codeobj__1502; -static PyObject *__pyx_codeobj__1504; -static PyObject *__pyx_codeobj__1506; -static PyObject *__pyx_codeobj__1508; -static PyObject *__pyx_codeobj__1510; -static PyObject *__pyx_codeobj__1512; -static PyObject *__pyx_codeobj__1514; -static PyObject *__pyx_codeobj__1516; -static PyObject *__pyx_codeobj__1518; -static PyObject *__pyx_codeobj__1520; -static PyObject *__pyx_codeobj__1522; -static PyObject *__pyx_codeobj__1524; -static PyObject *__pyx_codeobj__1526; -static PyObject *__pyx_codeobj__1528; - -/* "talib/func.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_1ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_ACOS[] = " ACOS(real)\n\n Vector Trigonometric ACos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_1ACOS = {"ACOS", (PyCFunction)__pyx_pw_5talib_4func_1ACOS, METH_O, __pyx_doc_5talib_4func_ACOS}; -static PyObject *__pyx_pw_5talib_4func_1ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ACOS (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_ACOS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ACOS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":44 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":45 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 45, __pyx_L1_error) - - /* "talib/func.pyx":44 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":46 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":47 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 47, __pyx_L1_error) - - /* "talib/func.pyx":46 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":48 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":49 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":48 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":50 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":51 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":52 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":53 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":54 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":55 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":56 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":55 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":57 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":58 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":60 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ACOS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 60, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":61 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ACOS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":62 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ACOS_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ACOS_Lookback()); - - /* "talib/func.pyx":63 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ACOS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":64 - * lookback = begidx + lib.TA_ACOS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":65 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":66 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ACOS", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":67 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ACOS", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ACOS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":68 - * outreal_data[i] = NaN - * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ACOS", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ACOS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":69 - * retCode = lib.TA_ACOS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ACOS", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ACOS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":73 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_3AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_2AD[] = " AD(high, low, close, volume)\n\n Chaikin A/D Line (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_3AD = {"AD", (PyCFunction)__pyx_pw_5talib_4func_3AD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_2AD}; -static PyObject *__pyx_pw_5talib_4func_3AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 1); __PYX_ERR(0, 73, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 2); __PYX_ERR(0, 73, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 3); __PYX_ERR(0, 73, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AD") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 73, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_2AD(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_2AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("AD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/func.pyx":96 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":97 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 97, __pyx_L1_error) - - /* "talib/func.pyx":96 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":98 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":99 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 99, __pyx_L1_error) - - /* "talib/func.pyx":98 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":100 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":101 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":100 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":102 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":103 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":104 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 104, __pyx_L1_error) - - /* "talib/func.pyx":103 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":105 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":106 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 106, __pyx_L1_error) - - /* "talib/func.pyx":105 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":107 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":108 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":107 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":109 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":110 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":111 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 111, __pyx_L1_error) - - /* "talib/func.pyx":110 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":112 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":113 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 113, __pyx_L1_error) - - /* "talib/func.pyx":112 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":114 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":115 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":114 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":116 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":117 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":118 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 118, __pyx_L1_error) - - /* "talib/func.pyx":117 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/func.pyx":119 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":120 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 120, __pyx_L1_error) - - /* "talib/func.pyx":119 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":121 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":122 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":121 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/func.pyx":123 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/func.pyx":124 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":125 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":126 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 126, __pyx_L1_error) - - /* "talib/func.pyx":125 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":127 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":128 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 128, __pyx_L1_error) - - /* "talib/func.pyx":127 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/func.pyx":129 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":130 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 130, __pyx_L1_error) - - /* "talib/func.pyx":129 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":131 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":132 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":133 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":134 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":135 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":134 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":136 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":137 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":138 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":137 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":139 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":140 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":141 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = volume_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":140 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - } - - /* "talib/func.pyx":142 - * if val != val: - * continue - * val = volume_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); - - /* "talib/func.pyx":143 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":144 - * val = volume_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":143 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":145 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":146 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":148 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AD_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 148, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":149 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_AD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":150 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AD_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_AD_Lookback()); - - /* "talib/func.pyx":151 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 151, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":152 - * lookback = begidx + lib.TA_AD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":153 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":154 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AD", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":155 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AD(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":156 - * outreal_data[i] = NaN - * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":157 - * retCode = lib.TA_AD( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":73 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":161 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_5ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_4ADD[] = " ADD(real0, real1)\n\n Vector Arithmetic Add (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_5ADD = {"ADD", (PyCFunction)__pyx_pw_5talib_4func_5ADD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_4ADD}; -static PyObject *__pyx_pw_5talib_4func_5ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, 1); __PYX_ERR(0, 161, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADD") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 161, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 161, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 161, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_4ADD(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_4ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ADD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":183 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":184 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 184, __pyx_L1_error) - - /* "talib/func.pyx":183 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":185 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":186 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 186, __pyx_L1_error) - - /* "talib/func.pyx":185 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":187 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":188 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":187 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":189 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":190 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":191 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 191, __pyx_L1_error) - - /* "talib/func.pyx":190 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":192 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":193 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 193, __pyx_L1_error) - - /* "talib/func.pyx":192 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":194 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":195 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":194 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":196 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":197 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":198 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":199 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 199, __pyx_L1_error) - - /* "talib/func.pyx":198 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":200 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":201 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":202 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":203 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":204 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":203 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":205 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":206 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":207 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":206 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":208 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":209 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":211 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADD_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 211, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":212 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ADD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":213 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADD_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ADD_Lookback()); - - /* "talib/func.pyx":214 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 214, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":215 - * lookback = begidx + lib.TA_ADD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":216 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":217 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADD", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":218 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADD(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":219 - * outreal_data[i] = NaN - * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":220 - * retCode = lib.TA_ADD( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":161 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":224 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_7ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_6ADOSC[] = " ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?])\n\n Chaikin A/D Oscillator (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n fastperiod: 3\n slowperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_7ADOSC = {"ADOSC", (PyCFunction)__pyx_pw_5talib_4func_7ADOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_6ADOSC}; -static PyObject *__pyx_pw_5talib_4func_7ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 1); __PYX_ERR(0, 224, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 2); __PYX_ERR(0, 224, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 3); __PYX_ERR(0, 224, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADOSC") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 224, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 224, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 224, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 224, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_6ADOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_fastperiod, __pyx_v_slowperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_6ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ADOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/func.pyx":250 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":251 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 251, __pyx_L1_error) - - /* "talib/func.pyx":250 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 253, __pyx_L1_error) - - /* "talib/func.pyx":252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":255 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":256 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 258, __pyx_L1_error) - - /* "talib/func.pyx":257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 260, __pyx_L1_error) - - /* "talib/func.pyx":259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":262 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":263 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 265, __pyx_L1_error) - - /* "talib/func.pyx":264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 267, __pyx_L1_error) - - /* "talib/func.pyx":266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":269 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":270 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":271 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":272 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 272, __pyx_L1_error) - - /* "talib/func.pyx":271 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/func.pyx":273 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":274 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 274, __pyx_L1_error) - - /* "talib/func.pyx":273 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":275 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":276 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":275 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/func.pyx":277 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/func.pyx":278 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":279 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":280 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 280, __pyx_L1_error) - - /* "talib/func.pyx":279 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":281 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":282 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 282, __pyx_L1_error) - - /* "talib/func.pyx":281 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/func.pyx":283 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":284 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 284, __pyx_L1_error) - - /* "talib/func.pyx":283 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":285 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":286 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":287 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":288 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":289 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":288 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":290 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":291 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":292 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":291 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":293 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":294 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":295 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = volume_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":294 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - } - - /* "talib/func.pyx":296 - * if val != val: - * continue - * val = volume_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); - - /* "talib/func.pyx":297 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":298 - * val = volume_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":297 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":299 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":300 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":302 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 302, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":303 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":304 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ADOSC_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod)); - - /* "talib/func.pyx":305 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 305, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":306 - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":307 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":308 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADOSC", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":309 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":310 - * outreal_data[i] = NaN - * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":311 - * retCode = lib.TA_ADOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , fastperiod , slowperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":224 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_9ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_8ADX[] = " ADX(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_9ADX = {"ADX", (PyCFunction)__pyx_pw_5talib_4func_9ADX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_8ADX}; -static PyObject *__pyx_pw_5talib_4func_9ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 1); __PYX_ERR(0, 315, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 2); __PYX_ERR(0, 315, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADX") < 0)) __PYX_ERR(0, 315, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 315, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 315, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 315, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 315, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_8ADX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_8ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ADX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":339 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":340 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 340, __pyx_L1_error) - - /* "talib/func.pyx":339 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":341 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":342 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 342, __pyx_L1_error) - - /* "talib/func.pyx":341 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":343 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":344 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":343 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":345 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":346 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":347 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 347, __pyx_L1_error) - - /* "talib/func.pyx":346 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":348 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":349 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 349, __pyx_L1_error) - - /* "talib/func.pyx":348 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":350 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":351 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":350 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":352 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":353 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":354 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 354, __pyx_L1_error) - - /* "talib/func.pyx":353 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":355 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":356 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 356, __pyx_L1_error) - - /* "talib/func.pyx":355 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":357 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":358 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":357 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":359 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":360 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":361 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":362 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 362, __pyx_L1_error) - - /* "talib/func.pyx":361 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":363 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":364 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 364, __pyx_L1_error) - - /* "talib/func.pyx":363 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":365 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":366 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":367 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":368 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":369 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":368 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":370 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":371 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":372 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":371 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":373 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":374 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":375 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":374 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":376 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":377 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":379 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 379, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":380 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":381 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ADX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":382 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 382, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":383 - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":384 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":385 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADX", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":386 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADX(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":387 - * outreal_data[i] = NaN - * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":388 - * retCode = lib.TA_ADX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":392 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_11ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_10ADXR[] = " ADXR(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index Rating (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_11ADXR = {"ADXR", (PyCFunction)__pyx_pw_5talib_4func_11ADXR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_10ADXR}; -static PyObject *__pyx_pw_5talib_4func_11ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADXR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 1); __PYX_ERR(0, 392, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 2); __PYX_ERR(0, 392, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADXR") < 0)) __PYX_ERR(0, 392, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 392, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_10ADXR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_10ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ADXR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":416 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":417 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 417, __pyx_L1_error) - - /* "talib/func.pyx":416 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":418 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":419 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 419, __pyx_L1_error) - - /* "talib/func.pyx":418 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":420 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":421 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":420 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":422 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":423 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":424 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 424, __pyx_L1_error) - - /* "talib/func.pyx":423 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":425 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":426 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 426, __pyx_L1_error) - - /* "talib/func.pyx":425 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":427 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":428 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":427 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":429 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":430 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":431 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 431, __pyx_L1_error) - - /* "talib/func.pyx":430 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":432 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":433 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 433, __pyx_L1_error) - - /* "talib/func.pyx":432 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":434 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":435 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":434 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":436 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":437 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":438 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":439 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 439, __pyx_L1_error) - - /* "talib/func.pyx":438 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":440 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":441 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 441, __pyx_L1_error) - - /* "talib/func.pyx":440 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":442 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":443 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":444 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":445 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":446 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":445 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":447 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":448 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":449 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":448 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":450 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":451 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":452 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":451 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":453 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":454 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":456 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":457 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":458 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ADXR_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":459 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 459, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":460 - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":461 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":462 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADXR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":463 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADXR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADXR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":464 - * outreal_data[i] = NaN - * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADXR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADXR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":465 - * retCode = lib.TA_ADXR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ADXR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":392 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_13APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_12APO[] = " APO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Absolute Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_13APO = {"APO", (PyCFunction)__pyx_pw_5talib_4func_13APO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_12APO}; -static PyObject *__pyx_pw_5talib_4func_13APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("APO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "APO") < 0)) __PYX_ERR(0, 469, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("APO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 469, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 469, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_12APO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_12APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("APO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":493 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":494 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 494, __pyx_L1_error) - - /* "talib/func.pyx":493 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":495 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":496 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 496, __pyx_L1_error) - - /* "talib/func.pyx":495 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":497 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":498 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 498, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":497 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":499 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":500 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":501 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":502 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":503 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":504 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":505 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":504 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":506 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":507 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":509 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 509, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":510 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":511 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_APO_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype)); - - /* "talib/func.pyx":512 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":513 - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":514 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":515 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_APO", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":516 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_APO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_APO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":517 - * outreal_data[i] = NaN - * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_APO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_APO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":518 - * retCode = lib.TA_APO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_APO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_15AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_14AROON[] = " AROON(high, low[, timeperiod=?])\n\n Aroon (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n aroondown\n aroonup\n "; -static PyMethodDef __pyx_mdef_5talib_4func_15AROON = {"AROON", (PyCFunction)__pyx_pw_5talib_4func_15AROON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_14AROON}; -static PyObject *__pyx_pw_5talib_4func_15AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AROON (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, 1); __PYX_ERR(0, 522, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROON") < 0)) __PYX_ERR(0, 522, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 522, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 522, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 522, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_14AROON(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_14AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outaroondown = 0; - double *__pyx_v_outaroondown_data; - PyArrayObject *__pyx_v_outaroonup = 0; - double *__pyx_v_outaroonup_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("AROON", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":548 - * np.ndarray outaroonup - * double* outaroonup_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":549 - * double* outaroonup_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 549, __pyx_L1_error) - - /* "talib/func.pyx":548 - * np.ndarray outaroonup - * double* outaroonup_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":550 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":551 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 551, __pyx_L1_error) - - /* "talib/func.pyx":550 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":552 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":553 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":552 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":554 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":555 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":556 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 556, __pyx_L1_error) - - /* "talib/func.pyx":555 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":557 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":558 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 558, __pyx_L1_error) - - /* "talib/func.pyx":557 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":559 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":560 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":559 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":561 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":562 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":563 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":564 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 564, __pyx_L1_error) - - /* "talib/func.pyx":563 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":565 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":566 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":567 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":568 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":569 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":568 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":570 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":571 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":572 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":571 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":573 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":574 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":576 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 576, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":577 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) - * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":578 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroondown_data = outaroondown.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_AROON_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":579 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) - * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outaroondown_data = outaroondown.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 579, __pyx_L1_error) - __pyx_v_outaroondown = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":580 - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) - * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroondown_data = outaroondown.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outaroondown_data[i] = NaN - */ - __pyx_v_outaroondown_data = ((double *)__pyx_v_outaroondown->data); - - /* "talib/func.pyx":581 - * outaroondown = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroondown_data = outaroondown.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outaroondown_data[i] = NaN - * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":582 - * outaroondown_data = outaroondown.data - * for i from 0 <= i < min(lookback, length): - * outaroondown_data[i] = NaN # <<<<<<<<<<<<<< - * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroonup_data = outaroonup.data - */ - (__pyx_v_outaroondown_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":583 - * for i from 0 <= i < min(lookback, length): - * outaroondown_data[i] = NaN - * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outaroonup_data = outaroonup.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 583, __pyx_L1_error) - __pyx_v_outaroonup = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":584 - * outaroondown_data[i] = NaN - * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroonup_data = outaroonup.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outaroonup_data[i] = NaN - */ - __pyx_v_outaroonup_data = ((double *)__pyx_v_outaroonup->data); - - /* "talib/func.pyx":585 - * outaroonup = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outaroonup_data = outaroonup.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outaroonup_data[i] = NaN - * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":586 - * outaroonup_data = outaroonup.data - * for i from 0 <= i < min(lookback, length): - * outaroonup_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) - * _ta_check_success("TA_AROON", retCode) - */ - (__pyx_v_outaroonup_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":587 - * for i from 0 <= i < min(lookback, length): - * outaroonup_data[i] = NaN - * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AROON", retCode) - * return outaroondown , outaroonup - */ - __pyx_v_retCode = TA_AROON(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outaroondown_data + __pyx_v_lookback)), ((double *)(__pyx_v_outaroonup_data + __pyx_v_lookback))); - - /* "talib/func.pyx":588 - * outaroonup_data[i] = NaN - * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) - * _ta_check_success("TA_AROON", retCode) # <<<<<<<<<<<<<< - * return outaroondown , outaroonup - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AROON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":589 - * retCode = lib.TA_AROON( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outaroondown_data+lookback) , (outaroonup_data+lookback) ) - * _ta_check_success("TA_AROON", retCode) - * return outaroondown , outaroonup # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outaroondown)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outaroondown)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outaroondown)); - __Pyx_INCREF(((PyObject *)__pyx_v_outaroonup)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outaroonup)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outaroonup)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outaroondown); - __Pyx_XDECREF((PyObject *)__pyx_v_outaroonup); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_17AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_16AROONOSC[] = " AROONOSC(high, low[, timeperiod=?])\n\n Aroon Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_17AROONOSC = {"AROONOSC", (PyCFunction)__pyx_pw_5talib_4func_17AROONOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_16AROONOSC}; -static PyObject *__pyx_pw_5talib_4func_17AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AROONOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, 1); __PYX_ERR(0, 593, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROONOSC") < 0)) __PYX_ERR(0, 593, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 593, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 593, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_16AROONOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_16AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("AROONOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":616 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":617 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 617, __pyx_L1_error) - - /* "talib/func.pyx":616 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":618 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":619 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 619, __pyx_L1_error) - - /* "talib/func.pyx":618 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":620 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":621 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":620 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":622 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":623 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":624 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 624, __pyx_L1_error) - - /* "talib/func.pyx":623 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":625 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":626 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 626, __pyx_L1_error) - - /* "talib/func.pyx":625 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":627 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":628 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":627 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":629 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":630 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":631 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":632 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 632, __pyx_L1_error) - - /* "talib/func.pyx":631 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":633 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":634 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":635 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":636 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":637 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":636 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":638 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":639 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":640 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":639 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":641 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":642 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":644 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 644, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":645 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":646 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_AROONOSC_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":647 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":648 - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":649 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":650 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AROONOSC", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":651 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AROONOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AROONOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":652 - * outreal_data[i] = NaN - * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AROONOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AROONOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":653 - * retCode = lib.TA_AROONOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AROONOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":657 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_19ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_18ASIN[] = " ASIN(real)\n\n Vector Trigonometric ASin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_19ASIN = {"ASIN", (PyCFunction)__pyx_pw_5talib_4func_19ASIN, METH_O, __pyx_doc_5talib_4func_18ASIN}; -static PyObject *__pyx_pw_5talib_4func_19ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ASIN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 657, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_18ASIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_18ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ASIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":677 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":678 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 678, __pyx_L1_error) - - /* "talib/func.pyx":677 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":679 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":680 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 680, __pyx_L1_error) - - /* "talib/func.pyx":679 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":681 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":682 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":681 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":683 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":684 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":685 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":686 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":687 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":688 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":689 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":688 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":690 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":691 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":693 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ASIN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 693, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":694 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ASIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":695 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ASIN_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ASIN_Lookback()); - - /* "talib/func.pyx":696 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ASIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 696, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":697 - * lookback = begidx + lib.TA_ASIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":698 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":699 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ASIN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":700 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ASIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ASIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":701 - * outreal_data[i] = NaN - * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ASIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ASIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":702 - * retCode = lib.TA_ASIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ASIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":657 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ASIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":706 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_21ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_20ATAN[] = " ATAN(real)\n\n Vector Trigonometric ATan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_21ATAN = {"ATAN", (PyCFunction)__pyx_pw_5talib_4func_21ATAN, METH_O, __pyx_doc_5talib_4func_20ATAN}; -static PyObject *__pyx_pw_5talib_4func_21ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ATAN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 706, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_20ATAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_20ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ATAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":726 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":727 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 727, __pyx_L1_error) - - /* "talib/func.pyx":726 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":728 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":729 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 729, __pyx_L1_error) - - /* "talib/func.pyx":728 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":730 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":731 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":730 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":732 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":733 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":734 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":735 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":736 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":737 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":738 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":737 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":739 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":740 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":742 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATAN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 742, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":743 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ATAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":744 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATAN_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ATAN_Lookback()); - - /* "talib/func.pyx":745 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 745, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":746 - * lookback = begidx + lib.TA_ATAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":747 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":748 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATAN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":749 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ATAN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ATAN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":750 - * outreal_data[i] = NaN - * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATAN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ATAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":751 - * retCode = lib.TA_ATAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATAN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":706 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ATAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":755 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_23ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_22ATR[] = " ATR(high, low, close[, timeperiod=?])\n\n Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_23ATR = {"ATR", (PyCFunction)__pyx_pw_5talib_4func_23ATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_22ATR}; -static PyObject *__pyx_pw_5talib_4func_23ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ATR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 1); __PYX_ERR(0, 755, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 2); __PYX_ERR(0, 755, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ATR") < 0)) __PYX_ERR(0, 755, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 755, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 755, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 755, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 755, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_22ATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_22ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ATR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":779 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":780 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 780, __pyx_L1_error) - - /* "talib/func.pyx":779 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":781 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":782 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 782, __pyx_L1_error) - - /* "talib/func.pyx":781 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":783 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":784 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":783 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":785 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":786 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":787 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 787, __pyx_L1_error) - - /* "talib/func.pyx":786 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":788 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":789 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 789, __pyx_L1_error) - - /* "talib/func.pyx":788 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":790 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":791 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":790 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":792 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":793 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":794 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 794, __pyx_L1_error) - - /* "talib/func.pyx":793 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":795 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":796 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 796, __pyx_L1_error) - - /* "talib/func.pyx":795 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":797 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":798 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":797 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":799 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":800 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":801 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":802 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 802, __pyx_L1_error) - - /* "talib/func.pyx":801 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":803 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":804 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 804, __pyx_L1_error) - - /* "talib/func.pyx":803 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":805 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":806 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":807 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":808 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":809 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":808 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":810 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":811 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":812 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":811 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":813 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":814 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":815 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":814 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":816 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":817 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":819 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 819, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":820 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":821 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ATR_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":822 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 822, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":823 - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":824 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":825 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":826 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ATR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ATR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":827 - * outreal_data[i] = NaN - * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":828 - * retCode = lib.TA_ATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ATR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":755 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":832 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_25AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_24AVGPRICE[] = " AVGPRICE(open, high, low, close)\n\n Average Price (Price Transform)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_25AVGPRICE = {"AVGPRICE", (PyCFunction)__pyx_pw_5talib_4func_25AVGPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_24AVGPRICE}; -static PyObject *__pyx_pw_5talib_4func_25AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AVGPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 1); __PYX_ERR(0, 832, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 2); __PYX_ERR(0, 832, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 3); __PYX_ERR(0, 832, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AVGPRICE") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 832, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 832, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 832, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 832, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 832, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_24AVGPRICE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_24AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("AVGPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":855 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":856 - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 856, __pyx_L1_error) - - /* "talib/func.pyx":855 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":857 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":858 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 858, __pyx_L1_error) - - /* "talib/func.pyx":857 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":859 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":860 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 860, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":859 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":861 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":862 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":863 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 863, __pyx_L1_error) - - /* "talib/func.pyx":862 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":864 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":865 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 865, __pyx_L1_error) - - /* "talib/func.pyx":864 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":866 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":867 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":866 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":868 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":869 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":870 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 870, __pyx_L1_error) - - /* "talib/func.pyx":869 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":871 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":872 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 872, __pyx_L1_error) - - /* "talib/func.pyx":871 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":873 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":874 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":873 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":875 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":876 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":877 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 877, __pyx_L1_error) - - /* "talib/func.pyx":876 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":878 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":879 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 879, __pyx_L1_error) - - /* "talib/func.pyx":878 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":880 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":881 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":880 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":882 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":883 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":884 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":885 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 885, __pyx_L1_error) - - /* "talib/func.pyx":884 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":886 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":887 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 887, __pyx_L1_error) - - /* "talib/func.pyx":886 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":888 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":889 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 889, __pyx_L1_error) - - /* "talib/func.pyx":888 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":890 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":891 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":892 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":893 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":894 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":893 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":895 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":896 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":897 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":896 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":898 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":899 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":900 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":899 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":901 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":902 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":903 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":902 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":904 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":905 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":907 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 907, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":908 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":909 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_AVGPRICE_Lookback()); - - /* "talib/func.pyx":910 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 910, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":911 - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":912 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":913 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AVGPRICE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":914 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AVGPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AVGPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":915 - * outreal_data[i] = NaN - * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AVGPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AVGPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":916 - * retCode = lib.TA_AVGPRICE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_AVGPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":832 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":920 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_27BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_26BBANDS[] = " BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?])\n\n Bollinger Bands (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdevup: 2\n nbdevdn: 2\n matype: 0 (Simple Moving Average)\n Outputs:\n upperband\n middleband\n lowerband\n "; -static PyMethodDef __pyx_mdef_5talib_4func_27BBANDS = {"BBANDS", (PyCFunction)__pyx_pw_5talib_4func_27BBANDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_26BBANDS}; -static PyObject *__pyx_pw_5talib_4func_27BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdevup; - double __pyx_v_nbdevdn; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BBANDS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdevup,&__pyx_n_s_nbdevdn,&__pyx_n_s_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevup); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevdn); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BBANDS") < 0)) __PYX_ERR(0, 920, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdevup = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdevup == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) - } else { - __pyx_v_nbdevup = ((double)-4e37); - } - if (values[3]) { - __pyx_v_nbdevdn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_nbdevdn == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) - } else { - __pyx_v_nbdevdn = ((double)-4e37); - } - if (values[4]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BBANDS", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 920, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 920, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_26BBANDS(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_26BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outrealupperband = 0; - double *__pyx_v_outrealupperband_data; - PyArrayObject *__pyx_v_outrealmiddleband = 0; - double *__pyx_v_outrealmiddleband_data; - PyArrayObject *__pyx_v_outreallowerband = 0; - double *__pyx_v_outreallowerband_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("BBANDS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":951 - * np.ndarray outreallowerband - * double* outreallowerband_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":952 - * double* outreallowerband_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 952, __pyx_L1_error) - - /* "talib/func.pyx":951 - * np.ndarray outreallowerband - * double* outreallowerband_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":953 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":954 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 954, __pyx_L1_error) - - /* "talib/func.pyx":953 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":955 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":956 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":955 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":957 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":958 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":959 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":960 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":961 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":962 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":963 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":962 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":964 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":965 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":967 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 967, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":968 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) - * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":969 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) # <<<<<<<<<<<<<< - * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealupperband_data = outrealupperband.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_BBANDS_Lookback(__pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype)); - - /* "talib/func.pyx":970 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) - * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outrealupperband_data = outrealupperband.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 970, __pyx_L1_error) - __pyx_v_outrealupperband = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":971 - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) - * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealupperband_data = outrealupperband.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outrealupperband_data[i] = NaN - */ - __pyx_v_outrealupperband_data = ((double *)__pyx_v_outrealupperband->data); - - /* "talib/func.pyx":972 - * outrealupperband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealupperband_data = outrealupperband.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outrealupperband_data[i] = NaN - * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":973 - * outrealupperband_data = outrealupperband.data - * for i from 0 <= i < min(lookback, length): - * outrealupperband_data[i] = NaN # <<<<<<<<<<<<<< - * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealmiddleband_data = outrealmiddleband.data - */ - (__pyx_v_outrealupperband_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":974 - * for i from 0 <= i < min(lookback, length): - * outrealupperband_data[i] = NaN - * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outrealmiddleband_data = outrealmiddleband.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 974, __pyx_L1_error) - __pyx_v_outrealmiddleband = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":975 - * outrealupperband_data[i] = NaN - * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealmiddleband_data = outrealmiddleband.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outrealmiddleband_data[i] = NaN - */ - __pyx_v_outrealmiddleband_data = ((double *)__pyx_v_outrealmiddleband->data); - - /* "talib/func.pyx":976 - * outrealmiddleband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outrealmiddleband_data = outrealmiddleband.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outrealmiddleband_data[i] = NaN - * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":977 - * outrealmiddleband_data = outrealmiddleband.data - * for i from 0 <= i < min(lookback, length): - * outrealmiddleband_data[i] = NaN # <<<<<<<<<<<<<< - * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreallowerband_data = outreallowerband.data - */ - (__pyx_v_outrealmiddleband_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":978 - * for i from 0 <= i < min(lookback, length): - * outrealmiddleband_data[i] = NaN - * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreallowerband_data = outreallowerband.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 978, __pyx_L1_error) - __pyx_v_outreallowerband = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":979 - * outrealmiddleband_data[i] = NaN - * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreallowerband_data = outreallowerband.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreallowerband_data[i] = NaN - */ - __pyx_v_outreallowerband_data = ((double *)__pyx_v_outreallowerband->data); - - /* "talib/func.pyx":980 - * outreallowerband = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreallowerband_data = outreallowerband.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreallowerband_data[i] = NaN - * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":981 - * outreallowerband_data = outreallowerband.data - * for i from 0 <= i < min(lookback, length): - * outreallowerband_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) - * _ta_check_success("TA_BBANDS", retCode) - */ - (__pyx_v_outreallowerband_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":982 - * for i from 0 <= i < min(lookback, length): - * outreallowerband_data[i] = NaN - * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BBANDS", retCode) - * return outrealupperband , outrealmiddleband , outreallowerband - */ - __pyx_v_retCode = TA_BBANDS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outrealupperband_data + __pyx_v_lookback)), ((double *)(__pyx_v_outrealmiddleband_data + __pyx_v_lookback)), ((double *)(__pyx_v_outreallowerband_data + __pyx_v_lookback))); - - /* "talib/func.pyx":983 - * outreallowerband_data[i] = NaN - * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) - * _ta_check_success("TA_BBANDS", retCode) # <<<<<<<<<<<<<< - * return outrealupperband , outrealmiddleband , outreallowerband - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BBANDS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":984 - * retCode = lib.TA_BBANDS( 0 , endidx , (real_data+begidx) , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , (outrealupperband_data+lookback) , (outrealmiddleband_data+lookback) , (outreallowerband_data+lookback) ) - * _ta_check_success("TA_BBANDS", retCode) - * return outrealupperband , outrealmiddleband , outreallowerband # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outrealupperband)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outrealupperband)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outrealupperband)); - __Pyx_INCREF(((PyObject *)__pyx_v_outrealmiddleband)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outrealmiddleband)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outrealmiddleband)); - __Pyx_INCREF(((PyObject *)__pyx_v_outreallowerband)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outreallowerband)); - PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outreallowerband)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":920 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outrealupperband); - __Pyx_XDECREF((PyObject *)__pyx_v_outrealmiddleband); - __Pyx_XDECREF((PyObject *)__pyx_v_outreallowerband); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":988 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_29BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_28BETA[] = " BETA(real0, real1[, timeperiod=?])\n\n Beta (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 5\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_29BETA = {"BETA", (PyCFunction)__pyx_pw_5talib_4func_29BETA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_28BETA}; -static PyObject *__pyx_pw_5talib_4func_29BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BETA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, 1); __PYX_ERR(0, 988, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BETA") < 0)) __PYX_ERR(0, 988, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 988, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 988, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 988, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_28BETA(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_28BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("BETA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":1012 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1013 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1013, __pyx_L1_error) - - /* "talib/func.pyx":1012 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":1014 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1015 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1015, __pyx_L1_error) - - /* "talib/func.pyx":1014 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1016 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1017 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1016 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":1018 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":1019 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1020 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1020, __pyx_L1_error) - - /* "talib/func.pyx":1019 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":1021 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1022 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1022, __pyx_L1_error) - - /* "talib/func.pyx":1021 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1023 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1024 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1023 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":1025 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":1026 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":1027 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1028 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1028, __pyx_L1_error) - - /* "talib/func.pyx":1027 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1029 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1030 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1031 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":1032 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1033 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":1032 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":1034 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":1035 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1036 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":1035 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1037 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1038 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1040 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1040, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":1041 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1042 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_BETA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":1043 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1043, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1044 - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":1045 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1046 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BETA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":1047 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BETA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_BETA(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1048 - * outreal_data[i] = NaN - * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BETA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BETA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1049 - * retCode = lib.TA_BETA( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BETA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":988 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_31BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_30BOP[] = " BOP(open, high, low, close)\n\n Balance Of Power (Momentum Indicators)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_31BOP = {"BOP", (PyCFunction)__pyx_pw_5talib_4func_31BOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_30BOP}; -static PyObject *__pyx_pw_5talib_4func_31BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BOP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 1); __PYX_ERR(0, 1053, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 2); __PYX_ERR(0, 1053, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 3); __PYX_ERR(0, 1053, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BOP") < 0)) __PYX_ERR(0, 1053, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1053, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1053, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1053, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1053, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1053, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_30BOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_30BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("BOP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1076 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1077 - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1077, __pyx_L1_error) - - /* "talib/func.pyx":1076 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1078 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1079 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1079, __pyx_L1_error) - - /* "talib/func.pyx":1078 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1080 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1081 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1080 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1082 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1083 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1084 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1084, __pyx_L1_error) - - /* "talib/func.pyx":1083 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1085 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1086 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1086, __pyx_L1_error) - - /* "talib/func.pyx":1085 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1087 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1088 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1087 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1089 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1090 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1091 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1091, __pyx_L1_error) - - /* "talib/func.pyx":1090 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1092 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1093 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1093, __pyx_L1_error) - - /* "talib/func.pyx":1092 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1094 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1095 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1095, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1094 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1096 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1097 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1098 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1098, __pyx_L1_error) - - /* "talib/func.pyx":1097 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1099 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1100 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1100, __pyx_L1_error) - - /* "talib/func.pyx":1099 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1101 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1102 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1102, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1101 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1103 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1104 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1105 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1106 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1106, __pyx_L1_error) - - /* "talib/func.pyx":1105 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1107 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1108 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1108, __pyx_L1_error) - - /* "talib/func.pyx":1107 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1109 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1110 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1110, __pyx_L1_error) - - /* "talib/func.pyx":1109 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1111 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1112 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1113 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1114 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1115 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1114 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1116 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1117 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1118 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1117 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1119 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1120 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1121 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1120 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1122 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1123 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1124 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1123 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1125 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1126 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1128 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BOP_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1128, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1129 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_BOP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1130 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BOP_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_BOP_Lookback()); - - /* "talib/func.pyx":1131 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BOP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1131, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1132 - * lookback = begidx + lib.TA_BOP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":1133 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1134 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BOP", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":1135 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BOP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_BOP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1136 - * outreal_data[i] = NaN - * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BOP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1137 - * retCode = lib.TA_BOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_BOP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":1053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1141 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_33CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_32CCI[] = " CCI(high, low, close[, timeperiod=?])\n\n Commodity Channel Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_33CCI = {"CCI", (PyCFunction)__pyx_pw_5talib_4func_33CCI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_32CCI}; -static PyObject *__pyx_pw_5talib_4func_33CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CCI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 1); __PYX_ERR(0, 1141, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 2); __PYX_ERR(0, 1141, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CCI") < 0)) __PYX_ERR(0, 1141, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1141, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1141, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1141, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_32CCI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_32CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CCI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1165 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1166 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1166, __pyx_L1_error) - - /* "talib/func.pyx":1165 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1167 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1168 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1168, __pyx_L1_error) - - /* "talib/func.pyx":1167 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1169 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1170 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1170, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1169 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1171 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1172 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1173 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1173, __pyx_L1_error) - - /* "talib/func.pyx":1172 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1174 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1175 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1175, __pyx_L1_error) - - /* "talib/func.pyx":1174 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1176 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1177 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1177, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1176 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1178 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1179 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1180 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1180, __pyx_L1_error) - - /* "talib/func.pyx":1179 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1181 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1182 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1182, __pyx_L1_error) - - /* "talib/func.pyx":1181 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1183 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1184 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1183 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1185 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1186 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":1187 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1188 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1188, __pyx_L1_error) - - /* "talib/func.pyx":1187 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1189 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1190 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1190, __pyx_L1_error) - - /* "talib/func.pyx":1189 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1191 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1192 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1193 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1194 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1195 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":1194 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1196 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1197 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1198 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":1197 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1199 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1200 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1201 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":1200 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1202 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1203 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1205 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1205, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":1206 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1207 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CCI_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":1208 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1208, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1209 - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":1210 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1211 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CCI", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":1212 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CCI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CCI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1213 - * outreal_data[i] = NaN - * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CCI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CCI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1214 - * retCode = lib.TA_CCI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CCI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":1141 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_35CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_34CDL2CROWS[] = " CDL2CROWS(open, high, low, close)\n\n Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_35CDL2CROWS = {"CDL2CROWS", (PyCFunction)__pyx_pw_5talib_4func_35CDL2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_34CDL2CROWS}; -static PyObject *__pyx_pw_5talib_4func_35CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL2CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 1); __PYX_ERR(0, 1218, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 2); __PYX_ERR(0, 1218, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 3); __PYX_ERR(0, 1218, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL2CROWS") < 0)) __PYX_ERR(0, 1218, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1218, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_34CDL2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_34CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL2CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1241 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1242 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1242, __pyx_L1_error) - - /* "talib/func.pyx":1241 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1243 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1244 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1244, __pyx_L1_error) - - /* "talib/func.pyx":1243 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1245 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1246 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1245 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1247 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1248 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1249 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1249, __pyx_L1_error) - - /* "talib/func.pyx":1248 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1250 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1251 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1251, __pyx_L1_error) - - /* "talib/func.pyx":1250 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1252 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1253 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1252 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1254 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1255 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1256 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1256, __pyx_L1_error) - - /* "talib/func.pyx":1255 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1257 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1258 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1258, __pyx_L1_error) - - /* "talib/func.pyx":1257 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1259 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1260 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1259 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1261 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1262 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1263 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1263, __pyx_L1_error) - - /* "talib/func.pyx":1262 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1264 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1265 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1265, __pyx_L1_error) - - /* "talib/func.pyx":1264 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1266 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1267 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1267, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1266 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1268 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1269 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1270 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1271 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1271, __pyx_L1_error) - - /* "talib/func.pyx":1270 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1272 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1273 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1273, __pyx_L1_error) - - /* "talib/func.pyx":1272 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1275, __pyx_L1_error) - - /* "talib/func.pyx":1274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1276 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1277 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1278 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1279 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1280 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1279 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1281 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1282 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1283 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1282 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1284 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1285 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1286 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1285 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1287 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1288 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1289 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1288 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1290 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1291 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1293 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1293, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1294 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1295 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL2CROWS_Lookback()); - - /* "talib/func.pyx":1296 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1296, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1297 - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1298 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1299 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL2CROWS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1300 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL2CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL2CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1301 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL2CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1302 - * retCode = lib.TA_CDL2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL2CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_37CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_36CDL3BLACKCROWS[] = " CDL3BLACKCROWS(open, high, low, close)\n\n Three Black Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_37CDL3BLACKCROWS = {"CDL3BLACKCROWS", (PyCFunction)__pyx_pw_5talib_4func_37CDL3BLACKCROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_36CDL3BLACKCROWS}; -static PyObject *__pyx_pw_5talib_4func_37CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3BLACKCROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 1); __PYX_ERR(0, 1306, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 2); __PYX_ERR(0, 1306, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 3); __PYX_ERR(0, 1306, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3BLACKCROWS") < 0)) __PYX_ERR(0, 1306, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1306, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1306, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_36CDL3BLACKCROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_36CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3BLACKCROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1329 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1330 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1330, __pyx_L1_error) - - /* "talib/func.pyx":1329 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1331 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1332 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1332, __pyx_L1_error) - - /* "talib/func.pyx":1331 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1333 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1334 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1334, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1333 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1335 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1336 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1337 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1337, __pyx_L1_error) - - /* "talib/func.pyx":1336 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1338 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1339 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1339, __pyx_L1_error) - - /* "talib/func.pyx":1338 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1340 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1341 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1341, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1340 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1342 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1343 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1344 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1344, __pyx_L1_error) - - /* "talib/func.pyx":1343 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1345 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1346 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1346, __pyx_L1_error) - - /* "talib/func.pyx":1345 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1347 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1348 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1348, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1347 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1349 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1350 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1351 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1351, __pyx_L1_error) - - /* "talib/func.pyx":1350 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1352 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1353 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1353, __pyx_L1_error) - - /* "talib/func.pyx":1352 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1354 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1355 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1355, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1354 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1356 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1357 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1358 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1359 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1359, __pyx_L1_error) - - /* "talib/func.pyx":1358 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1360 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1361 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1361, __pyx_L1_error) - - /* "talib/func.pyx":1360 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1362 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1363 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1363, __pyx_L1_error) - - /* "talib/func.pyx":1362 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1364 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1365 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1366 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1367 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1368 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1367 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1369 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1370 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1371 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1370 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1372 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1373 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1374 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1373 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1375 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1376 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1377 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1376 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1378 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1379 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1381 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1381, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1382 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1383 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3BLACKCROWS_Lookback()); - - /* "talib/func.pyx":1384 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1384, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1385 - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1386 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1387 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1388 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3BLACKCROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1389 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1390 - * retCode = lib.TA_CDL3BLACKCROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_39CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_38CDL3INSIDE[] = " CDL3INSIDE(open, high, low, close)\n\n Three Inside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_39CDL3INSIDE = {"CDL3INSIDE", (PyCFunction)__pyx_pw_5talib_4func_39CDL3INSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_38CDL3INSIDE}; -static PyObject *__pyx_pw_5talib_4func_39CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3INSIDE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 1); __PYX_ERR(0, 1394, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 2); __PYX_ERR(0, 1394, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 3); __PYX_ERR(0, 1394, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3INSIDE") < 0)) __PYX_ERR(0, 1394, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1394, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1394, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_38CDL3INSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_38CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3INSIDE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1417 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1418 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1418, __pyx_L1_error) - - /* "talib/func.pyx":1417 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1419 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1420 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1420, __pyx_L1_error) - - /* "talib/func.pyx":1419 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1421 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1422 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1421 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1423 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1424 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1425 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1425, __pyx_L1_error) - - /* "talib/func.pyx":1424 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1426 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1427 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1427, __pyx_L1_error) - - /* "talib/func.pyx":1426 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1428 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1429 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1429, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1428 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1430 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1431 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1432 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1432, __pyx_L1_error) - - /* "talib/func.pyx":1431 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1433 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1434 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1434, __pyx_L1_error) - - /* "talib/func.pyx":1433 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1435 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1436 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1436, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1435 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1437 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1438 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1439 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1439, __pyx_L1_error) - - /* "talib/func.pyx":1438 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1440 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1441 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1441, __pyx_L1_error) - - /* "talib/func.pyx":1440 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1442 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1443 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1443, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1442 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1444 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1445 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1446 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1447 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1447, __pyx_L1_error) - - /* "talib/func.pyx":1446 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1448 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1449 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1449, __pyx_L1_error) - - /* "talib/func.pyx":1448 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1450 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1451 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1451, __pyx_L1_error) - - /* "talib/func.pyx":1450 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1452 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1453 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1454 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1455 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1456 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1455 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1457 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1458 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1459 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1458 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1460 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1461 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1462 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1461 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1463 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1464 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1465 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1464 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1466 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1467 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1469 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1469, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1470 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1471 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3INSIDE_Lookback()); - - /* "talib/func.pyx":1472 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1472, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1473 - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1474 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1475 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3INSIDE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1476 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3INSIDE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3INSIDE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1477 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3INSIDE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3INSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1478 - * retCode = lib.TA_CDL3INSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3INSIDE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_41CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_40CDL3LINESTRIKE[] = " CDL3LINESTRIKE(open, high, low, close)\n\n Three-Line Strike (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_41CDL3LINESTRIKE = {"CDL3LINESTRIKE", (PyCFunction)__pyx_pw_5talib_4func_41CDL3LINESTRIKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_40CDL3LINESTRIKE}; -static PyObject *__pyx_pw_5talib_4func_41CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3LINESTRIKE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 1); __PYX_ERR(0, 1482, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 2); __PYX_ERR(0, 1482, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 3); __PYX_ERR(0, 1482, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3LINESTRIKE") < 0)) __PYX_ERR(0, 1482, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1482, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1482, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_40CDL3LINESTRIKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_40CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3LINESTRIKE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1505 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1506 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1506, __pyx_L1_error) - - /* "talib/func.pyx":1505 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1507 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1508 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1508, __pyx_L1_error) - - /* "talib/func.pyx":1507 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1509 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1510 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1510, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1509 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1511 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1512 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1513 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1513, __pyx_L1_error) - - /* "talib/func.pyx":1512 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1514 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1515 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1515, __pyx_L1_error) - - /* "talib/func.pyx":1514 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1516 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1517 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1517, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1516 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1518 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1519 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1520 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1520, __pyx_L1_error) - - /* "talib/func.pyx":1519 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1521 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1522 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1522, __pyx_L1_error) - - /* "talib/func.pyx":1521 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1523 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1524 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1523 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1525 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1526 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1527 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1527, __pyx_L1_error) - - /* "talib/func.pyx":1526 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1528 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1529 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1529, __pyx_L1_error) - - /* "talib/func.pyx":1528 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1530 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1531 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1531, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1530 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1532 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1533 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1534 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1535 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1535, __pyx_L1_error) - - /* "talib/func.pyx":1534 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1536 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1537 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1537, __pyx_L1_error) - - /* "talib/func.pyx":1536 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1538 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1539 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1539, __pyx_L1_error) - - /* "talib/func.pyx":1538 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1540 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1541 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1542 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1543 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1544 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1543 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1545 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1546 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1547 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1546 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1548 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1549 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1550 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1549 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1551 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1552 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1553 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1552 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1554 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1555 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1557 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1557, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1558 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1559 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3LINESTRIKE_Lookback()); - - /* "talib/func.pyx":1560 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1560, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1561 - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1562 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1563 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1564 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3LINESTRIKE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1565 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1566 - * retCode = lib.TA_CDL3LINESTRIKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_43CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_42CDL3OUTSIDE[] = " CDL3OUTSIDE(open, high, low, close)\n\n Three Outside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_43CDL3OUTSIDE = {"CDL3OUTSIDE", (PyCFunction)__pyx_pw_5talib_4func_43CDL3OUTSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_42CDL3OUTSIDE}; -static PyObject *__pyx_pw_5talib_4func_43CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3OUTSIDE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 1); __PYX_ERR(0, 1570, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 2); __PYX_ERR(0, 1570, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 3); __PYX_ERR(0, 1570, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3OUTSIDE") < 0)) __PYX_ERR(0, 1570, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1570, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1570, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_42CDL3OUTSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_42CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3OUTSIDE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1593 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1594 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1594, __pyx_L1_error) - - /* "talib/func.pyx":1593 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1595 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1596 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1596, __pyx_L1_error) - - /* "talib/func.pyx":1595 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1597 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1598 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1598, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1597 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1599 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1600 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1601 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1601, __pyx_L1_error) - - /* "talib/func.pyx":1600 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1602 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1603 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1603, __pyx_L1_error) - - /* "talib/func.pyx":1602 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1604 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1605 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1605, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1604 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1606 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1607 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1608 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1608, __pyx_L1_error) - - /* "talib/func.pyx":1607 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1609 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1610 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1610, __pyx_L1_error) - - /* "talib/func.pyx":1609 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1611 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1612 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1611 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1613 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1614 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1615 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1615, __pyx_L1_error) - - /* "talib/func.pyx":1614 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1616 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1617 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1617, __pyx_L1_error) - - /* "talib/func.pyx":1616 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1618 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1619 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1618 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1620 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1621 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1622 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1623 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1623, __pyx_L1_error) - - /* "talib/func.pyx":1622 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1624 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1625 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1625, __pyx_L1_error) - - /* "talib/func.pyx":1624 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1626 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1627 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1627, __pyx_L1_error) - - /* "talib/func.pyx":1626 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1628 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1629 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1630 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1631 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1632 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1631 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1633 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1634 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1635 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1634 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1636 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1637 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1638 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1637 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1639 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1640 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1641 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1640 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1642 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1643 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1645 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1645, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1646 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1647 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3OUTSIDE_Lookback()); - - /* "talib/func.pyx":1648 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1648, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1649 - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1650 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1651 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1652 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3OUTSIDE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1653 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3OUTSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1654 - * retCode = lib.TA_CDL3OUTSIDE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_45CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_44CDL3STARSINSOUTH[] = " CDL3STARSINSOUTH(open, high, low, close)\n\n Three Stars In The South (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_45CDL3STARSINSOUTH = {"CDL3STARSINSOUTH", (PyCFunction)__pyx_pw_5talib_4func_45CDL3STARSINSOUTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_44CDL3STARSINSOUTH}; -static PyObject *__pyx_pw_5talib_4func_45CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3STARSINSOUTH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 1); __PYX_ERR(0, 1658, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 2); __PYX_ERR(0, 1658, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 3); __PYX_ERR(0, 1658, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3STARSINSOUTH") < 0)) __PYX_ERR(0, 1658, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1658, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1658, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_44CDL3STARSINSOUTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_44CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3STARSINSOUTH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1681 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1682 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1682, __pyx_L1_error) - - /* "talib/func.pyx":1681 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1683 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1684 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1684, __pyx_L1_error) - - /* "talib/func.pyx":1683 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1685 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1686 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1686, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1685 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1687 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1688 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1689 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1689, __pyx_L1_error) - - /* "talib/func.pyx":1688 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1690 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1691 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1691, __pyx_L1_error) - - /* "talib/func.pyx":1690 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1692 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1693 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1692 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1694 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1695 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1696 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1696, __pyx_L1_error) - - /* "talib/func.pyx":1695 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1697 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1698 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1698, __pyx_L1_error) - - /* "talib/func.pyx":1697 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1699 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1700 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1700, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1699 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1701 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1702 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1703 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1703, __pyx_L1_error) - - /* "talib/func.pyx":1702 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1704 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1705 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1705, __pyx_L1_error) - - /* "talib/func.pyx":1704 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1706 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1707 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1707, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1706 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1708 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1709 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1710 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1711 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1711, __pyx_L1_error) - - /* "talib/func.pyx":1710 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1712 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1713 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1713, __pyx_L1_error) - - /* "talib/func.pyx":1712 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1714 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1715 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1715, __pyx_L1_error) - - /* "talib/func.pyx":1714 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1716 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1717 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1718 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1719 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1720 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1719 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1721 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1722 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1723 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1722 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1724 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1725 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1726 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1725 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1727 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1728 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1729 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1728 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1730 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1731 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1733 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1733, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1734 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1735 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3STARSINSOUTH_Lookback()); - - /* "talib/func.pyx":1736 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1736, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1737 - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1738 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1739 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1740 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3STARSINSOUTH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1741 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1742 - * retCode = lib.TA_CDL3STARSINSOUTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_47CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_46CDL3WHITESOLDIERS[] = " CDL3WHITESOLDIERS(open, high, low, close)\n\n Three Advancing White Soldiers (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_47CDL3WHITESOLDIERS = {"CDL3WHITESOLDIERS", (PyCFunction)__pyx_pw_5talib_4func_47CDL3WHITESOLDIERS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_46CDL3WHITESOLDIERS}; -static PyObject *__pyx_pw_5talib_4func_47CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 1); __PYX_ERR(0, 1746, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 2); __PYX_ERR(0, 1746, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 3); __PYX_ERR(0, 1746, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3WHITESOLDIERS") < 0)) __PYX_ERR(0, 1746, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1746, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1746, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_46CDL3WHITESOLDIERS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_46CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1769 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1770 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1770, __pyx_L1_error) - - /* "talib/func.pyx":1769 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1771 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1772 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1772, __pyx_L1_error) - - /* "talib/func.pyx":1771 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1773 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1774 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1774, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1773 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1775 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1776 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1777 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1777, __pyx_L1_error) - - /* "talib/func.pyx":1776 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1778 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1779 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1779, __pyx_L1_error) - - /* "talib/func.pyx":1778 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1780 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1781 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1781, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1780 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1782 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1783 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1784 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1784, __pyx_L1_error) - - /* "talib/func.pyx":1783 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1785 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1786 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1786, __pyx_L1_error) - - /* "talib/func.pyx":1785 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1787 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1788 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1788, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1787 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1789 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1790 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1791 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1791, __pyx_L1_error) - - /* "talib/func.pyx":1790 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1792 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1793 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1793, __pyx_L1_error) - - /* "talib/func.pyx":1792 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1794 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1795 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1795, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1794 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1796 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1797 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1798 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1799 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1799, __pyx_L1_error) - - /* "talib/func.pyx":1798 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1800 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1801 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1801, __pyx_L1_error) - - /* "talib/func.pyx":1800 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1802 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1803 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1803, __pyx_L1_error) - - /* "talib/func.pyx":1802 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1804 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1805 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1806 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1807 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1808 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1807 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1809 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1810 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1811 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1810 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1812 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1813 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1814 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1813 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1815 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1816 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1817 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1816 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1818 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1819 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1821 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1821, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1822 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1823 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDL3WHITESOLDIERS_Lookback()); - - /* "talib/func.pyx":1824 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1824, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1825 - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1826 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1827 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1828 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3WHITESOLDIERS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1829 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1830 - * retCode = lib.TA_CDL3WHITESOLDIERS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_49CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_48CDLABANDONEDBABY[] = " CDLABANDONEDBABY(open, high, low, close[, penetration=?])\n\n Abandoned Baby (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_49CDLABANDONEDBABY = {"CDLABANDONEDBABY", (PyCFunction)__pyx_pw_5talib_4func_49CDLABANDONEDBABY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_48CDLABANDONEDBABY}; -static PyObject *__pyx_pw_5talib_4func_49CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLABANDONEDBABY (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 1); __PYX_ERR(0, 1834, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 2); __PYX_ERR(0, 1834, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 3); __PYX_ERR(0, 1834, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLABANDONEDBABY") < 0)) __PYX_ERR(0, 1834, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1834, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1834, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1834, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_48CDLABANDONEDBABY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_48CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLABANDONEDBABY", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1859 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1860 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1860, __pyx_L1_error) - - /* "talib/func.pyx":1859 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1862, __pyx_L1_error) - - /* "talib/func.pyx":1861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1864 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1864, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1865 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1867, __pyx_L1_error) - - /* "talib/func.pyx":1866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1869, __pyx_L1_error) - - /* "talib/func.pyx":1868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1871 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1871, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1872 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1874, __pyx_L1_error) - - /* "talib/func.pyx":1873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1876, __pyx_L1_error) - - /* "talib/func.pyx":1875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1878 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1878, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1879 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1881, __pyx_L1_error) - - /* "talib/func.pyx":1880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1883, __pyx_L1_error) - - /* "talib/func.pyx":1882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1885 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1885, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1886 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1887 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1889, __pyx_L1_error) - - /* "talib/func.pyx":1888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1891, __pyx_L1_error) - - /* "talib/func.pyx":1890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1893, __pyx_L1_error) - - /* "talib/func.pyx":1892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1894 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1895 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1896 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1897 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1898 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1897 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1899 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1900 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1901 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1900 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1902 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1903 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1904 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1903 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1905 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1906 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1907 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1906 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1908 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1909 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1911 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1911, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":1912 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":1913 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLABANDONEDBABY_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":1914 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1914, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1915 - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":1916 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1917 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":1918 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLABANDONEDBABY(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":1919 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":1920 - * retCode = lib.TA_CDLABANDONEDBABY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":1924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_51CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_50CDLADVANCEBLOCK[] = " CDLADVANCEBLOCK(open, high, low, close)\n\n Advance Block (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_51CDLADVANCEBLOCK = {"CDLADVANCEBLOCK", (PyCFunction)__pyx_pw_5talib_4func_51CDLADVANCEBLOCK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_50CDLADVANCEBLOCK}; -static PyObject *__pyx_pw_5talib_4func_51CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLADVANCEBLOCK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 1); __PYX_ERR(0, 1924, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 2); __PYX_ERR(0, 1924, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 3); __PYX_ERR(0, 1924, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLADVANCEBLOCK") < 0)) __PYX_ERR(0, 1924, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1924, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1924, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_50CDLADVANCEBLOCK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_50CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLADVANCEBLOCK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":1947 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1948 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1948, __pyx_L1_error) - - /* "talib/func.pyx":1947 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":1949 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1950 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1950, __pyx_L1_error) - - /* "talib/func.pyx":1949 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1951 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1952 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1952, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1951 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":1953 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":1954 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1955 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1955, __pyx_L1_error) - - /* "talib/func.pyx":1954 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":1956 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1957 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1957, __pyx_L1_error) - - /* "talib/func.pyx":1956 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1958 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1959 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1959, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1958 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":1960 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":1961 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1962 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1962, __pyx_L1_error) - - /* "talib/func.pyx":1961 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":1963 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1964 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1964, __pyx_L1_error) - - /* "talib/func.pyx":1963 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1965 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1966 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1966, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1965 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":1967 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":1968 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1969 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1969, __pyx_L1_error) - - /* "talib/func.pyx":1968 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":1970 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1971 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1971, __pyx_L1_error) - - /* "talib/func.pyx":1970 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":1972 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1973 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1973, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":1972 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":1974 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":1975 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":1976 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1977 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1977, __pyx_L1_error) - - /* "talib/func.pyx":1976 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":1978 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1979 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1979, __pyx_L1_error) - - /* "talib/func.pyx":1978 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":1980 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1981 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1981, __pyx_L1_error) - - /* "talib/func.pyx":1980 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":1982 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":1983 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":1984 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":1985 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1986 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1985 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":1987 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":1988 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1989 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1988 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":1990 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":1991 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1992 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1991 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":1993 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":1994 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":1995 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":1994 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":1996 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":1997 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":1999 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1999, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2000 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2001 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLADVANCEBLOCK_Lookback()); - - /* "talib/func.pyx":2002 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2002, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2003 - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2004 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2005 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2006 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLADVANCEBLOCK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2007 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2008 - * retCode = lib.TA_CDLADVANCEBLOCK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":1924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_53CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_52CDLBELTHOLD[] = " CDLBELTHOLD(open, high, low, close)\n\n Belt-hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_53CDLBELTHOLD = {"CDLBELTHOLD", (PyCFunction)__pyx_pw_5talib_4func_53CDLBELTHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_52CDLBELTHOLD}; -static PyObject *__pyx_pw_5talib_4func_53CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLBELTHOLD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 1); __PYX_ERR(0, 2012, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 2); __PYX_ERR(0, 2012, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 3); __PYX_ERR(0, 2012, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBELTHOLD") < 0)) __PYX_ERR(0, 2012, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2012, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2012, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2012, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2012, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2012, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_52CDLBELTHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_52CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLBELTHOLD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2035 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2036 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2036, __pyx_L1_error) - - /* "talib/func.pyx":2035 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2037 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2038 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2038, __pyx_L1_error) - - /* "talib/func.pyx":2037 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2039 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2040 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2039 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2041 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2042 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2043 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__234, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2043, __pyx_L1_error) - - /* "talib/func.pyx":2042 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2044 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2045 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2045, __pyx_L1_error) - - /* "talib/func.pyx":2044 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2046 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2047 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2047, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2046 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2048 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2049 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2050 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2050, __pyx_L1_error) - - /* "talib/func.pyx":2049 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2051 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2052 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2052, __pyx_L1_error) - - /* "talib/func.pyx":2051 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2053 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2054 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2054, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2053 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2055 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2056 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2057 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2057, __pyx_L1_error) - - /* "talib/func.pyx":2056 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2058 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2059 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2059, __pyx_L1_error) - - /* "talib/func.pyx":2058 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2060 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2061 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2061, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2060 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2062 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2063 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2064 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2065 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__240, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2065, __pyx_L1_error) - - /* "talib/func.pyx":2064 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2066 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2067 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__241, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2067, __pyx_L1_error) - - /* "talib/func.pyx":2066 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2068 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2069 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__242, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2069, __pyx_L1_error) - - /* "talib/func.pyx":2068 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2070 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2071 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2072 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2073 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2074 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2073 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2075 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2076 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2077 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2076 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2078 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2079 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2080 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2079 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2081 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2082 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2083 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2082 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2084 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2085 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2087 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__243, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2087, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2088 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2089 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLBELTHOLD_Lookback()); - - /* "talib/func.pyx":2090 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2090, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2091 - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2092 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2093 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2094 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLBELTHOLD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLBELTHOLD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2095 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLBELTHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2096 - * retCode = lib.TA_CDLBELTHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2100 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_55CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_54CDLBREAKAWAY[] = " CDLBREAKAWAY(open, high, low, close)\n\n Breakaway (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_55CDLBREAKAWAY = {"CDLBREAKAWAY", (PyCFunction)__pyx_pw_5talib_4func_55CDLBREAKAWAY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_54CDLBREAKAWAY}; -static PyObject *__pyx_pw_5talib_4func_55CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLBREAKAWAY (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 1); __PYX_ERR(0, 2100, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 2); __PYX_ERR(0, 2100, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 3); __PYX_ERR(0, 2100, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBREAKAWAY") < 0)) __PYX_ERR(0, 2100, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2100, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2100, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2100, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2100, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2100, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_54CDLBREAKAWAY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_54CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLBREAKAWAY", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2123 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2124 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__244, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2124, __pyx_L1_error) - - /* "talib/func.pyx":2123 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2125 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2126 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__245, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2126, __pyx_L1_error) - - /* "talib/func.pyx":2125 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2127 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2128 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2128, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2127 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2129 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2130 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2131 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__246, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2131, __pyx_L1_error) - - /* "talib/func.pyx":2130 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2132 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2133 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__247, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2133, __pyx_L1_error) - - /* "talib/func.pyx":2132 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2134 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2135 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2135, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2134 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2136 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2137 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2138 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__248, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2138, __pyx_L1_error) - - /* "talib/func.pyx":2137 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2139 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2140 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2140, __pyx_L1_error) - - /* "talib/func.pyx":2139 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2141 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2142 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2142, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2141 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2143 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2144 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2145 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__250, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2145, __pyx_L1_error) - - /* "talib/func.pyx":2144 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2146 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2147 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__251, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2147, __pyx_L1_error) - - /* "talib/func.pyx":2146 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2148 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2149 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2149, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2148 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2150 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2151 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2152 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2153 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__252, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2153, __pyx_L1_error) - - /* "talib/func.pyx":2152 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2154 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2155 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__253, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2155, __pyx_L1_error) - - /* "talib/func.pyx":2154 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2156 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2157 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2157, __pyx_L1_error) - - /* "talib/func.pyx":2156 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2158 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2159 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2160 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2161 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2162 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2161 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2163 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2164 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2165 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2164 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2166 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2167 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2168 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2167 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2169 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2170 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2171 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2170 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2172 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2173 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2175 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2175, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2176 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2177 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLBREAKAWAY_Lookback()); - - /* "talib/func.pyx":2178 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2178, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2179 - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2180 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2181 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2182 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLBREAKAWAY(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2183 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLBREAKAWAY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2184 - * retCode = lib.TA_CDLBREAKAWAY( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2100 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2188 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_57CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_56CDLCLOSINGMARUBOZU[] = " CDLCLOSINGMARUBOZU(open, high, low, close)\n\n Closing Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_57CDLCLOSINGMARUBOZU = {"CDLCLOSINGMARUBOZU", (PyCFunction)__pyx_pw_5talib_4func_57CDLCLOSINGMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_56CDLCLOSINGMARUBOZU}; -static PyObject *__pyx_pw_5talib_4func_57CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 1); __PYX_ERR(0, 2188, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 2); __PYX_ERR(0, 2188, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 3); __PYX_ERR(0, 2188, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCLOSINGMARUBOZU") < 0)) __PYX_ERR(0, 2188, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2188, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2188, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2188, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2188, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2188, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_56CDLCLOSINGMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_56CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2211 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2212 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2212, __pyx_L1_error) - - /* "talib/func.pyx":2211 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2213 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2214 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2214, __pyx_L1_error) - - /* "talib/func.pyx":2213 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2215 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2216 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2215 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2217 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2218 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2219 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2219, __pyx_L1_error) - - /* "talib/func.pyx":2218 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2220 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2221 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2221, __pyx_L1_error) - - /* "talib/func.pyx":2220 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2222 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2223 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2223, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2222 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2224 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2225 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2226 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2226, __pyx_L1_error) - - /* "talib/func.pyx":2225 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2227 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2228 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2228, __pyx_L1_error) - - /* "talib/func.pyx":2227 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2229 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2230 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2230, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2229 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2231 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2232 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2233 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2233, __pyx_L1_error) - - /* "talib/func.pyx":2232 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2234 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2235 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2235, __pyx_L1_error) - - /* "talib/func.pyx":2234 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2236 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2237 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2237, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2236 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2238 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2239 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2240 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2241 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2241, __pyx_L1_error) - - /* "talib/func.pyx":2240 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2242 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2243 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__265, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2243, __pyx_L1_error) - - /* "talib/func.pyx":2242 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2244 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2245 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__266, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2245, __pyx_L1_error) - - /* "talib/func.pyx":2244 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2246 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2247 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2248 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2249 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2250 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2249 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2251 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2252 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2253 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2252 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2254 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2255 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2256 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2255 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2257 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2258 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2259 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2258 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2260 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2261 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2263 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__267, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2263, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2264 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2265 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCLOSINGMARUBOZU_Lookback()); - - /* "talib/func.pyx":2266 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2266, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2267 - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2268 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2269 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2270 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCLOSINGMARUBOZU(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2271 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2272 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2188 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_59CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_58CDLCONCEALBABYSWALL[] = " CDLCONCEALBABYSWALL(open, high, low, close)\n\n Concealing Baby Swallow (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_59CDLCONCEALBABYSWALL = {"CDLCONCEALBABYSWALL", (PyCFunction)__pyx_pw_5talib_4func_59CDLCONCEALBABYSWALL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_58CDLCONCEALBABYSWALL}; -static PyObject *__pyx_pw_5talib_4func_59CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 1); __PYX_ERR(0, 2276, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 2); __PYX_ERR(0, 2276, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 3); __PYX_ERR(0, 2276, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCONCEALBABYSWALL") < 0)) __PYX_ERR(0, 2276, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2276, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2276, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_58CDLCONCEALBABYSWALL(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_58CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2299 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2300 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__268, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2300, __pyx_L1_error) - - /* "talib/func.pyx":2299 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2301 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2302 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__269, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2302, __pyx_L1_error) - - /* "talib/func.pyx":2301 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2303 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2304 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2304, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2303 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2305 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2306 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2307 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__270, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2307, __pyx_L1_error) - - /* "talib/func.pyx":2306 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2308 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2309 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__271, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2309, __pyx_L1_error) - - /* "talib/func.pyx":2308 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2310 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2311 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2311, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2310 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2312 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2313 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2314 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__272, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2314, __pyx_L1_error) - - /* "talib/func.pyx":2313 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2315 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2316 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__273, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2316, __pyx_L1_error) - - /* "talib/func.pyx":2315 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2317 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2318 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2317 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2319 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2320 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2321 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__274, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2321, __pyx_L1_error) - - /* "talib/func.pyx":2320 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2322 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2323 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__275, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2323, __pyx_L1_error) - - /* "talib/func.pyx":2322 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2324 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2325 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2325, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2324 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2326 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2327 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2328 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2329 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__276, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2329, __pyx_L1_error) - - /* "talib/func.pyx":2328 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2330 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2331 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__277, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2331, __pyx_L1_error) - - /* "talib/func.pyx":2330 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2332 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2333 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__278, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2333, __pyx_L1_error) - - /* "talib/func.pyx":2332 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2334 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2335 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2336 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2337 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2338 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2337 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2339 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2340 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2341 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2340 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2342 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2343 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2344 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2343 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2345 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2346 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2347 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2346 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2348 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2349 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2351 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__279, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2351, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2352 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2353 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCONCEALBABYSWALL_Lookback()); - - /* "talib/func.pyx":2354 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2354, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2355 - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2356 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2357 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2358 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCONCEALBABYSWALL(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2359 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2360 - * retCode = lib.TA_CDLCONCEALBABYSWALL( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2364 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_61CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_60CDLCOUNTERATTACK[] = " CDLCOUNTERATTACK(open, high, low, close)\n\n Counterattack (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_61CDLCOUNTERATTACK = {"CDLCOUNTERATTACK", (PyCFunction)__pyx_pw_5talib_4func_61CDLCOUNTERATTACK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_60CDLCOUNTERATTACK}; -static PyObject *__pyx_pw_5talib_4func_61CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCOUNTERATTACK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 1); __PYX_ERR(0, 2364, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 2); __PYX_ERR(0, 2364, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 3); __PYX_ERR(0, 2364, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCOUNTERATTACK") < 0)) __PYX_ERR(0, 2364, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2364, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2364, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2364, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2364, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2364, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_60CDLCOUNTERATTACK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_60CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLCOUNTERATTACK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2387 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2388 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__280, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2388, __pyx_L1_error) - - /* "talib/func.pyx":2387 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2389 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2390 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__281, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2390, __pyx_L1_error) - - /* "talib/func.pyx":2389 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2391 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2392 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2392, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2391 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2393 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2394 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2395 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__282, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2395, __pyx_L1_error) - - /* "talib/func.pyx":2394 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2396 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2397 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__283, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2397, __pyx_L1_error) - - /* "talib/func.pyx":2396 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2398 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2399 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2399, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2398 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2400 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2401 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2402 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2402, __pyx_L1_error) - - /* "talib/func.pyx":2401 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2403 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2404 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__285, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2404, __pyx_L1_error) - - /* "talib/func.pyx":2403 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2405 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2406 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2406, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2405 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2407 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2408 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2409 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__286, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2409, __pyx_L1_error) - - /* "talib/func.pyx":2408 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2410 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2411 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__287, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2411, __pyx_L1_error) - - /* "talib/func.pyx":2410 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2412 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2413 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2412 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2414 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2415 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2416 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2417 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2417, __pyx_L1_error) - - /* "talib/func.pyx":2416 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2418 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2419 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2419, __pyx_L1_error) - - /* "talib/func.pyx":2418 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2420 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2421 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__290, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2421, __pyx_L1_error) - - /* "talib/func.pyx":2420 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2422 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2423 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2424 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2425 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2426 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2425 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2427 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2428 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2429 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2428 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2430 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2431 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2432 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2431 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2433 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2434 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2435 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2434 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2436 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2437 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2439 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2439, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2440 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2441 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLCOUNTERATTACK_Lookback()); - - /* "talib/func.pyx":2442 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2442, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2443 - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2444 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2445 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2446 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCOUNTERATTACK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2447 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2448 - * retCode = lib.TA_CDLCOUNTERATTACK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2364 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2452 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_63CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_62CDLDARKCLOUDCOVER[] = " CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?])\n\n Dark Cloud Cover (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_63CDLDARKCLOUDCOVER = {"CDLDARKCLOUDCOVER", (PyCFunction)__pyx_pw_5talib_4func_63CDLDARKCLOUDCOVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_62CDLDARKCLOUDCOVER}; -static PyObject *__pyx_pw_5talib_4func_63CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 1); __PYX_ERR(0, 2452, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 2); __PYX_ERR(0, 2452, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 3); __PYX_ERR(0, 2452, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDARKCLOUDCOVER") < 0)) __PYX_ERR(0, 2452, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2452, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.5); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2452, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2452, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2452, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2452, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2452, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_62CDLDARKCLOUDCOVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_62CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2477 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2478 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__292, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2478, __pyx_L1_error) - - /* "talib/func.pyx":2477 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2479 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2480 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__293, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2480, __pyx_L1_error) - - /* "talib/func.pyx":2479 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2481 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2482 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2482, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2481 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2483 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2484 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2485 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__294, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2485, __pyx_L1_error) - - /* "talib/func.pyx":2484 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2486 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2487 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__295, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2487, __pyx_L1_error) - - /* "talib/func.pyx":2486 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2488 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2489 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2489, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2488 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2490 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2491 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2492 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__296, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2492, __pyx_L1_error) - - /* "talib/func.pyx":2491 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2493 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2494 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__297, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2494, __pyx_L1_error) - - /* "talib/func.pyx":2493 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2495 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2496 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2496, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2495 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2497 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2498 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2499 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__298, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2499, __pyx_L1_error) - - /* "talib/func.pyx":2498 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2500 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2501 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__299, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2501, __pyx_L1_error) - - /* "talib/func.pyx":2500 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2502 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2503 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2503, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2502 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2504 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2505 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2506 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2507 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__300, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2507, __pyx_L1_error) - - /* "talib/func.pyx":2506 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2508 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2509 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2509, __pyx_L1_error) - - /* "talib/func.pyx":2508 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2510 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2511 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__302, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2511, __pyx_L1_error) - - /* "talib/func.pyx":2510 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2512 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2513 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2514 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2515 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2516 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2515 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2517 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2518 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2519 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2518 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2520 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2521 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2522 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2521 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2523 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2524 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2525 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2524 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2526 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2527 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2529 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__303, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2529, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2530 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2531 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDARKCLOUDCOVER_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":2532 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2532, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2533 - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2534 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2535 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2536 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDARKCLOUDCOVER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2537 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2538 - * retCode = lib.TA_CDLDARKCLOUDCOVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2452 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2542 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_65CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_64CDLDOJI[] = " CDLDOJI(open, high, low, close)\n\n Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_65CDLDOJI = {"CDLDOJI", (PyCFunction)__pyx_pw_5talib_4func_65CDLDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_64CDLDOJI}; -static PyObject *__pyx_pw_5talib_4func_65CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 1); __PYX_ERR(0, 2542, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 2); __PYX_ERR(0, 2542, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 3); __PYX_ERR(0, 2542, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJI") < 0)) __PYX_ERR(0, 2542, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2542, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2542, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2542, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2542, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2542, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_64CDLDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_64CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2565 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2566 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__304, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2566, __pyx_L1_error) - - /* "talib/func.pyx":2565 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2567 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2568 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__305, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2568, __pyx_L1_error) - - /* "talib/func.pyx":2567 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2569 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2570 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2570, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2569 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2571 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2572 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2573 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__306, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2573, __pyx_L1_error) - - /* "talib/func.pyx":2572 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2574 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2575 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__307, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2575, __pyx_L1_error) - - /* "talib/func.pyx":2574 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2576 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2577 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2577, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2576 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2578 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2579 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2580 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__308, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2580, __pyx_L1_error) - - /* "talib/func.pyx":2579 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2581 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2582 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__309, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2582, __pyx_L1_error) - - /* "talib/func.pyx":2581 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2583 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2584 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2584, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2583 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2585 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2586 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2587 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__310, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2587, __pyx_L1_error) - - /* "talib/func.pyx":2586 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2588 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2589 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__311, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2589, __pyx_L1_error) - - /* "talib/func.pyx":2588 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2590 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2591 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2590 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2592 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2593 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2594 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2595 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__312, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2595, __pyx_L1_error) - - /* "talib/func.pyx":2594 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2596 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2597 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__313, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2597, __pyx_L1_error) - - /* "talib/func.pyx":2596 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2598 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2599 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__314, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2599, __pyx_L1_error) - - /* "talib/func.pyx":2598 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2600 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2601 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2602 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2603 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2604 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2603 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2605 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2606 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2607 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2606 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2608 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2609 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2610 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2609 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2611 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2612 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2613 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2612 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2614 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2615 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2617 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__315, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2617, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2618 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2619 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDOJI_Lookback()); - - /* "talib/func.pyx":2620 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2620, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2621 - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2622 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2623 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2624 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2625 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2626 - * retCode = lib.TA_CDLDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2542 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2630 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_67CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_66CDLDOJISTAR[] = " CDLDOJISTAR(open, high, low, close)\n\n Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_67CDLDOJISTAR = {"CDLDOJISTAR", (PyCFunction)__pyx_pw_5talib_4func_67CDLDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_66CDLDOJISTAR}; -static PyObject *__pyx_pw_5talib_4func_67CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 1); __PYX_ERR(0, 2630, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 2); __PYX_ERR(0, 2630, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 3); __PYX_ERR(0, 2630, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJISTAR") < 0)) __PYX_ERR(0, 2630, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2630, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2630, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_66CDLDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_66CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2653 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2654 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__316, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2654, __pyx_L1_error) - - /* "talib/func.pyx":2653 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2655 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2656 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__317, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2656, __pyx_L1_error) - - /* "talib/func.pyx":2655 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2657 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2658 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2658, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2657 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2659 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2660 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2661 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__318, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2661, __pyx_L1_error) - - /* "talib/func.pyx":2660 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2662 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2663 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__319, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2663, __pyx_L1_error) - - /* "talib/func.pyx":2662 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2664 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2665 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2665, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2664 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2666 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2667 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2668 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__320, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2668, __pyx_L1_error) - - /* "talib/func.pyx":2667 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2669 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2670 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__321, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2670, __pyx_L1_error) - - /* "talib/func.pyx":2669 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2671 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2672 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2672, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2671 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2673 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2674 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2675 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__322, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2675, __pyx_L1_error) - - /* "talib/func.pyx":2674 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2676 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2677 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__323, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2677, __pyx_L1_error) - - /* "talib/func.pyx":2676 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2678 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2679 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2678 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2680 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2681 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2682 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2683 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__324, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2683, __pyx_L1_error) - - /* "talib/func.pyx":2682 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2684 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2685 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__325, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2685, __pyx_L1_error) - - /* "talib/func.pyx":2684 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2686 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2687 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__326, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2687, __pyx_L1_error) - - /* "talib/func.pyx":2686 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2688 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2689 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2690 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2691 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2692 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2691 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2693 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2694 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2695 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2694 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2696 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2697 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2698 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2697 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2699 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2700 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2701 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2700 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2702 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2703 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2705 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__327, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2705, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2706 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2707 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDOJISTAR_Lookback()); - - /* "talib/func.pyx":2708 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2708, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2709 - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2710 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2711 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2712 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2713 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2714 - * retCode = lib.TA_CDLDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2630 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_69CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_68CDLDRAGONFLYDOJI[] = " CDLDRAGONFLYDOJI(open, high, low, close)\n\n Dragonfly Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_69CDLDRAGONFLYDOJI = {"CDLDRAGONFLYDOJI", (PyCFunction)__pyx_pw_5talib_4func_69CDLDRAGONFLYDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_68CDLDRAGONFLYDOJI}; -static PyObject *__pyx_pw_5talib_4func_69CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 1); __PYX_ERR(0, 2718, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 2); __PYX_ERR(0, 2718, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 3); __PYX_ERR(0, 2718, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDRAGONFLYDOJI") < 0)) __PYX_ERR(0, 2718, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2718, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2718, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2718, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2718, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2718, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_68CDLDRAGONFLYDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_68CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2741 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2742 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__328, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2742, __pyx_L1_error) - - /* "talib/func.pyx":2741 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2743 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2744 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__329, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2744, __pyx_L1_error) - - /* "talib/func.pyx":2743 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2745 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2746 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2745 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2747 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2748 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2749 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__330, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2749, __pyx_L1_error) - - /* "talib/func.pyx":2748 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2750 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2751 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__331, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2751, __pyx_L1_error) - - /* "talib/func.pyx":2750 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2752 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2753 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2753, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2752 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2754 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2755 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2756 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__332, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2756, __pyx_L1_error) - - /* "talib/func.pyx":2755 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2757 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2758 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__333, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2758, __pyx_L1_error) - - /* "talib/func.pyx":2757 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2759 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2760 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2760, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2759 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2761 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2762 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2763 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__334, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2763, __pyx_L1_error) - - /* "talib/func.pyx":2762 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2764 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2765 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__335, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2765, __pyx_L1_error) - - /* "talib/func.pyx":2764 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2766 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2767 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2766 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2768 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2769 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2770 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2771 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__336, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2771, __pyx_L1_error) - - /* "talib/func.pyx":2770 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2772 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2773 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__337, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2773, __pyx_L1_error) - - /* "talib/func.pyx":2772 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2774 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2775 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__338, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2775, __pyx_L1_error) - - /* "talib/func.pyx":2774 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2776 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2777 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2778 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2779 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2780 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2779 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2781 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2782 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2783 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2782 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2784 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2785 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2786 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2785 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2787 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2788 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2789 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2788 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2790 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2791 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2793 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__339, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2793, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2794 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2795 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLDRAGONFLYDOJI_Lookback()); - - /* "talib/func.pyx":2796 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2796, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2797 - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2798 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2799 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2800 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDRAGONFLYDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2801 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2802 - * retCode = lib.TA_CDLDRAGONFLYDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2806 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_71CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_70CDLENGULFING[] = " CDLENGULFING(open, high, low, close)\n\n Engulfing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_71CDLENGULFING = {"CDLENGULFING", (PyCFunction)__pyx_pw_5talib_4func_71CDLENGULFING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_70CDLENGULFING}; -static PyObject *__pyx_pw_5talib_4func_71CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLENGULFING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 1); __PYX_ERR(0, 2806, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 2); __PYX_ERR(0, 2806, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 3); __PYX_ERR(0, 2806, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLENGULFING") < 0)) __PYX_ERR(0, 2806, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2806, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2806, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2806, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2806, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2806, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_70CDLENGULFING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_70CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLENGULFING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2829 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2830 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__340, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2830, __pyx_L1_error) - - /* "talib/func.pyx":2829 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2831 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2832 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__341, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2832, __pyx_L1_error) - - /* "talib/func.pyx":2831 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2833 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2834 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2834, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2833 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2835 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2836 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2837 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__342, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2837, __pyx_L1_error) - - /* "talib/func.pyx":2836 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2838 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2839 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__343, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2839, __pyx_L1_error) - - /* "talib/func.pyx":2838 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2840 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2841 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2841, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2840 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2842 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2843 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2844 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__344, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2844, __pyx_L1_error) - - /* "talib/func.pyx":2843 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2845 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2846 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__345, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2846, __pyx_L1_error) - - /* "talib/func.pyx":2845 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2847 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2848 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2848, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2847 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2849 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2850 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2851 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__346, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2851, __pyx_L1_error) - - /* "talib/func.pyx":2850 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2852 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2853 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__347, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2853, __pyx_L1_error) - - /* "talib/func.pyx":2852 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2854 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2855 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2855, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2854 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2856 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2857 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2858 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2859 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__348, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2859, __pyx_L1_error) - - /* "talib/func.pyx":2858 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2860 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2861 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__349, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2861, __pyx_L1_error) - - /* "talib/func.pyx":2860 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2862 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2863 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__350, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2863, __pyx_L1_error) - - /* "talib/func.pyx":2862 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2864 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2865 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2866 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2867 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2868 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2867 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2869 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2870 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2871 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2870 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2872 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2873 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2874 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2873 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2875 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2876 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2877 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2876 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2878 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2879 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2881 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__351, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2881, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2882 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2883 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLENGULFING_Lookback()); - - /* "talib/func.pyx":2884 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2884, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2885 - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2886 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2887 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLENGULFING", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2888 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLENGULFING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLENGULFING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2889 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLENGULFING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLENGULFING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2890 - * retCode = lib.TA_CDLENGULFING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLENGULFING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2806 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2894 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_73CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_72CDLEVENINGDOJISTAR[] = " CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Evening Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_73CDLEVENINGDOJISTAR = {"CDLEVENINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_4func_73CDLEVENINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_72CDLEVENINGDOJISTAR}; -static PyObject *__pyx_pw_5talib_4func_73CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(0, 2894, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(0, 2894, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(0, 2894, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGDOJISTAR") < 0)) __PYX_ERR(0, 2894, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2894, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2894, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2894, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2894, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2894, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2894, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_72CDLEVENINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_72CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":2919 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2920 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2920, __pyx_L1_error) - - /* "talib/func.pyx":2919 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":2921 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2922 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2922, __pyx_L1_error) - - /* "talib/func.pyx":2921 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2923 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2924 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2924, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2923 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":2925 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":2926 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2927 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2927, __pyx_L1_error) - - /* "talib/func.pyx":2926 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":2928 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2929 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2929, __pyx_L1_error) - - /* "talib/func.pyx":2928 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2930 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2931 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2931, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2930 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":2932 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":2933 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2934 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__356, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2934, __pyx_L1_error) - - /* "talib/func.pyx":2933 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":2935 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2936 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__357, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2936, __pyx_L1_error) - - /* "talib/func.pyx":2935 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2937 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2938 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2937 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":2939 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":2940 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2941 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__358, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2941, __pyx_L1_error) - - /* "talib/func.pyx":2940 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":2942 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2943 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__359, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2943, __pyx_L1_error) - - /* "talib/func.pyx":2942 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":2944 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2945 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2945, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2944 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":2946 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":2947 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":2948 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2949 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__360, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2949, __pyx_L1_error) - - /* "talib/func.pyx":2948 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":2950 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2951 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__361, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2951, __pyx_L1_error) - - /* "talib/func.pyx":2950 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":2952 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2953 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__362, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2953, __pyx_L1_error) - - /* "talib/func.pyx":2952 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":2954 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":2955 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2956 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":2957 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2958 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2957 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":2959 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":2960 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2961 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2960 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":2962 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":2963 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2964 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2963 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":2965 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":2966 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":2967 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":2966 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":2968 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":2969 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":2971 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__363, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2971, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":2972 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":2973 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLEVENINGDOJISTAR_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":2974 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2974, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":2975 - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":2976 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":2977 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":2978 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLEVENINGDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":2979 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":2980 - * retCode = lib.TA_CDLEVENINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2894 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":2984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_75CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_74CDLEVENINGSTAR[] = " CDLEVENINGSTAR(open, high, low, close[, penetration=?])\n\n Evening Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_75CDLEVENINGSTAR = {"CDLEVENINGSTAR", (PyCFunction)__pyx_pw_5talib_4func_75CDLEVENINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_74CDLEVENINGSTAR}; -static PyObject *__pyx_pw_5talib_4func_75CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLEVENINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 1); __PYX_ERR(0, 2984, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 2); __PYX_ERR(0, 2984, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 3); __PYX_ERR(0, 2984, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGSTAR") < 0)) __PYX_ERR(0, 2984, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2984, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2984, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_74CDLEVENINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_74CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLEVENINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3009 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3010 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__364, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3010, __pyx_L1_error) - - /* "talib/func.pyx":3009 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3011 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3012 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__365, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3012, __pyx_L1_error) - - /* "talib/func.pyx":3011 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3013 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3014 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3014, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3013 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3015 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3016 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3017 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__366, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3017, __pyx_L1_error) - - /* "talib/func.pyx":3016 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3018 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3019 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__367, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3019, __pyx_L1_error) - - /* "talib/func.pyx":3018 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3020 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3021 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3021, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3020 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3022 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3023 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3024 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__368, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3024, __pyx_L1_error) - - /* "talib/func.pyx":3023 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3025 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3026 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__369, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3026, __pyx_L1_error) - - /* "talib/func.pyx":3025 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3027 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3028 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3028, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3027 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3029 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3030 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3031 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__370, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3031, __pyx_L1_error) - - /* "talib/func.pyx":3030 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3032 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3033 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__371, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3033, __pyx_L1_error) - - /* "talib/func.pyx":3032 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3034 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3035 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3035, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3034 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3036 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3037 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3038 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3039 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__372, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3039, __pyx_L1_error) - - /* "talib/func.pyx":3038 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3040 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3041 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__373, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3041, __pyx_L1_error) - - /* "talib/func.pyx":3040 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3042 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3043 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__374, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3043, __pyx_L1_error) - - /* "talib/func.pyx":3042 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3044 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3045 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3046 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3047 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3048 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3047 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3049 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3050 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3051 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3050 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3052 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3053 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3054 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3053 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3055 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3056 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3057 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3056 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3058 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3059 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3061 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__375, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3061, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3062 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3063 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLEVENINGSTAR_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":3064 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3064, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3064, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3065 - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3066 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3067 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3068 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLEVENINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3069 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3070 - * retCode = lib.TA_CDLEVENINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":2984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3074 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_77CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_76CDLGAPSIDESIDEWHITE[] = " CDLGAPSIDESIDEWHITE(open, high, low, close)\n\n Up/Down-gap side-by-side white lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_77CDLGAPSIDESIDEWHITE = {"CDLGAPSIDESIDEWHITE", (PyCFunction)__pyx_pw_5talib_4func_77CDLGAPSIDESIDEWHITE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_76CDLGAPSIDESIDEWHITE}; -static PyObject *__pyx_pw_5talib_4func_77CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 1); __PYX_ERR(0, 3074, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 2); __PYX_ERR(0, 3074, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 3); __PYX_ERR(0, 3074, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGAPSIDESIDEWHITE") < 0)) __PYX_ERR(0, 3074, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3074, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3074, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3074, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3074, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3074, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_76CDLGAPSIDESIDEWHITE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_76CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3097 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3098 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__376, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3098, __pyx_L1_error) - - /* "talib/func.pyx":3097 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3099 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3100 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__377, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3100, __pyx_L1_error) - - /* "talib/func.pyx":3099 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3101 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3102 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3102, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3101 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3103 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3104 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3105 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__378, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3105, __pyx_L1_error) - - /* "talib/func.pyx":3104 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3106 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3107 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__379, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3107, __pyx_L1_error) - - /* "talib/func.pyx":3106 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3108 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3109 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3108 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3110 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3111 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3112 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__380, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3112, __pyx_L1_error) - - /* "talib/func.pyx":3111 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3113 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3114 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__381, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3114, __pyx_L1_error) - - /* "talib/func.pyx":3113 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3115 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3116 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3116, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3115 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3117 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3118 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3119 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__382, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3119, __pyx_L1_error) - - /* "talib/func.pyx":3118 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3120 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3121 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__383, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3121, __pyx_L1_error) - - /* "talib/func.pyx":3120 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3122 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3123 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3123, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3122 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3124 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3125 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3126 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3127 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__384, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3127, __pyx_L1_error) - - /* "talib/func.pyx":3126 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3128 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3129 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__385, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3129, __pyx_L1_error) - - /* "talib/func.pyx":3128 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3130 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3131 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__386, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3131, __pyx_L1_error) - - /* "talib/func.pyx":3130 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3132 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3133 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3134 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3135 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3136 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3135 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3137 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3138 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3139 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3138 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3140 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3141 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3142 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3141 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3143 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3144 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3145 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3144 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3146 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3147 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3149 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__387, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3149, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3150 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3151 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLGAPSIDESIDEWHITE_Lookback()); - - /* "talib/func.pyx":3152 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3152, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3153 - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3154 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3155 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3156 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLGAPSIDESIDEWHITE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3157 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3158 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3074 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_79CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_78CDLGRAVESTONEDOJI[] = " CDLGRAVESTONEDOJI(open, high, low, close)\n\n Gravestone Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_79CDLGRAVESTONEDOJI = {"CDLGRAVESTONEDOJI", (PyCFunction)__pyx_pw_5talib_4func_79CDLGRAVESTONEDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_78CDLGRAVESTONEDOJI}; -static PyObject *__pyx_pw_5talib_4func_79CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 1); __PYX_ERR(0, 3162, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 2); __PYX_ERR(0, 3162, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 3); __PYX_ERR(0, 3162, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGRAVESTONEDOJI") < 0)) __PYX_ERR(0, 3162, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3162, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3162, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3162, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3162, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3162, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_78CDLGRAVESTONEDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_78CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3185 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3186 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__388, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3186, __pyx_L1_error) - - /* "talib/func.pyx":3185 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3187 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3188 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__389, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3188, __pyx_L1_error) - - /* "talib/func.pyx":3187 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3189 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3190 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3189 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3191 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3192 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3193 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__390, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3193, __pyx_L1_error) - - /* "talib/func.pyx":3192 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3194 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3195 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__391, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3195, __pyx_L1_error) - - /* "talib/func.pyx":3194 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3196 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3197 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3197, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3196 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3198 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3199 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3200 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__392, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3200, __pyx_L1_error) - - /* "talib/func.pyx":3199 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3201 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3202 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__393, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3202, __pyx_L1_error) - - /* "talib/func.pyx":3201 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3203 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3204 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3204, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3203 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3205 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3206 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3207 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__394, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3207, __pyx_L1_error) - - /* "talib/func.pyx":3206 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3208 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3209 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__395, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3209, __pyx_L1_error) - - /* "talib/func.pyx":3208 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3210 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3211 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3211, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3210 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3212 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3213 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3214 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3215 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__396, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3215, __pyx_L1_error) - - /* "talib/func.pyx":3214 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3216 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3217 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__397, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3217, __pyx_L1_error) - - /* "talib/func.pyx":3216 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3218 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3219 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__398, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3219, __pyx_L1_error) - - /* "talib/func.pyx":3218 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3220 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3221 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3222 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3223 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3224 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3223 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3225 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3226 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3227 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3226 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3228 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3229 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3230 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3229 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3231 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3232 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3233 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3232 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3234 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3235 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3237 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__399, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3237, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3238 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3239 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLGRAVESTONEDOJI_Lookback()); - - /* "talib/func.pyx":3240 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3240, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3241 - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3242 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3243 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3244 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLGRAVESTONEDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3245 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3246 - * retCode = lib.TA_CDLGRAVESTONEDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3250 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_81CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_80CDLHAMMER[] = " CDLHAMMER(open, high, low, close)\n\n Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_81CDLHAMMER = {"CDLHAMMER", (PyCFunction)__pyx_pw_5talib_4func_81CDLHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_80CDLHAMMER}; -static PyObject *__pyx_pw_5talib_4func_81CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHAMMER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 1); __PYX_ERR(0, 3250, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 2); __PYX_ERR(0, 3250, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 3); __PYX_ERR(0, 3250, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHAMMER") < 0)) __PYX_ERR(0, 3250, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3250, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3250, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_80CDLHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_80CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHAMMER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3273 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3274 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__400, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3274, __pyx_L1_error) - - /* "talib/func.pyx":3273 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3275 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3276 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__401, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3276, __pyx_L1_error) - - /* "talib/func.pyx":3275 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3277 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3278 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3278, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3277 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3279 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3280 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3281 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__402, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3281, __pyx_L1_error) - - /* "talib/func.pyx":3280 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3282 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3283 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__403, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3283, __pyx_L1_error) - - /* "talib/func.pyx":3282 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3284 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3285 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3285, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3284 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3286 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3287 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3288 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__404, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3288, __pyx_L1_error) - - /* "talib/func.pyx":3287 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3289 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3290 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__405, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3290, __pyx_L1_error) - - /* "talib/func.pyx":3289 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3291 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3292 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3292, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3291 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3293 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3294 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3295 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__406, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3295, __pyx_L1_error) - - /* "talib/func.pyx":3294 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3296 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3297 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__407, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3297, __pyx_L1_error) - - /* "talib/func.pyx":3296 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3298 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3299 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3299, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3298 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3300 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3301 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3302 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3303 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__408, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3303, __pyx_L1_error) - - /* "talib/func.pyx":3302 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3304 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3305 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__409, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3305, __pyx_L1_error) - - /* "talib/func.pyx":3304 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3306 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3307 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__410, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3307, __pyx_L1_error) - - /* "talib/func.pyx":3306 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3308 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3309 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3310 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3311 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3312 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3311 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3313 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3314 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3315 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3314 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3316 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3317 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3318 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3317 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3319 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3320 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3321 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3320 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3322 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3323 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3325 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__411, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3325, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3326 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3327 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHAMMER_Lookback()); - - /* "talib/func.pyx":3328 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3328, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3329 - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3330 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3331 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHAMMER", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3332 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHAMMER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHAMMER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3333 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHAMMER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3334 - * retCode = lib.TA_CDLHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHAMMER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3250 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3338 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_83CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_82CDLHANGINGMAN[] = " CDLHANGINGMAN(open, high, low, close)\n\n Hanging Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_83CDLHANGINGMAN = {"CDLHANGINGMAN", (PyCFunction)__pyx_pw_5talib_4func_83CDLHANGINGMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_82CDLHANGINGMAN}; -static PyObject *__pyx_pw_5talib_4func_83CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHANGINGMAN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 1); __PYX_ERR(0, 3338, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 2); __PYX_ERR(0, 3338, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 3); __PYX_ERR(0, 3338, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHANGINGMAN") < 0)) __PYX_ERR(0, 3338, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3338, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3338, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3338, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3338, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3338, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_82CDLHANGINGMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_82CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHANGINGMAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3361 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3362 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__412, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3362, __pyx_L1_error) - - /* "talib/func.pyx":3361 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3363 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3364 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__413, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3364, __pyx_L1_error) - - /* "talib/func.pyx":3363 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3365 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3366 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3366, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3365 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3367 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3368 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3369 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__414, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3369, __pyx_L1_error) - - /* "talib/func.pyx":3368 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3370 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3371 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__415, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3371, __pyx_L1_error) - - /* "talib/func.pyx":3370 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3372 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3373 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3373, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3372 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3374 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3375 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3376 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__416, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3376, __pyx_L1_error) - - /* "talib/func.pyx":3375 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3377 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3378 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__417, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3378, __pyx_L1_error) - - /* "talib/func.pyx":3377 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3379 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3380 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3380, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3379 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3381 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3382 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3383 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__418, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3383, __pyx_L1_error) - - /* "talib/func.pyx":3382 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3384 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3385 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__419, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3385, __pyx_L1_error) - - /* "talib/func.pyx":3384 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3386 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3387 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3387, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3386 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3388 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3389 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3390 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3391 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__420, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3391, __pyx_L1_error) - - /* "talib/func.pyx":3390 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3392 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3393 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__421, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3393, __pyx_L1_error) - - /* "talib/func.pyx":3392 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3394 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3395 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__422, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3395, __pyx_L1_error) - - /* "talib/func.pyx":3394 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3396 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3397 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3398 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3399 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3400 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3399 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3401 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3402 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3403 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3402 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3404 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3405 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3406 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3405 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3407 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3408 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3409 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3408 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3410 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3411 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3413 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__423, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3413, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3414 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3415 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHANGINGMAN_Lookback()); - - /* "talib/func.pyx":3416 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3416, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3417 - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3418 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3419 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3420 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHANGINGMAN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3421 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHANGINGMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3422 - * retCode = lib.TA_CDLHANGINGMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3338 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3426 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_85CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_84CDLHARAMI[] = " CDLHARAMI(open, high, low, close)\n\n Harami Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_85CDLHARAMI = {"CDLHARAMI", (PyCFunction)__pyx_pw_5talib_4func_85CDLHARAMI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_84CDLHARAMI}; -static PyObject *__pyx_pw_5talib_4func_85CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHARAMI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 1); __PYX_ERR(0, 3426, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 2); __PYX_ERR(0, 3426, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 3); __PYX_ERR(0, 3426, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMI") < 0)) __PYX_ERR(0, 3426, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3426, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3426, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3426, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3426, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3426, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_84CDLHARAMI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_84CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHARAMI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3449 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3450 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__424, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3450, __pyx_L1_error) - - /* "talib/func.pyx":3449 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3451 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3452 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__425, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3452, __pyx_L1_error) - - /* "talib/func.pyx":3451 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3453 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3454 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3454, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3453 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3455 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3456 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3457 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__426, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3457, __pyx_L1_error) - - /* "talib/func.pyx":3456 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3458 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3459 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__427, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3459, __pyx_L1_error) - - /* "talib/func.pyx":3458 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3460 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3461 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3461, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3460 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3462 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3463 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3464 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__428, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3464, __pyx_L1_error) - - /* "talib/func.pyx":3463 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3465 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3466 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__429, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3466, __pyx_L1_error) - - /* "talib/func.pyx":3465 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3467 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3468 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3468, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3467 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3469 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3470 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3471 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__430, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3471, __pyx_L1_error) - - /* "talib/func.pyx":3470 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3472 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3473 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__431, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3473, __pyx_L1_error) - - /* "talib/func.pyx":3472 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3474 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3475 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3475, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3474 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3476 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3477 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3478 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3479 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__432, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3479, __pyx_L1_error) - - /* "talib/func.pyx":3478 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3480 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3481 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__433, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3481, __pyx_L1_error) - - /* "talib/func.pyx":3480 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3482 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3483 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__434, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3483, __pyx_L1_error) - - /* "talib/func.pyx":3482 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3484 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3485 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3486 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3487 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3488 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3487 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3489 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3490 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3491 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3490 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3492 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3493 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3494 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3493 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3495 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3496 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3497 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3496 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3498 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3499 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3501 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__435, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3501, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3502 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3503 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHARAMI_Lookback()); - - /* "talib/func.pyx":3504 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3504, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3505 - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3506 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3507 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3508 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHARAMI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHARAMI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3509 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHARAMI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3510 - * retCode = lib.TA_CDLHARAMI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3426 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3514 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_87CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_86CDLHARAMICROSS[] = " CDLHARAMICROSS(open, high, low, close)\n\n Harami Cross Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_87CDLHARAMICROSS = {"CDLHARAMICROSS", (PyCFunction)__pyx_pw_5talib_4func_87CDLHARAMICROSS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_86CDLHARAMICROSS}; -static PyObject *__pyx_pw_5talib_4func_87CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHARAMICROSS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 1); __PYX_ERR(0, 3514, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 2); __PYX_ERR(0, 3514, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 3); __PYX_ERR(0, 3514, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMICROSS") < 0)) __PYX_ERR(0, 3514, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3514, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3514, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3514, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3514, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3514, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_86CDLHARAMICROSS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_86CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHARAMICROSS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3537 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3538 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__436, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3538, __pyx_L1_error) - - /* "talib/func.pyx":3537 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3539 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3540 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__437, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3540, __pyx_L1_error) - - /* "talib/func.pyx":3539 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3541 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3542 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3542, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3541 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3543 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3544 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3545 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__438, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3545, __pyx_L1_error) - - /* "talib/func.pyx":3544 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3546 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3547 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__439, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3547, __pyx_L1_error) - - /* "talib/func.pyx":3546 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3548 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3549 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3549, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3548 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3550 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3551 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3552 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__440, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3552, __pyx_L1_error) - - /* "talib/func.pyx":3551 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3553 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3554 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__441, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3554, __pyx_L1_error) - - /* "talib/func.pyx":3553 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3555 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3556 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3556, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3555 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3557 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3558 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3559 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__442, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3559, __pyx_L1_error) - - /* "talib/func.pyx":3558 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3560 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3561 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__443, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3561, __pyx_L1_error) - - /* "talib/func.pyx":3560 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3562 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3563 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3563, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3562 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3564 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3565 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3566 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3567 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__444, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3567, __pyx_L1_error) - - /* "talib/func.pyx":3566 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3568 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3569 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__445, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3569, __pyx_L1_error) - - /* "talib/func.pyx":3568 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3570 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3571 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__446, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3571, __pyx_L1_error) - - /* "talib/func.pyx":3570 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3572 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3573 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3574 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3575 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3576 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3575 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3577 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3578 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3579 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3578 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3580 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3581 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3582 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3581 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3583 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3584 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3585 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3584 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3586 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3587 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3589 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__447, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3589, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3590 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3591 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHARAMICROSS_Lookback()); - - /* "talib/func.pyx":3592 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3592, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3593 - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3594 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3595 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3596 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHARAMICROSS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3597 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHARAMICROSS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3598 - * retCode = lib.TA_CDLHARAMICROSS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3514 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3602 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_89CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_88CDLHIGHWAVE[] = " CDLHIGHWAVE(open, high, low, close)\n\n High-Wave Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_89CDLHIGHWAVE = {"CDLHIGHWAVE", (PyCFunction)__pyx_pw_5talib_4func_89CDLHIGHWAVE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_88CDLHIGHWAVE}; -static PyObject *__pyx_pw_5talib_4func_89CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIGHWAVE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 1); __PYX_ERR(0, 3602, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 2); __PYX_ERR(0, 3602, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 3); __PYX_ERR(0, 3602, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIGHWAVE") < 0)) __PYX_ERR(0, 3602, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3602, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3602, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3602, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3602, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3602, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_88CDLHIGHWAVE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_88CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHIGHWAVE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3625 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3626 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__448, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3626, __pyx_L1_error) - - /* "talib/func.pyx":3625 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3627 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3628 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__449, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3628, __pyx_L1_error) - - /* "talib/func.pyx":3627 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3629 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3630 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3630, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3629 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3631 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3632 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3633 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__450, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3633, __pyx_L1_error) - - /* "talib/func.pyx":3632 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3634 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3635 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__451, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3635, __pyx_L1_error) - - /* "talib/func.pyx":3634 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3636 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3637 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3637, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3636 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3638 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3639 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3640 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__452, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3640, __pyx_L1_error) - - /* "talib/func.pyx":3639 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3641 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3642 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__453, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3642, __pyx_L1_error) - - /* "talib/func.pyx":3641 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3643 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3644 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3644, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3643 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3645 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3646 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3647 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__454, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3647, __pyx_L1_error) - - /* "talib/func.pyx":3646 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3648 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3649 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__455, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3649, __pyx_L1_error) - - /* "talib/func.pyx":3648 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3650 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3651 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3651, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3650 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3652 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3653 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3654 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3655 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__456, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3655, __pyx_L1_error) - - /* "talib/func.pyx":3654 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3656 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3657 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__457, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3657, __pyx_L1_error) - - /* "talib/func.pyx":3656 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3658 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3659 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__458, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3659, __pyx_L1_error) - - /* "talib/func.pyx":3658 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3660 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3661 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3662 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3663 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3664 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3663 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3665 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3666 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3667 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3666 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3668 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3669 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3670 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3669 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3671 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3672 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3673 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3672 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3674 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3675 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3677 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__459, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3677, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3678 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3679 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIGHWAVE_Lookback()); - - /* "talib/func.pyx":3680 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3680, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3681 - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3682 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3683 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3684 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIGHWAVE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3685 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIGHWAVE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3686 - * retCode = lib.TA_CDLHIGHWAVE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3602 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3690 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_91CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_90CDLHIKKAKE[] = " CDLHIKKAKE(open, high, low, close)\n\n Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_91CDLHIKKAKE = {"CDLHIKKAKE", (PyCFunction)__pyx_pw_5talib_4func_91CDLHIKKAKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_90CDLHIKKAKE}; -static PyObject *__pyx_pw_5talib_4func_91CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIKKAKE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 1); __PYX_ERR(0, 3690, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 2); __PYX_ERR(0, 3690, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 3); __PYX_ERR(0, 3690, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKE") < 0)) __PYX_ERR(0, 3690, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3690, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3690, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3690, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3690, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3690, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_90CDLHIKKAKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_90CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHIKKAKE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3713 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3714 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__460, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3714, __pyx_L1_error) - - /* "talib/func.pyx":3713 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3715 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3716 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__461, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3716, __pyx_L1_error) - - /* "talib/func.pyx":3715 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3717 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3718 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3718, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3717 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3719 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3720 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3721 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__462, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3721, __pyx_L1_error) - - /* "talib/func.pyx":3720 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3722 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3723 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__463, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3723, __pyx_L1_error) - - /* "talib/func.pyx":3722 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3724 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3725 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3725, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3724 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3726 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3727 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3728 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__464, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3728, __pyx_L1_error) - - /* "talib/func.pyx":3727 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3729 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3730 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__465, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3730, __pyx_L1_error) - - /* "talib/func.pyx":3729 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3731 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3732 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3732, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3731 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3733 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3734 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3735 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__466, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3735, __pyx_L1_error) - - /* "talib/func.pyx":3734 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3736 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3737 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__467, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3737, __pyx_L1_error) - - /* "talib/func.pyx":3736 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3738 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3739 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3739, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3738 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3740 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3741 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3742 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3743 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__468, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3743, __pyx_L1_error) - - /* "talib/func.pyx":3742 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3744 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3745 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__469, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3745, __pyx_L1_error) - - /* "talib/func.pyx":3744 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3746 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3747 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__470, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3747, __pyx_L1_error) - - /* "talib/func.pyx":3746 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3748 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3749 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3750 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3751 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3752 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3751 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3753 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3754 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3755 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3754 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3756 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3757 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3758 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3757 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3759 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3760 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3761 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3760 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3762 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3763 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3765 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__471, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3765, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3766 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3767 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIKKAKE_Lookback()); - - /* "talib/func.pyx":3768 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3768, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3769 - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3770 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3771 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3772 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIKKAKE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIKKAKE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3773 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIKKAKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3774 - * retCode = lib.TA_CDLHIKKAKE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3690 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_93CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_92CDLHIKKAKEMOD[] = " CDLHIKKAKEMOD(open, high, low, close)\n\n Modified Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_93CDLHIKKAKEMOD = {"CDLHIKKAKEMOD", (PyCFunction)__pyx_pw_5talib_4func_93CDLHIKKAKEMOD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_92CDLHIKKAKEMOD}; -static PyObject *__pyx_pw_5talib_4func_93CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIKKAKEMOD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 1); __PYX_ERR(0, 3778, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 2); __PYX_ERR(0, 3778, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 3); __PYX_ERR(0, 3778, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKEMOD") < 0)) __PYX_ERR(0, 3778, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3778, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3778, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3778, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3778, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3778, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_92CDLHIKKAKEMOD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_92CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHIKKAKEMOD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3801 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3802 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__472, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3802, __pyx_L1_error) - - /* "talib/func.pyx":3801 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3803 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3804 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__473, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3804, __pyx_L1_error) - - /* "talib/func.pyx":3803 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3805 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3806 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3806, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3805 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3807 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3808 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3809 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__474, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3809, __pyx_L1_error) - - /* "talib/func.pyx":3808 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3810 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3811 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__475, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3811, __pyx_L1_error) - - /* "talib/func.pyx":3810 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3812 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3813 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3813, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3812 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3814 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3815 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3816 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__476, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3816, __pyx_L1_error) - - /* "talib/func.pyx":3815 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3817 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3818 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__477, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3818, __pyx_L1_error) - - /* "talib/func.pyx":3817 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3819 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3820 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3820, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3819 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3821 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3822 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3823 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__478, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3823, __pyx_L1_error) - - /* "talib/func.pyx":3822 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3824 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3825 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__479, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3825, __pyx_L1_error) - - /* "talib/func.pyx":3824 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3826 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3827 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3827, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3826 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3828 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3829 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3830 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3831 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__480, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3831, __pyx_L1_error) - - /* "talib/func.pyx":3830 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3832 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3833 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__481, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3833, __pyx_L1_error) - - /* "talib/func.pyx":3832 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3834 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3835 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__482, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3835, __pyx_L1_error) - - /* "talib/func.pyx":3834 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3836 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3837 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3838 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3839 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3840 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3839 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3841 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3842 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3843 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3842 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3844 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3845 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3846 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3845 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3847 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3848 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3849 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3848 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3850 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3851 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3853 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__483, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3853, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3854 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3855 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHIKKAKEMOD_Lookback()); - - /* "talib/func.pyx":3856 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3856, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3857 - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3858 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3859 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3860 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIKKAKEMOD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3861 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3862 - * retCode = lib.TA_CDLHIKKAKEMOD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3866 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_95CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_94CDLHOMINGPIGEON[] = " CDLHOMINGPIGEON(open, high, low, close)\n\n Homing Pigeon (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_95CDLHOMINGPIGEON = {"CDLHOMINGPIGEON", (PyCFunction)__pyx_pw_5talib_4func_95CDLHOMINGPIGEON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_94CDLHOMINGPIGEON}; -static PyObject *__pyx_pw_5talib_4func_95CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHOMINGPIGEON (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 1); __PYX_ERR(0, 3866, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 2); __PYX_ERR(0, 3866, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 3); __PYX_ERR(0, 3866, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHOMINGPIGEON") < 0)) __PYX_ERR(0, 3866, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3866, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3866, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3866, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3866, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3866, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_94CDLHOMINGPIGEON(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_94CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLHOMINGPIGEON", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3889 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3890 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__484, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3890, __pyx_L1_error) - - /* "talib/func.pyx":3889 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3891 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3892 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__485, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3892, __pyx_L1_error) - - /* "talib/func.pyx":3891 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3893 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3894 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3894, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3893 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3895 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3896 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3897 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__486, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3897, __pyx_L1_error) - - /* "talib/func.pyx":3896 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3898 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3899 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__487, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3899, __pyx_L1_error) - - /* "talib/func.pyx":3898 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3900 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3901 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3901, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3900 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3902 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3903 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3904 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__488, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3904, __pyx_L1_error) - - /* "talib/func.pyx":3903 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3905 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3906 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__489, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3906, __pyx_L1_error) - - /* "talib/func.pyx":3905 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3907 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3908 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3908, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3907 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3909 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3910 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3911 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__490, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3911, __pyx_L1_error) - - /* "talib/func.pyx":3910 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":3912 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3913 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__491, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3913, __pyx_L1_error) - - /* "talib/func.pyx":3912 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3914 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3915 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3915, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3915, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3914 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":3916 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":3917 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":3918 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3919 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__492, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3919, __pyx_L1_error) - - /* "talib/func.pyx":3918 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":3920 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3921 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__493, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3921, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3921, __pyx_L1_error) - - /* "talib/func.pyx":3920 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":3922 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3923 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__494, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3923, __pyx_L1_error) - - /* "talib/func.pyx":3922 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":3924 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":3925 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3926 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":3927 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3928 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3927 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":3929 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":3930 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3931 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3930 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":3932 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":3933 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3934 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3933 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":3935 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":3936 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3937 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":3936 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":3938 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":3939 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":3941 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__495, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3941, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":3942 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":3943 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLHOMINGPIGEON_Lookback()); - - /* "talib/func.pyx":3944 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3944, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3945 - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":3946 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":3947 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":3948 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHOMINGPIGEON(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":3949 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":3950 - * retCode = lib.TA_CDLHOMINGPIGEON( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3866 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":3954 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_97CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_96CDLIDENTICAL3CROWS[] = " CDLIDENTICAL3CROWS(open, high, low, close)\n\n Identical Three Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_97CDLIDENTICAL3CROWS = {"CDLIDENTICAL3CROWS", (PyCFunction)__pyx_pw_5talib_4func_97CDLIDENTICAL3CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_96CDLIDENTICAL3CROWS}; -static PyObject *__pyx_pw_5talib_4func_97CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 1); __PYX_ERR(0, 3954, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 2); __PYX_ERR(0, 3954, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 3); __PYX_ERR(0, 3954, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLIDENTICAL3CROWS") < 0)) __PYX_ERR(0, 3954, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3954, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3954, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3954, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3954, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3954, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_96CDLIDENTICAL3CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_96CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":3977 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3978 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__496, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3978, __pyx_L1_error) - - /* "talib/func.pyx":3977 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":3979 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3980 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__497, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3980, __pyx_L1_error) - - /* "talib/func.pyx":3979 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3981 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3982 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3982, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3981 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":3983 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":3984 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3985 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__498, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3985, __pyx_L1_error) - - /* "talib/func.pyx":3984 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":3986 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3987 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__499, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3987, __pyx_L1_error) - - /* "talib/func.pyx":3986 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3988 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3989 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3989, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3988 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":3990 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":3991 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3992 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__500, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3992, __pyx_L1_error) - - /* "talib/func.pyx":3991 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":3993 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3994 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__501, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3994, __pyx_L1_error) - - /* "talib/func.pyx":3993 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":3995 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3996 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3996, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":3995 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":3997 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":3998 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":3999 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__502, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3999, __pyx_L1_error) - - /* "talib/func.pyx":3998 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4000 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4001 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__503, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4001, __pyx_L1_error) - - /* "talib/func.pyx":4000 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4002 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4003 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4003, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4002 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4004 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4005 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4006 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4007 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__504, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4007, __pyx_L1_error) - - /* "talib/func.pyx":4006 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4008 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4009 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__505, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4009, __pyx_L1_error) - - /* "talib/func.pyx":4008 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4010 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4011 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__506, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4011, __pyx_L1_error) - - /* "talib/func.pyx":4010 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4012 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4013 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4014 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4015 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4016 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4015 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4017 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4018 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4019 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4018 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4020 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4021 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4022 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4021 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4023 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4024 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4025 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4024 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4026 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4027 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4029 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__507, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4029, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4030 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4031 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLIDENTICAL3CROWS_Lookback()); - - /* "talib/func.pyx":4032 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4032, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4033 - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4034 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4035 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4036 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLIDENTICAL3CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4037 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4038 - * retCode = lib.TA_CDLIDENTICAL3CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":3954 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_99CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_98CDLINNECK[] = " CDLINNECK(open, high, low, close)\n\n In-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_99CDLINNECK = {"CDLINNECK", (PyCFunction)__pyx_pw_5talib_4func_99CDLINNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_98CDLINNECK}; -static PyObject *__pyx_pw_5talib_4func_99CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLINNECK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 1); __PYX_ERR(0, 4042, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 2); __PYX_ERR(0, 4042, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 3); __PYX_ERR(0, 4042, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINNECK") < 0)) __PYX_ERR(0, 4042, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4042, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4042, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4042, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4042, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4042, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_98CDLINNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_98CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLINNECK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4065 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4066 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__508, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4066, __pyx_L1_error) - - /* "talib/func.pyx":4065 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4067 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4068 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__509, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4068, __pyx_L1_error) - - /* "talib/func.pyx":4067 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4069 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4070 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4070, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4069 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4071 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4072 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4073 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__510, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4073, __pyx_L1_error) - - /* "talib/func.pyx":4072 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4074 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4075 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__511, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4075, __pyx_L1_error) - - /* "talib/func.pyx":4074 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4076 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4077 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4077, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4076 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4078 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4079 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4080 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__512, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4080, __pyx_L1_error) - - /* "talib/func.pyx":4079 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4081 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4082 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__513, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4082, __pyx_L1_error) - - /* "talib/func.pyx":4081 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4083 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4084 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4084, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4083 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4085 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4086 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4087 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__514, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4087, __pyx_L1_error) - - /* "talib/func.pyx":4086 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4088 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4089 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__515, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4089, __pyx_L1_error) - - /* "talib/func.pyx":4088 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4090 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4091 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4091, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4090 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4092 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4093 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4094 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4095 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__516, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4095, __pyx_L1_error) - - /* "talib/func.pyx":4094 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4096 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4097 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__517, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4097, __pyx_L1_error) - - /* "talib/func.pyx":4096 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4098 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4099 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__518, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4099, __pyx_L1_error) - - /* "talib/func.pyx":4098 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4100 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4101 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4102 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4103 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4104 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4103 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4105 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4106 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4107 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4106 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4108 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4109 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4110 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4109 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4111 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4112 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4113 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4112 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4114 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4115 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4117 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__519, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4117, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4118 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4119 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLINNECK_Lookback()); - - /* "talib/func.pyx":4120 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4120, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4121 - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4122 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4123 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINNECK", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4124 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLINNECK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLINNECK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4125 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINNECK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLINNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4126 - * retCode = lib.TA_CDLINNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINNECK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4130 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_101CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_100CDLINVERTEDHAMMER[] = " CDLINVERTEDHAMMER(open, high, low, close)\n\n Inverted Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_101CDLINVERTEDHAMMER = {"CDLINVERTEDHAMMER", (PyCFunction)__pyx_pw_5talib_4func_101CDLINVERTEDHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_100CDLINVERTEDHAMMER}; -static PyObject *__pyx_pw_5talib_4func_101CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 1); __PYX_ERR(0, 4130, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 2); __PYX_ERR(0, 4130, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 3); __PYX_ERR(0, 4130, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINVERTEDHAMMER") < 0)) __PYX_ERR(0, 4130, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4130, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4130, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4130, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4130, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4130, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_100CDLINVERTEDHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_100CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4153 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4154 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__520, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4154, __pyx_L1_error) - - /* "talib/func.pyx":4153 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4155 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4156 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__521, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4156, __pyx_L1_error) - - /* "talib/func.pyx":4155 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4157 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4158 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4158, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4157 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4159 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4160 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4161 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__522, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4161, __pyx_L1_error) - - /* "talib/func.pyx":4160 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4162 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4163 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__523, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4163, __pyx_L1_error) - - /* "talib/func.pyx":4162 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4164 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4165 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4165, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4164 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4166 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4167 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4168 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__524, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4168, __pyx_L1_error) - - /* "talib/func.pyx":4167 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4169 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4170 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__525, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4170, __pyx_L1_error) - - /* "talib/func.pyx":4169 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4171 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4172 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4172, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4171 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4173 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4174 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4175 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__526, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4175, __pyx_L1_error) - - /* "talib/func.pyx":4174 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4176 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4177 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__527, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4177, __pyx_L1_error) - - /* "talib/func.pyx":4176 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4178 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4179 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4179, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4178 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4180 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4181 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4182 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4183 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__528, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4183, __pyx_L1_error) - - /* "talib/func.pyx":4182 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4184 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4185 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__529, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4185, __pyx_L1_error) - - /* "talib/func.pyx":4184 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4186 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4187 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__530, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4187, __pyx_L1_error) - - /* "talib/func.pyx":4186 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4188 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4189 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4190 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4191 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4192 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4191 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4193 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4194 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4195 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4194 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4196 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4197 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4198 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4197 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4199 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4200 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4201 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4200 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4202 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4203 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4205 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__531, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4205, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4206 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4207 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLINVERTEDHAMMER_Lookback()); - - /* "talib/func.pyx":4208 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4208, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4209 - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4210 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4211 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4212 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLINVERTEDHAMMER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4213 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4214 - * retCode = lib.TA_CDLINVERTEDHAMMER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4130 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_103CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_102CDLKICKING[] = " CDLKICKING(open, high, low, close)\n\n Kicking (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_103CDLKICKING = {"CDLKICKING", (PyCFunction)__pyx_pw_5talib_4func_103CDLKICKING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_102CDLKICKING}; -static PyObject *__pyx_pw_5talib_4func_103CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLKICKING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 1); __PYX_ERR(0, 4218, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 2); __PYX_ERR(0, 4218, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 3); __PYX_ERR(0, 4218, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKING") < 0)) __PYX_ERR(0, 4218, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4218, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4218, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_102CDLKICKING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_102CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLKICKING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4241 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4242 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__532, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4242, __pyx_L1_error) - - /* "talib/func.pyx":4241 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4243 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4244 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__533, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4244, __pyx_L1_error) - - /* "talib/func.pyx":4243 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4245 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4246 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4246, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4245 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4247 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4248 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4249 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__534, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4249, __pyx_L1_error) - - /* "talib/func.pyx":4248 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4250 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4251 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__535, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4251, __pyx_L1_error) - - /* "talib/func.pyx":4250 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4252 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4253 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4253, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4252 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4254 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4255 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4256 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__536, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4256, __pyx_L1_error) - - /* "talib/func.pyx":4255 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4257 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4258 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__537, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4258, __pyx_L1_error) - - /* "talib/func.pyx":4257 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4259 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4260 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4260, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4259 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4261 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4262 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4263 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__538, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4263, __pyx_L1_error) - - /* "talib/func.pyx":4262 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4264 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4265 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__539, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4265, __pyx_L1_error) - - /* "talib/func.pyx":4264 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4266 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4267 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4267, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4266 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4268 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4269 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4270 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4271 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__540, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4271, __pyx_L1_error) - - /* "talib/func.pyx":4270 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4272 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4273 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__541, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4273, __pyx_L1_error) - - /* "talib/func.pyx":4272 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__542, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4275, __pyx_L1_error) - - /* "talib/func.pyx":4274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4276 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4277 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4278 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4279 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4280 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4279 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4281 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4282 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4283 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4282 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4284 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4285 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4286 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4285 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4287 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4288 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4289 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4288 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4290 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4291 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4293 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__543, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4293, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4294 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4295 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLKICKING_Lookback()); - - /* "talib/func.pyx":4296 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4296, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4297 - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4298 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4299 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKING", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4300 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLKICKING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLKICKING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4301 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLKICKING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4302 - * retCode = lib.TA_CDLKICKING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_105CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_104CDLKICKINGBYLENGTH[] = " CDLKICKINGBYLENGTH(open, high, low, close)\n\n Kicking - bull/bear determined by the longer marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_105CDLKICKINGBYLENGTH = {"CDLKICKINGBYLENGTH", (PyCFunction)__pyx_pw_5talib_4func_105CDLKICKINGBYLENGTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_104CDLKICKINGBYLENGTH}; -static PyObject *__pyx_pw_5talib_4func_105CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 1); __PYX_ERR(0, 4306, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 2); __PYX_ERR(0, 4306, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 3); __PYX_ERR(0, 4306, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKINGBYLENGTH") < 0)) __PYX_ERR(0, 4306, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4306, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4306, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_104CDLKICKINGBYLENGTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_104CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4329 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4330 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__544, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4330, __pyx_L1_error) - - /* "talib/func.pyx":4329 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4331 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4332 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__545, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4332, __pyx_L1_error) - - /* "talib/func.pyx":4331 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4333 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4334 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4334, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4333 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4335 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4336 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4337 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__546, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4337, __pyx_L1_error) - - /* "talib/func.pyx":4336 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4338 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4339 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__547, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4339, __pyx_L1_error) - - /* "talib/func.pyx":4338 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4340 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4341 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4341, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4340 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4342 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4343 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4344 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__548, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4344, __pyx_L1_error) - - /* "talib/func.pyx":4343 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4345 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4346 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__549, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4346, __pyx_L1_error) - - /* "talib/func.pyx":4345 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4347 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4348 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4348, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4347 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4349 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4350 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4351 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__550, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4351, __pyx_L1_error) - - /* "talib/func.pyx":4350 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4352 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4353 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__551, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4353, __pyx_L1_error) - - /* "talib/func.pyx":4352 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4354 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4355 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4355, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4354 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4356 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4357 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4358 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4359 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__552, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4359, __pyx_L1_error) - - /* "talib/func.pyx":4358 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4360 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4361 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__553, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4361, __pyx_L1_error) - - /* "talib/func.pyx":4360 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4362 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4363 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__554, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4363, __pyx_L1_error) - - /* "talib/func.pyx":4362 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4364 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4365 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4366 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4367 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4368 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4367 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4369 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4370 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4371 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4370 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4372 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4373 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4374 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4373 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4375 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4376 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4377 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4376 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4378 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4379 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4381 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__555, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4381, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4382 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4383 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLKICKINGBYLENGTH_Lookback()); - - /* "talib/func.pyx":4384 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4384, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4385 - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4386 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4387 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4388 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLKICKINGBYLENGTH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4389 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4390 - * retCode = lib.TA_CDLKICKINGBYLENGTH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_107CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_106CDLLADDERBOTTOM[] = " CDLLADDERBOTTOM(open, high, low, close)\n\n Ladder Bottom (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_107CDLLADDERBOTTOM = {"CDLLADDERBOTTOM", (PyCFunction)__pyx_pw_5talib_4func_107CDLLADDERBOTTOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_106CDLLADDERBOTTOM}; -static PyObject *__pyx_pw_5talib_4func_107CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLADDERBOTTOM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 1); __PYX_ERR(0, 4394, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 2); __PYX_ERR(0, 4394, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 3); __PYX_ERR(0, 4394, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLADDERBOTTOM") < 0)) __PYX_ERR(0, 4394, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4394, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4394, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_106CDLLADDERBOTTOM(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_106CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLLADDERBOTTOM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4417 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4418 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__556, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4418, __pyx_L1_error) - - /* "talib/func.pyx":4417 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4419 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4420 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__557, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4420, __pyx_L1_error) - - /* "talib/func.pyx":4419 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4421 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4422 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4422, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4421 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4423 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4424 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4425 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__558, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4425, __pyx_L1_error) - - /* "talib/func.pyx":4424 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4426 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4427 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__559, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4427, __pyx_L1_error) - - /* "talib/func.pyx":4426 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4428 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4429 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4429, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4428 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4430 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4431 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4432 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__560, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4432, __pyx_L1_error) - - /* "talib/func.pyx":4431 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4433 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4434 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__561, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4434, __pyx_L1_error) - - /* "talib/func.pyx":4433 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4435 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4436 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4436, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4435 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4437 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4438 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4439 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__562, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4439, __pyx_L1_error) - - /* "talib/func.pyx":4438 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4440 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4441 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__563, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4441, __pyx_L1_error) - - /* "talib/func.pyx":4440 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4442 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4443 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4443, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4442 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4444 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4445 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4446 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4447 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__564, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4447, __pyx_L1_error) - - /* "talib/func.pyx":4446 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4448 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4449 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__565, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4449, __pyx_L1_error) - - /* "talib/func.pyx":4448 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4450 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4451 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__566, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4451, __pyx_L1_error) - - /* "talib/func.pyx":4450 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4452 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4453 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4454 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4455 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4456 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4455 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4457 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4458 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4459 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4458 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4460 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4461 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4462 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4461 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4463 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4464 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4465 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4464 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4466 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4467 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4469 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__567, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4469, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4470 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4471 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLADDERBOTTOM_Lookback()); - - /* "talib/func.pyx":4472 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4472, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4473 - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4474 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4475 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4476 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLADDERBOTTOM(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4477 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4478 - * retCode = lib.TA_CDLLADDERBOTTOM( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_109CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_108CDLLONGLEGGEDDOJI[] = " CDLLONGLEGGEDDOJI(open, high, low, close)\n\n Long Legged Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_109CDLLONGLEGGEDDOJI = {"CDLLONGLEGGEDDOJI", (PyCFunction)__pyx_pw_5talib_4func_109CDLLONGLEGGEDDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_108CDLLONGLEGGEDDOJI}; -static PyObject *__pyx_pw_5talib_4func_109CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 1); __PYX_ERR(0, 4482, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 2); __PYX_ERR(0, 4482, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 3); __PYX_ERR(0, 4482, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLEGGEDDOJI") < 0)) __PYX_ERR(0, 4482, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4482, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4482, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4482, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_108CDLLONGLEGGEDDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_108CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4505 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4506 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__568, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4506, __pyx_L1_error) - - /* "talib/func.pyx":4505 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4507 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4508 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__569, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4508, __pyx_L1_error) - - /* "talib/func.pyx":4507 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4509 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4510 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4510, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4509 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4511 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4512 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4513 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__570, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4513, __pyx_L1_error) - - /* "talib/func.pyx":4512 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4514 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4515 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__571, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4515, __pyx_L1_error) - - /* "talib/func.pyx":4514 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4516 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4517 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4517, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4516 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4518 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4519 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4520 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__572, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4520, __pyx_L1_error) - - /* "talib/func.pyx":4519 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4521 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4522 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__573, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4522, __pyx_L1_error) - - /* "talib/func.pyx":4521 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4523 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4524 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4524, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4523 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4525 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4526 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4527 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__574, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4527, __pyx_L1_error) - - /* "talib/func.pyx":4526 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4528 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4529 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__575, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4529, __pyx_L1_error) - - /* "talib/func.pyx":4528 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4530 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4531 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4531, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4530 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4532 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4533 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4534 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4535 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__576, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4535, __pyx_L1_error) - - /* "talib/func.pyx":4534 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4536 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4537 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__577, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4537, __pyx_L1_error) - - /* "talib/func.pyx":4536 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4538 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4539 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__578, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4539, __pyx_L1_error) - - /* "talib/func.pyx":4538 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4540 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4541 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4542 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4543 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4544 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4543 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4545 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4546 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4547 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4546 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4548 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4549 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4550 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4549 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4551 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4552 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4553 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4552 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4554 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4555 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4557 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__579, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4557, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4558 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4559 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLONGLEGGEDDOJI_Lookback()); - - /* "talib/func.pyx":4560 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4560, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4561 - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4562 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4563 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4564 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLONGLEGGEDDOJI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4565 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4566 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_111CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_110CDLLONGLINE[] = " CDLLONGLINE(open, high, low, close)\n\n Long Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_111CDLLONGLINE = {"CDLLONGLINE", (PyCFunction)__pyx_pw_5talib_4func_111CDLLONGLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_110CDLLONGLINE}; -static PyObject *__pyx_pw_5talib_4func_111CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLONGLINE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 1); __PYX_ERR(0, 4570, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 2); __PYX_ERR(0, 4570, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 3); __PYX_ERR(0, 4570, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLINE") < 0)) __PYX_ERR(0, 4570, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4570, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4570, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4570, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_110CDLLONGLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_110CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLLONGLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4593 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4594 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__580, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4594, __pyx_L1_error) - - /* "talib/func.pyx":4593 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4595 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4596 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__581, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4596, __pyx_L1_error) - - /* "talib/func.pyx":4595 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4597 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4598 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4598, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4597 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4599 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4600 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4601 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__582, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4601, __pyx_L1_error) - - /* "talib/func.pyx":4600 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4602 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4603 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__583, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4603, __pyx_L1_error) - - /* "talib/func.pyx":4602 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4604 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4605 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4605, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4604 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4606 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4607 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4608 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__584, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4608, __pyx_L1_error) - - /* "talib/func.pyx":4607 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4609 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4610 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__585, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4610, __pyx_L1_error) - - /* "talib/func.pyx":4609 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4611 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4612 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4612, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4611 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4613 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4614 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4615 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__586, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4615, __pyx_L1_error) - - /* "talib/func.pyx":4614 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4616 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4617 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__587, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4617, __pyx_L1_error) - - /* "talib/func.pyx":4616 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4618 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4619 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4619, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4618 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4620 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4621 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4622 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4623 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__588, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4623, __pyx_L1_error) - - /* "talib/func.pyx":4622 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4624 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4625 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__589, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4625, __pyx_L1_error) - - /* "talib/func.pyx":4624 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4626 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4627 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__590, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4627, __pyx_L1_error) - - /* "talib/func.pyx":4626 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4628 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4629 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4630 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4631 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4632 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4631 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4633 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4634 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4635 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4634 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4636 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4637 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4638 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4637 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4639 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4640 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4641 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4640 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4642 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4643 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4645 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__591, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4645, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4646 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4647 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLLONGLINE_Lookback()); - - /* "talib/func.pyx":4648 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4648, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4649 - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4650 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4651 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLINE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4652 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLONGLINE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLONGLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4653 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLINE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLONGLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4654 - * retCode = lib.TA_CDLLONGLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLLONGLINE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_113CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_112CDLMARUBOZU[] = " CDLMARUBOZU(open, high, low, close)\n\n Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_113CDLMARUBOZU = {"CDLMARUBOZU", (PyCFunction)__pyx_pw_5talib_4func_113CDLMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_112CDLMARUBOZU}; -static PyObject *__pyx_pw_5talib_4func_113CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMARUBOZU (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 1); __PYX_ERR(0, 4658, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 2); __PYX_ERR(0, 4658, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 3); __PYX_ERR(0, 4658, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMARUBOZU") < 0)) __PYX_ERR(0, 4658, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4658, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4658, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4658, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_112CDLMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_112CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLMARUBOZU", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4681 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4682 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__592, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4682, __pyx_L1_error) - - /* "talib/func.pyx":4681 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4683 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4684 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__593, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4684, __pyx_L1_error) - - /* "talib/func.pyx":4683 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4685 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4686 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4686, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4685 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4687 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4688 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4689 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__594, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4689, __pyx_L1_error) - - /* "talib/func.pyx":4688 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4690 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4691 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__595, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4691, __pyx_L1_error) - - /* "talib/func.pyx":4690 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4692 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4693 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4693, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4692 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4694 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4695 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4696 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__596, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4696, __pyx_L1_error) - - /* "talib/func.pyx":4695 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4697 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4698 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__597, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4698, __pyx_L1_error) - - /* "talib/func.pyx":4697 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4699 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4700 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4700, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4699 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4701 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4702 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4703 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__598, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4703, __pyx_L1_error) - - /* "talib/func.pyx":4702 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4704 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4705 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__599, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4705, __pyx_L1_error) - - /* "talib/func.pyx":4704 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4706 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4707 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4707, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4706 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4708 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4709 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4710 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4711 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__600, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4711, __pyx_L1_error) - - /* "talib/func.pyx":4710 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4712 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4713 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__601, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4713, __pyx_L1_error) - - /* "talib/func.pyx":4712 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4714 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4715 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__602, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4715, __pyx_L1_error) - - /* "talib/func.pyx":4714 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4716 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4717 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4718 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4719 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4720 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4719 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4721 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4722 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4723 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4722 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4724 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4725 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4726 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4725 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4727 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4728 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4729 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4728 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4730 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4731 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4733 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__603, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4733, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4734 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4735 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMARUBOZU_Lookback()); - - /* "talib/func.pyx":4736 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4736, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4737 - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4738 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4739 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4740 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMARUBOZU", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMARUBOZU(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4741 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4742 - * retCode = lib.TA_CDLMARUBOZU( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_115CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_114CDLMATCHINGLOW[] = " CDLMATCHINGLOW(open, high, low, close)\n\n Matching Low (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_115CDLMATCHINGLOW = {"CDLMATCHINGLOW", (PyCFunction)__pyx_pw_5talib_4func_115CDLMATCHINGLOW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_114CDLMATCHINGLOW}; -static PyObject *__pyx_pw_5talib_4func_115CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMATCHINGLOW (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 1); __PYX_ERR(0, 4746, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 2); __PYX_ERR(0, 4746, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 3); __PYX_ERR(0, 4746, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATCHINGLOW") < 0)) __PYX_ERR(0, 4746, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4746, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4746, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4746, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_114CDLMATCHINGLOW(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_114CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLMATCHINGLOW", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4769 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4770 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__604, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4770, __pyx_L1_error) - - /* "talib/func.pyx":4769 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4771 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4772 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__605, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4772, __pyx_L1_error) - - /* "talib/func.pyx":4771 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4773 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4774 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4774, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4773 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4775 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4776 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4777 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__606, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4777, __pyx_L1_error) - - /* "talib/func.pyx":4776 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4778 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4779 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__607, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4779, __pyx_L1_error) - - /* "talib/func.pyx":4778 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4780 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4781 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4781, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4780 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4782 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4783 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4784 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__608, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4784, __pyx_L1_error) - - /* "talib/func.pyx":4783 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4785 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4786 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__609, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4786, __pyx_L1_error) - - /* "talib/func.pyx":4785 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4787 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4788 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4788, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4787 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4789 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4790 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4791 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__610, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4791, __pyx_L1_error) - - /* "talib/func.pyx":4790 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4792 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4793 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__611, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4793, __pyx_L1_error) - - /* "talib/func.pyx":4792 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4794 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4795 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4795, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4794 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4796 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4797 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4798 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4799 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__612, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4799, __pyx_L1_error) - - /* "talib/func.pyx":4798 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4800 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4801 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__613, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4801, __pyx_L1_error) - - /* "talib/func.pyx":4800 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4802 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4803 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__614, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4803, __pyx_L1_error) - - /* "talib/func.pyx":4802 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4804 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4805 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4806 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4807 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4808 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4807 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4809 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4810 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4811 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4810 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4812 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4813 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4814 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4813 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4815 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4816 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4817 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4816 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4818 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4819 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4821 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__615, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4821, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4822 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4823 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMATCHINGLOW_Lookback()); - - /* "talib/func.pyx":4824 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4824, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4825 - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4826 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4827 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4828 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMATCHINGLOW(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4829 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4830 - * retCode = lib.TA_CDLMATCHINGLOW( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_117CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_116CDLMATHOLD[] = " CDLMATHOLD(open, high, low, close[, penetration=?])\n\n Mat Hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_117CDLMATHOLD = {"CDLMATHOLD", (PyCFunction)__pyx_pw_5talib_4func_117CDLMATHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_116CDLMATHOLD}; -static PyObject *__pyx_pw_5talib_4func_117CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMATHOLD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 1); __PYX_ERR(0, 4834, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 2); __PYX_ERR(0, 4834, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 3); __PYX_ERR(0, 4834, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATHOLD") < 0)) __PYX_ERR(0, 4834, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4834, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.5); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4834, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4834, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4834, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_116CDLMATHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_116CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLMATHOLD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4859 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4860 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__616, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4860, __pyx_L1_error) - - /* "talib/func.pyx":4859 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__617, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4862, __pyx_L1_error) - - /* "talib/func.pyx":4861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4864 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4864, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4865 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__618, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4867, __pyx_L1_error) - - /* "talib/func.pyx":4866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__619, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4869, __pyx_L1_error) - - /* "talib/func.pyx":4868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4871 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4871, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4872 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__620, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4874, __pyx_L1_error) - - /* "talib/func.pyx":4873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__621, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4876, __pyx_L1_error) - - /* "talib/func.pyx":4875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4878 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4878, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4879 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__622, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4881, __pyx_L1_error) - - /* "talib/func.pyx":4880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__623, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4883, __pyx_L1_error) - - /* "talib/func.pyx":4882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4885 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4885, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4886 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4887 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__624, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4889, __pyx_L1_error) - - /* "talib/func.pyx":4888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__625, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4891, __pyx_L1_error) - - /* "talib/func.pyx":4890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__626, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4893, __pyx_L1_error) - - /* "talib/func.pyx":4892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4894 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4895 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4896 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4897 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4898 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4897 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4899 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4900 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4901 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4900 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4902 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4903 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4904 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4903 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4905 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4906 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4907 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4906 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4908 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4909 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":4911 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__627, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4911, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":4912 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":4913 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMATHOLD_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":4914 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4914, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4915 - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":4916 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4917 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATHOLD", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":4918 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMATHOLD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMATHOLD(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":4919 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATHOLD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMATHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":4920 - * retCode = lib.TA_CDLMATHOLD( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMATHOLD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":4924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_119CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_118CDLMORNINGDOJISTAR[] = " CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Morning Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_119CDLMORNINGDOJISTAR = {"CDLMORNINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_4func_119CDLMORNINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_118CDLMORNINGDOJISTAR}; -static PyObject *__pyx_pw_5talib_4func_119CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(0, 4924, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(0, 4924, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(0, 4924, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGDOJISTAR") < 0)) __PYX_ERR(0, 4924, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4924, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4924, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4924, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_118CDLMORNINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_118CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":4949 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4950 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__628, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4950, __pyx_L1_error) - - /* "talib/func.pyx":4949 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":4951 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4952 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__629, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4952, __pyx_L1_error) - - /* "talib/func.pyx":4951 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4953 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4954 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4954, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4953 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":4955 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":4956 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4957 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__630, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4957, __pyx_L1_error) - - /* "talib/func.pyx":4956 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":4958 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4959 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__631, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4959, __pyx_L1_error) - - /* "talib/func.pyx":4958 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4960 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4961 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4961, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4960 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":4962 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":4963 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4964 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__632, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4964, __pyx_L1_error) - - /* "talib/func.pyx":4963 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":4965 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4966 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__633, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4966, __pyx_L1_error) - - /* "talib/func.pyx":4965 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4967 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4968 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4968, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4967 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":4969 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":4970 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4971 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__634, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4971, __pyx_L1_error) - - /* "talib/func.pyx":4970 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":4972 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4973 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__635, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4973, __pyx_L1_error) - - /* "talib/func.pyx":4972 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":4974 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4975 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4975, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":4974 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":4976 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":4977 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":4978 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4979 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__636, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4979, __pyx_L1_error) - - /* "talib/func.pyx":4978 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":4980 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4981 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__637, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4981, __pyx_L1_error) - - /* "talib/func.pyx":4980 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":4982 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4983 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__638, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4983, __pyx_L1_error) - - /* "talib/func.pyx":4982 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":4984 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":4985 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":4986 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":4987 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4988 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4987 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":4989 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":4990 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4991 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4990 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":4992 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":4993 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4994 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4993 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":4995 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":4996 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":4997 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":4996 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":4998 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":4999 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5001 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__639, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5001, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5002 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5003 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMORNINGDOJISTAR_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":5004 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5004, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5005 - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5006 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5007 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5008 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMORNINGDOJISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5009 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5010 - * retCode = lib.TA_CDLMORNINGDOJISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":4924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5014 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_121CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_120CDLMORNINGSTAR[] = " CDLMORNINGSTAR(open, high, low, close[, penetration=?])\n\n Morning Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_121CDLMORNINGSTAR = {"CDLMORNINGSTAR", (PyCFunction)__pyx_pw_5talib_4func_121CDLMORNINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_120CDLMORNINGSTAR}; -static PyObject *__pyx_pw_5talib_4func_121CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMORNINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 1); __PYX_ERR(0, 5014, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 2); __PYX_ERR(0, 5014, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 3); __PYX_ERR(0, 5014, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGSTAR") < 0)) __PYX_ERR(0, 5014, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5014, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5014, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5014, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5014, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5014, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5014, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_120CDLMORNINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_120CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLMORNINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5039 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5040 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__640, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5040, __pyx_L1_error) - - /* "talib/func.pyx":5039 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5041 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5042 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__641, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5042, __pyx_L1_error) - - /* "talib/func.pyx":5041 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5043 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5044 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5044, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5043 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5045 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5046 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5047 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__642, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5047, __pyx_L1_error) - - /* "talib/func.pyx":5046 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5048 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5049 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__643, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5049, __pyx_L1_error) - - /* "talib/func.pyx":5048 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5050 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5051 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5051, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5050 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5052 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5053 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5054 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__644, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5054, __pyx_L1_error) - - /* "talib/func.pyx":5053 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5055 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5056 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__645, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5056, __pyx_L1_error) - - /* "talib/func.pyx":5055 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5057 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5058 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5058, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5057 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5059 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5060 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5061 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__646, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5061, __pyx_L1_error) - - /* "talib/func.pyx":5060 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5062 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5063 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__647, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5063, __pyx_L1_error) - - /* "talib/func.pyx":5062 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5064 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5065 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5065, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5064 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5066 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5067 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5068 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5069 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__648, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5069, __pyx_L1_error) - - /* "talib/func.pyx":5068 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5070 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5071 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__649, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5071, __pyx_L1_error) - - /* "talib/func.pyx":5070 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5072 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5073 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__650, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5073, __pyx_L1_error) - - /* "talib/func.pyx":5072 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5074 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5075 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5076 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5077 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5078 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5077 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5079 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5080 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5081 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5080 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5082 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5083 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5084 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5083 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5085 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5086 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5087 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5086 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5088 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5089 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5091 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__651, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5091, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5092 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5093 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLMORNINGSTAR_Lookback(__pyx_v_penetration)); - - /* "talib/func.pyx":5094 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5094, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5095 - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5096 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5097 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5098 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMORNINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5099 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5100 - * retCode = lib.TA_CDLMORNINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , penetration , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5014 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5104 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_123CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_122CDLONNECK[] = " CDLONNECK(open, high, low, close)\n\n On-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_123CDLONNECK = {"CDLONNECK", (PyCFunction)__pyx_pw_5talib_4func_123CDLONNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_122CDLONNECK}; -static PyObject *__pyx_pw_5talib_4func_123CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLONNECK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 1); __PYX_ERR(0, 5104, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 2); __PYX_ERR(0, 5104, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 3); __PYX_ERR(0, 5104, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLONNECK") < 0)) __PYX_ERR(0, 5104, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5104, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5104, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_122CDLONNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_122CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLONNECK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5127 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5128 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__652, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5128, __pyx_L1_error) - - /* "talib/func.pyx":5127 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5129 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5130 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__653, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5130, __pyx_L1_error) - - /* "talib/func.pyx":5129 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5131 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5132 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5132, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5131 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5133 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5134 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5135 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__654, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5135, __pyx_L1_error) - - /* "talib/func.pyx":5134 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5136 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5137 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__655, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5137, __pyx_L1_error) - - /* "talib/func.pyx":5136 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5138 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5139 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5139, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5138 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5140 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5141 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5142 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__656, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5142, __pyx_L1_error) - - /* "talib/func.pyx":5141 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5143 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5144 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__657, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5144, __pyx_L1_error) - - /* "talib/func.pyx":5143 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5145 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5146 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5146, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5145 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5147 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5148 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5149 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__658, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5149, __pyx_L1_error) - - /* "talib/func.pyx":5148 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5150 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5151 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__659, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5151, __pyx_L1_error) - - /* "talib/func.pyx":5150 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5152 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5153 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5153, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5152 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5154 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5155 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5156 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5157 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__660, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5157, __pyx_L1_error) - - /* "talib/func.pyx":5156 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5158 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5159 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__661, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5159, __pyx_L1_error) - - /* "talib/func.pyx":5158 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5160 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5161 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__662, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5161, __pyx_L1_error) - - /* "talib/func.pyx":5160 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5162 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5163 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5164 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5165 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5166 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5165 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5167 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5168 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5169 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5168 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5170 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5171 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5172 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5171 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5173 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5174 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5175 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5174 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5176 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5177 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5179 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__663, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5179, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5180 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5181 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLONNECK_Lookback()); - - /* "talib/func.pyx":5182 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5182, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5183 - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5184 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5185 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLONNECK", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5186 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLONNECK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLONNECK(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5187 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLONNECK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLONNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5188 - * retCode = lib.TA_CDLONNECK( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLONNECK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5104 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5192 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_125CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_124CDLPIERCING[] = " CDLPIERCING(open, high, low, close)\n\n Piercing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_125CDLPIERCING = {"CDLPIERCING", (PyCFunction)__pyx_pw_5talib_4func_125CDLPIERCING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_124CDLPIERCING}; -static PyObject *__pyx_pw_5talib_4func_125CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLPIERCING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 1); __PYX_ERR(0, 5192, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 2); __PYX_ERR(0, 5192, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 3); __PYX_ERR(0, 5192, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLPIERCING") < 0)) __PYX_ERR(0, 5192, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5192, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5192, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5192, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5192, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5192, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_124CDLPIERCING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_124CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLPIERCING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5215 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5216 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__664, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5216, __pyx_L1_error) - - /* "talib/func.pyx":5215 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5217 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5218 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__665, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5218, __pyx_L1_error) - - /* "talib/func.pyx":5217 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5219 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5220 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5220, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5219 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5221 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5222 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5223 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__666, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5223, __pyx_L1_error) - - /* "talib/func.pyx":5222 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5224 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5225 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__667, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5225, __pyx_L1_error) - - /* "talib/func.pyx":5224 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5226 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5227 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5227, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5226 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5228 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5229 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5230 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__668, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5230, __pyx_L1_error) - - /* "talib/func.pyx":5229 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5231 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5232 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__669, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5232, __pyx_L1_error) - - /* "talib/func.pyx":5231 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5233 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5234 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5234, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5233 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5235 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5236 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5237 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__670, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5237, __pyx_L1_error) - - /* "talib/func.pyx":5236 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5238 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5239 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__671, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5239, __pyx_L1_error) - - /* "talib/func.pyx":5238 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5240 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5241 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5241, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5240 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5242 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5243 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5244 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5245 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__672, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5245, __pyx_L1_error) - - /* "talib/func.pyx":5244 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5246 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5247 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__673, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5247, __pyx_L1_error) - - /* "talib/func.pyx":5246 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5248 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5249 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__674, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5249, __pyx_L1_error) - - /* "talib/func.pyx":5248 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5250 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5251 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5252 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5253 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5254 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5253 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5255 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5256 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5257 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5256 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5258 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5259 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5260 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5259 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5261 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5262 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5263 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5262 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5264 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5265 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5267 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__675, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5267, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5268 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5269 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLPIERCING_Lookback()); - - /* "talib/func.pyx":5270 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5270, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5271 - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5272 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5273 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLPIERCING", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5274 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLPIERCING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLPIERCING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5275 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLPIERCING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLPIERCING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5276 - * retCode = lib.TA_CDLPIERCING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLPIERCING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5192 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5280 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_127CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_126CDLRICKSHAWMAN[] = " CDLRICKSHAWMAN(open, high, low, close)\n\n Rickshaw Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_127CDLRICKSHAWMAN = {"CDLRICKSHAWMAN", (PyCFunction)__pyx_pw_5talib_4func_127CDLRICKSHAWMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_126CDLRICKSHAWMAN}; -static PyObject *__pyx_pw_5talib_4func_127CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLRICKSHAWMAN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 1); __PYX_ERR(0, 5280, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 2); __PYX_ERR(0, 5280, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 3); __PYX_ERR(0, 5280, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRICKSHAWMAN") < 0)) __PYX_ERR(0, 5280, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5280, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5280, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5280, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5280, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5280, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_126CDLRICKSHAWMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_126CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLRICKSHAWMAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5303 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5304 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__676, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5304, __pyx_L1_error) - - /* "talib/func.pyx":5303 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5305 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5306 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__677, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5306, __pyx_L1_error) - - /* "talib/func.pyx":5305 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5307 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5308 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5308, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5307 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5309 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5310 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5311 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__678, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5311, __pyx_L1_error) - - /* "talib/func.pyx":5310 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5312 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5313 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__679, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5313, __pyx_L1_error) - - /* "talib/func.pyx":5312 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5314 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5315 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5315, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5314 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5316 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5317 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5318 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__680, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5318, __pyx_L1_error) - - /* "talib/func.pyx":5317 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5319 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5320 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__681, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5320, __pyx_L1_error) - - /* "talib/func.pyx":5319 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5321 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5322 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5322, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5321 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5323 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5324 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5325 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__682, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5325, __pyx_L1_error) - - /* "talib/func.pyx":5324 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5326 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5327 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__683, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5327, __pyx_L1_error) - - /* "talib/func.pyx":5326 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5328 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5329 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5329, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5328 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5330 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5331 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5332 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5333 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__684, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5333, __pyx_L1_error) - - /* "talib/func.pyx":5332 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5334 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5335 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__685, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5335, __pyx_L1_error) - - /* "talib/func.pyx":5334 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5336 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5337 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__686, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5337, __pyx_L1_error) - - /* "talib/func.pyx":5336 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5338 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5339 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5340 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5341 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5342 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5341 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5343 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5344 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5345 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5344 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5346 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5347 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5348 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5347 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5349 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5350 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5351 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5350 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5352 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5353 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5355 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__687, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5355, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5356 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5357 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLRICKSHAWMAN_Lookback()); - - /* "talib/func.pyx":5358 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5358, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5359 - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5360 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5361 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5362 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLRICKSHAWMAN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5363 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5364 - * retCode = lib.TA_CDLRICKSHAWMAN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5280 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5368 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_129CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_128CDLRISEFALL3METHODS[] = " CDLRISEFALL3METHODS(open, high, low, close)\n\n Rising/Falling Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_129CDLRISEFALL3METHODS = {"CDLRISEFALL3METHODS", (PyCFunction)__pyx_pw_5talib_4func_129CDLRISEFALL3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_128CDLRISEFALL3METHODS}; -static PyObject *__pyx_pw_5talib_4func_129CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 1); __PYX_ERR(0, 5368, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 2); __PYX_ERR(0, 5368, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 3); __PYX_ERR(0, 5368, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRISEFALL3METHODS") < 0)) __PYX_ERR(0, 5368, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5368, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5368, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5368, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5368, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5368, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_128CDLRISEFALL3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_128CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5391 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5392 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__688, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5392, __pyx_L1_error) - - /* "talib/func.pyx":5391 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5393 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5394 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__689, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5394, __pyx_L1_error) - - /* "talib/func.pyx":5393 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5395 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5396 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5396, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5395 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5397 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5398 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5399 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__690, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5399, __pyx_L1_error) - - /* "talib/func.pyx":5398 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5400 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5401 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__691, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5401, __pyx_L1_error) - - /* "talib/func.pyx":5400 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5402 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5403 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5403, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5402 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5404 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5405 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5406 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__692, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5406, __pyx_L1_error) - - /* "talib/func.pyx":5405 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5407 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5408 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__693, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5408, __pyx_L1_error) - - /* "talib/func.pyx":5407 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5409 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5410 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5410, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5409 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5411 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5412 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5413 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__694, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5413, __pyx_L1_error) - - /* "talib/func.pyx":5412 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5414 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5415 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__695, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5415, __pyx_L1_error) - - /* "talib/func.pyx":5414 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5416 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5417 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5417, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5416 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5418 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5419 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5420 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5421 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__696, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5421, __pyx_L1_error) - - /* "talib/func.pyx":5420 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5422 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5423 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__697, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5423, __pyx_L1_error) - - /* "talib/func.pyx":5422 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5424 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5425 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__698, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5425, __pyx_L1_error) - - /* "talib/func.pyx":5424 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5426 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5427 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5428 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5429 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5430 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5429 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5431 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5432 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5433 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5432 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5434 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5435 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5436 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5435 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5437 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5438 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5439 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5438 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5440 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5441 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5443 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__699, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5443, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5444 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5445 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLRISEFALL3METHODS_Lookback()); - - /* "talib/func.pyx":5446 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5446, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5447 - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5448 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5449 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5450 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLRISEFALL3METHODS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5451 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5452 - * retCode = lib.TA_CDLRISEFALL3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5368 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_131CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_130CDLSEPARATINGLINES[] = " CDLSEPARATINGLINES(open, high, low, close)\n\n Separating Lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_131CDLSEPARATINGLINES = {"CDLSEPARATINGLINES", (PyCFunction)__pyx_pw_5talib_4func_131CDLSEPARATINGLINES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_130CDLSEPARATINGLINES}; -static PyObject *__pyx_pw_5talib_4func_131CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSEPARATINGLINES (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 1); __PYX_ERR(0, 5456, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 2); __PYX_ERR(0, 5456, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 3); __PYX_ERR(0, 5456, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSEPARATINGLINES") < 0)) __PYX_ERR(0, 5456, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5456, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5456, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5456, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5456, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5456, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_130CDLSEPARATINGLINES(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_130CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSEPARATINGLINES", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5479 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5480 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__700, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5480, __pyx_L1_error) - - /* "talib/func.pyx":5479 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5481 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5482 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__701, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5482, __pyx_L1_error) - - /* "talib/func.pyx":5481 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5483 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5484 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5484, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5483 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5485 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5486 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5487 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__702, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5487, __pyx_L1_error) - - /* "talib/func.pyx":5486 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5488 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5489 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__703, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5489, __pyx_L1_error) - - /* "talib/func.pyx":5488 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5490 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5491 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5491, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5490 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5492 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5493 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5494 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__704, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5494, __pyx_L1_error) - - /* "talib/func.pyx":5493 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5495 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5496 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__705, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5496, __pyx_L1_error) - - /* "talib/func.pyx":5495 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5497 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5498 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5498, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5497 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5499 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5500 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5501 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__706, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5501, __pyx_L1_error) - - /* "talib/func.pyx":5500 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5502 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5503 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__707, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5503, __pyx_L1_error) - - /* "talib/func.pyx":5502 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5504 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5505 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5505, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5504 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5506 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5507 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5508 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5509 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__708, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5509, __pyx_L1_error) - - /* "talib/func.pyx":5508 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5510 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5511 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__709, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5511, __pyx_L1_error) - - /* "talib/func.pyx":5510 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5512 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5513 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__710, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5513, __pyx_L1_error) - - /* "talib/func.pyx":5512 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5514 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5515 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5516 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5517 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5518 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5517 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5519 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5520 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5521 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5520 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5522 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5523 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5524 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5523 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5525 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5526 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5527 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5526 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5528 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5529 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5531 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__711, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5531, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5532 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5533 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSEPARATINGLINES_Lookback()); - - /* "talib/func.pyx":5534 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5534, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5535 - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5536 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5537 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5538 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSEPARATINGLINES(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5539 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5540 - * retCode = lib.TA_CDLSEPARATINGLINES( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5544 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_133CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_132CDLSHOOTINGSTAR[] = " CDLSHOOTINGSTAR(open, high, low, close)\n\n Shooting Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_133CDLSHOOTINGSTAR = {"CDLSHOOTINGSTAR", (PyCFunction)__pyx_pw_5talib_4func_133CDLSHOOTINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_132CDLSHOOTINGSTAR}; -static PyObject *__pyx_pw_5talib_4func_133CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 1); __PYX_ERR(0, 5544, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 2); __PYX_ERR(0, 5544, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 3); __PYX_ERR(0, 5544, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHOOTINGSTAR") < 0)) __PYX_ERR(0, 5544, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5544, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5544, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5544, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5544, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5544, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_132CDLSHOOTINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_132CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5567 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5568 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__712, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5568, __pyx_L1_error) - - /* "talib/func.pyx":5567 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5569 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5570 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__713, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5570, __pyx_L1_error) - - /* "talib/func.pyx":5569 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5571 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5572 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5572, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5571 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5573 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5574 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5575 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__714, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5575, __pyx_L1_error) - - /* "talib/func.pyx":5574 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5576 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5577 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__715, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5577, __pyx_L1_error) - - /* "talib/func.pyx":5576 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5578 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5579 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5579, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5578 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5580 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5581 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5582 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5582, __pyx_L1_error) - - /* "talib/func.pyx":5581 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5583 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5584 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5584, __pyx_L1_error) - - /* "talib/func.pyx":5583 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5585 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5586 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5585 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5587 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5588 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5589 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5589, __pyx_L1_error) - - /* "talib/func.pyx":5588 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5590 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5591 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5591, __pyx_L1_error) - - /* "talib/func.pyx":5590 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5592 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5593 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5593, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5592 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5594 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5595 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5596 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5597 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5597, __pyx_L1_error) - - /* "talib/func.pyx":5596 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5598 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5599 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__721, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5599, __pyx_L1_error) - - /* "talib/func.pyx":5598 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5600 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5601 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__722, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5601, __pyx_L1_error) - - /* "talib/func.pyx":5600 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5602 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5603 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5604 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5605 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5606 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5605 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5607 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5608 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5609 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5608 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5610 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5611 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5612 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5611 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5613 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5614 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5615 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5614 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5616 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5617 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5619 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__723, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5619, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5620 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5621 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSHOOTINGSTAR_Lookback()); - - /* "talib/func.pyx":5622 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5622, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5623 - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5624 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5625 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5626 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSHOOTINGSTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5627 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5628 - * retCode = lib.TA_CDLSHOOTINGSTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5544 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5632 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_135CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_134CDLSHORTLINE[] = " CDLSHORTLINE(open, high, low, close)\n\n Short Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_135CDLSHORTLINE = {"CDLSHORTLINE", (PyCFunction)__pyx_pw_5talib_4func_135CDLSHORTLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_134CDLSHORTLINE}; -static PyObject *__pyx_pw_5talib_4func_135CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSHORTLINE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 1); __PYX_ERR(0, 5632, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 2); __PYX_ERR(0, 5632, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 3); __PYX_ERR(0, 5632, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHORTLINE") < 0)) __PYX_ERR(0, 5632, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5632, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5632, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_134CDLSHORTLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_134CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSHORTLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5655 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5656 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__724, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5656, __pyx_L1_error) - - /* "talib/func.pyx":5655 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5657 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5658 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__725, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5658, __pyx_L1_error) - - /* "talib/func.pyx":5657 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5659 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5660 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5660, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5659 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5661 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5662 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5663 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__726, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5663, __pyx_L1_error) - - /* "talib/func.pyx":5662 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5664 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5665 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__727, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5665, __pyx_L1_error) - - /* "talib/func.pyx":5664 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5666 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5667 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5667, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5666 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5668 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5669 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5670 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__728, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5670, __pyx_L1_error) - - /* "talib/func.pyx":5669 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5671 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5672 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__729, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5672, __pyx_L1_error) - - /* "talib/func.pyx":5671 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5673 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5674 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5674, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5673 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5675 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5676 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5677 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__730, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5677, __pyx_L1_error) - - /* "talib/func.pyx":5676 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5678 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5679 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__731, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5679, __pyx_L1_error) - - /* "talib/func.pyx":5678 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5680 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5681 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5680 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5682 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5683 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5684 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5685 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__732, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5685, __pyx_L1_error) - - /* "talib/func.pyx":5684 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5686 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5687 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__733, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5687, __pyx_L1_error) - - /* "talib/func.pyx":5686 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5688 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5689 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__734, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5689, __pyx_L1_error) - - /* "talib/func.pyx":5688 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5690 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5691 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5692 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5693 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5694 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5693 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5695 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5696 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5697 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5696 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5698 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5699 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5700 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5699 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5701 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5702 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5703 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5702 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5704 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5705 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5707 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__735, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5707, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5708 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5709 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSHORTLINE_Lookback()); - - /* "talib/func.pyx":5710 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5710, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5711 - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5712 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5713 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5714 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSHORTLINE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSHORTLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5715 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSHORTLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5716 - * retCode = lib.TA_CDLSHORTLINE( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5632 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5720 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_137CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_136CDLSPINNINGTOP[] = " CDLSPINNINGTOP(open, high, low, close)\n\n Spinning Top (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_137CDLSPINNINGTOP = {"CDLSPINNINGTOP", (PyCFunction)__pyx_pw_5talib_4func_137CDLSPINNINGTOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_136CDLSPINNINGTOP}; -static PyObject *__pyx_pw_5talib_4func_137CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSPINNINGTOP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 1); __PYX_ERR(0, 5720, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 2); __PYX_ERR(0, 5720, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 3); __PYX_ERR(0, 5720, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSPINNINGTOP") < 0)) __PYX_ERR(0, 5720, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5720, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5720, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5720, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5720, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5720, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_136CDLSPINNINGTOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_136CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSPINNINGTOP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5743 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5744 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__736, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5744, __pyx_L1_error) - - /* "talib/func.pyx":5743 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5745 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5746 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__737, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5746, __pyx_L1_error) - - /* "talib/func.pyx":5745 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5747 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5748 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5748, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5747 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5749 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5750 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5751 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__738, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5751, __pyx_L1_error) - - /* "talib/func.pyx":5750 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5752 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5753 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__739, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5753, __pyx_L1_error) - - /* "talib/func.pyx":5752 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5754 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5755 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5755, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5754 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5756 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5757 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5758 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__740, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5758, __pyx_L1_error) - - /* "talib/func.pyx":5757 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5759 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5760 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__741, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5760, __pyx_L1_error) - - /* "talib/func.pyx":5759 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5761 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5762 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5762, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5761 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5763 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5764 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5765 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__742, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5765, __pyx_L1_error) - - /* "talib/func.pyx":5764 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5766 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5767 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__743, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5767, __pyx_L1_error) - - /* "talib/func.pyx":5766 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5768 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5769 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5769, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5768 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5770 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5771 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5772 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5773 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__744, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5773, __pyx_L1_error) - - /* "talib/func.pyx":5772 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5774 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5775 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__745, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5775, __pyx_L1_error) - - /* "talib/func.pyx":5774 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5776 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5777 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__746, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5777, __pyx_L1_error) - - /* "talib/func.pyx":5776 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5778 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5779 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5780 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5781 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5782 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5781 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5783 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5784 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5785 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5784 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5786 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5787 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5788 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5787 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5789 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5790 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5791 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5790 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5792 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5793 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5795 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__747, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5795, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5796 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5797 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSPINNINGTOP_Lookback()); - - /* "talib/func.pyx":5798 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5798, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5799 - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5800 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5801 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5802 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSPINNINGTOP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5803 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5804 - * retCode = lib.TA_CDLSPINNINGTOP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5720 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5808 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_139CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_138CDLSTALLEDPATTERN[] = " CDLSTALLEDPATTERN(open, high, low, close)\n\n Stalled Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_139CDLSTALLEDPATTERN = {"CDLSTALLEDPATTERN", (PyCFunction)__pyx_pw_5talib_4func_139CDLSTALLEDPATTERN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_138CDLSTALLEDPATTERN}; -static PyObject *__pyx_pw_5talib_4func_139CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 1); __PYX_ERR(0, 5808, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 2); __PYX_ERR(0, 5808, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 3); __PYX_ERR(0, 5808, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTALLEDPATTERN") < 0)) __PYX_ERR(0, 5808, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5808, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5808, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5808, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5808, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5808, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_138CDLSTALLEDPATTERN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_138CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5831 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5832 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__748, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5832, __pyx_L1_error) - - /* "talib/func.pyx":5831 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5833 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5834 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__749, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5834, __pyx_L1_error) - - /* "talib/func.pyx":5833 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5835 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5836 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5836, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5835 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5837 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5838 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5839 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__750, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5839, __pyx_L1_error) - - /* "talib/func.pyx":5838 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5840 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5841 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__751, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5841, __pyx_L1_error) - - /* "talib/func.pyx":5840 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5842 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5843 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5843, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5842 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5844 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5845 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5846 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__752, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5846, __pyx_L1_error) - - /* "talib/func.pyx":5845 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5847 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5848 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__753, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5848, __pyx_L1_error) - - /* "talib/func.pyx":5847 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5849 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5850 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5850, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5849 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5851 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5852 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5853 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__754, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5853, __pyx_L1_error) - - /* "talib/func.pyx":5852 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5854 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5855 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__755, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5855, __pyx_L1_error) - - /* "talib/func.pyx":5854 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5856 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5857 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5857, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5857, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5856 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5858 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5859 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5860 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5861 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__756, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5861, __pyx_L1_error) - - /* "talib/func.pyx":5860 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5862 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5863 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__757, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5863, __pyx_L1_error) - - /* "talib/func.pyx":5862 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5864 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5865 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__758, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5865, __pyx_L1_error) - - /* "talib/func.pyx":5864 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5866 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5867 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5868 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5869 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5870 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5869 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5871 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5872 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5873 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5872 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5874 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5875 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5876 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5875 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5877 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5878 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5879 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5878 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5880 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5881 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5883 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__759, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5883, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5884 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5885 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSTALLEDPATTERN_Lookback()); - - /* "talib/func.pyx":5886 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5886, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5887 - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5888 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5889 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5890 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSTALLEDPATTERN(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5891 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5892 - * retCode = lib.TA_CDLSTALLEDPATTERN( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5808 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5896 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_141CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_140CDLSTICKSANDWICH[] = " CDLSTICKSANDWICH(open, high, low, close)\n\n Stick Sandwich (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_141CDLSTICKSANDWICH = {"CDLSTICKSANDWICH", (PyCFunction)__pyx_pw_5talib_4func_141CDLSTICKSANDWICH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_140CDLSTICKSANDWICH}; -static PyObject *__pyx_pw_5talib_4func_141CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSTICKSANDWICH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 1); __PYX_ERR(0, 5896, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 2); __PYX_ERR(0, 5896, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 3); __PYX_ERR(0, 5896, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTICKSANDWICH") < 0)) __PYX_ERR(0, 5896, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5896, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5896, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5896, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5896, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5896, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_140CDLSTICKSANDWICH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_140CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLSTICKSANDWICH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":5919 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5920 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__760, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5920, __pyx_L1_error) - - /* "talib/func.pyx":5919 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":5921 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5922 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__761, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5922, __pyx_L1_error) - - /* "talib/func.pyx":5921 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5923 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5924 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5924, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5923 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":5925 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":5926 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5927 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__762, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5927, __pyx_L1_error) - - /* "talib/func.pyx":5926 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":5928 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5929 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__763, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5929, __pyx_L1_error) - - /* "talib/func.pyx":5928 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5930 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5931 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5931, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5930 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":5932 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":5933 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5934 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__764, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5934, __pyx_L1_error) - - /* "talib/func.pyx":5933 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":5935 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5936 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__765, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5936, __pyx_L1_error) - - /* "talib/func.pyx":5935 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5937 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5938 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5938, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5937 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":5939 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":5940 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5941 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__766, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5941, __pyx_L1_error) - - /* "talib/func.pyx":5940 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":5942 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5943 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__767, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5943, __pyx_L1_error) - - /* "talib/func.pyx":5942 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":5944 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5945 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5945, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5944 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":5946 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":5947 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":5948 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5949 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__768, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5949, __pyx_L1_error) - - /* "talib/func.pyx":5948 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":5950 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5951 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__769, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5951, __pyx_L1_error) - - /* "talib/func.pyx":5950 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":5952 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5953 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__770, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5953, __pyx_L1_error) - - /* "talib/func.pyx":5952 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":5954 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":5955 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5956 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":5957 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5958 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5957 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":5959 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":5960 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5961 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5960 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":5962 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":5963 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5964 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5963 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":5965 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":5966 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":5967 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":5966 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":5968 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":5969 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":5971 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__771, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5971, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":5972 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":5973 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLSTICKSANDWICH_Lookback()); - - /* "talib/func.pyx":5974 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5974, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":5975 - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":5976 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":5977 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":5978 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSTICKSANDWICH(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":5979 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":5980 - * retCode = lib.TA_CDLSTICKSANDWICH( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5896 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":5984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_143CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_142CDLTAKURI[] = " CDLTAKURI(open, high, low, close)\n\n Takuri (Dragonfly Doji with very long lower shadow) (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_143CDLTAKURI = {"CDLTAKURI", (PyCFunction)__pyx_pw_5talib_4func_143CDLTAKURI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_142CDLTAKURI}; -static PyObject *__pyx_pw_5talib_4func_143CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTAKURI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 1); __PYX_ERR(0, 5984, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 2); __PYX_ERR(0, 5984, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 3); __PYX_ERR(0, 5984, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTAKURI") < 0)) __PYX_ERR(0, 5984, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5984, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 5984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5984, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5984, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_142CDLTAKURI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_142CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLTAKURI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6007 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6008 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__772, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6008, __pyx_L1_error) - - /* "talib/func.pyx":6007 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6009 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6010 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__773, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6010, __pyx_L1_error) - - /* "talib/func.pyx":6009 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6011 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6012 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6012, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6011 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6013 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6014 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6015 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__774, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6015, __pyx_L1_error) - - /* "talib/func.pyx":6014 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6016 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6017 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__775, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6017, __pyx_L1_error) - - /* "talib/func.pyx":6016 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6018 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6019 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6019, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6018 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6020 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6021 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6022 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__776, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6022, __pyx_L1_error) - - /* "talib/func.pyx":6021 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6023 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6024 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__777, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6024, __pyx_L1_error) - - /* "talib/func.pyx":6023 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6025 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6026 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6026, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6025 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6027 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6028 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6029 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__778, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6029, __pyx_L1_error) - - /* "talib/func.pyx":6028 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6030 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6031 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__779, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6031, __pyx_L1_error) - - /* "talib/func.pyx":6030 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6032 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6033 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6033, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6032 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6034 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6035 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6036 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6037 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__780, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6037, __pyx_L1_error) - - /* "talib/func.pyx":6036 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6038 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6039 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__781, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6039, __pyx_L1_error) - - /* "talib/func.pyx":6038 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6040 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6041 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__782, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6041, __pyx_L1_error) - - /* "talib/func.pyx":6040 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6042 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6043 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6044 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6045 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6046 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6045 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6047 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6048 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6049 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6048 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6050 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6051 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6052 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6051 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6053 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6054 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6055 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6054 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6056 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6057 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6059 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__783, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6059, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6060 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6061 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTAKURI_Lookback()); - - /* "talib/func.pyx":6062 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6062, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6062, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6063 - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6064 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6065 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTAKURI", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6066 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTAKURI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTAKURI(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6067 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTAKURI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTAKURI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6068 - * retCode = lib.TA_CDLTAKURI( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTAKURI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":5984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6072 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_145CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_144CDLTASUKIGAP[] = " CDLTASUKIGAP(open, high, low, close)\n\n Tasuki Gap (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_145CDLTASUKIGAP = {"CDLTASUKIGAP", (PyCFunction)__pyx_pw_5talib_4func_145CDLTASUKIGAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_144CDLTASUKIGAP}; -static PyObject *__pyx_pw_5talib_4func_145CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTASUKIGAP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 1); __PYX_ERR(0, 6072, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 2); __PYX_ERR(0, 6072, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 3); __PYX_ERR(0, 6072, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTASUKIGAP") < 0)) __PYX_ERR(0, 6072, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6072, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6072, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6072, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6072, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6072, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_144CDLTASUKIGAP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_144CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLTASUKIGAP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6095 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6096 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__784, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6096, __pyx_L1_error) - - /* "talib/func.pyx":6095 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6097 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6098 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__785, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6098, __pyx_L1_error) - - /* "talib/func.pyx":6097 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6099 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6100 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6100, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6099 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6101 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6102 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6103 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__786, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6103, __pyx_L1_error) - - /* "talib/func.pyx":6102 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6104 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6105 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__787, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6105, __pyx_L1_error) - - /* "talib/func.pyx":6104 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6106 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6107 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6107, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6106 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6108 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6109 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6110 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__788, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6110, __pyx_L1_error) - - /* "talib/func.pyx":6109 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6111 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6112 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__789, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6112, __pyx_L1_error) - - /* "talib/func.pyx":6111 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6113 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6114 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6114, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6113 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6115 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6116 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6117 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__790, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6117, __pyx_L1_error) - - /* "talib/func.pyx":6116 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6118 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6119 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__791, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6119, __pyx_L1_error) - - /* "talib/func.pyx":6118 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6120 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6121 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6121, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6120 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6122 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6123 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6124 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6125 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__792, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6125, __pyx_L1_error) - - /* "talib/func.pyx":6124 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6126 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6127 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__793, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6127, __pyx_L1_error) - - /* "talib/func.pyx":6126 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6128 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6129 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__794, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6129, __pyx_L1_error) - - /* "talib/func.pyx":6128 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6130 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6131 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6132 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6133 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6134 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6133 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6135 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6136 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6137 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6136 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6138 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6139 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6140 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6139 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6141 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6142 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6143 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6142 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6144 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6145 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6147 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__795, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6147, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6148 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6149 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTASUKIGAP_Lookback()); - - /* "talib/func.pyx":6150 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6150, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6151 - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6152 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6153 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6154 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTASUKIGAP(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6155 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTASUKIGAP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6156 - * retCode = lib.TA_CDLTASUKIGAP( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6072 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6160 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_147CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_146CDLTHRUSTING[] = " CDLTHRUSTING(open, high, low, close)\n\n Thrusting Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_147CDLTHRUSTING = {"CDLTHRUSTING", (PyCFunction)__pyx_pw_5talib_4func_147CDLTHRUSTING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_146CDLTHRUSTING}; -static PyObject *__pyx_pw_5talib_4func_147CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTHRUSTING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 1); __PYX_ERR(0, 6160, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 2); __PYX_ERR(0, 6160, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 3); __PYX_ERR(0, 6160, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTHRUSTING") < 0)) __PYX_ERR(0, 6160, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6160, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6160, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6160, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6160, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6160, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_146CDLTHRUSTING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_146CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLTHRUSTING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6183 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6184 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__796, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6184, __pyx_L1_error) - - /* "talib/func.pyx":6183 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6185 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6186 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__797, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6186, __pyx_L1_error) - - /* "talib/func.pyx":6185 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6187 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6188 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6188, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6187 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6189 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6190 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6191 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__798, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6191, __pyx_L1_error) - - /* "talib/func.pyx":6190 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6192 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6193 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__799, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6193, __pyx_L1_error) - - /* "talib/func.pyx":6192 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6194 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6195 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6195, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6194 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6196 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6197 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6198 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__800, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6198, __pyx_L1_error) - - /* "talib/func.pyx":6197 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6199 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6200 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__801, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6200, __pyx_L1_error) - - /* "talib/func.pyx":6199 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6201 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6202 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6202, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6201 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6203 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6204 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6205 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__802, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6205, __pyx_L1_error) - - /* "talib/func.pyx":6204 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6206 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6207 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__803, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6207, __pyx_L1_error) - - /* "talib/func.pyx":6206 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6208 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6209 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6209, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6208 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6210 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6211 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6212 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6213 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__804, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6213, __pyx_L1_error) - - /* "talib/func.pyx":6212 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6214 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6215 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__805, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6215, __pyx_L1_error) - - /* "talib/func.pyx":6214 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6216 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6217 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__806, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6217, __pyx_L1_error) - - /* "talib/func.pyx":6216 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6218 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6219 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6220 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6221 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6222 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6221 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6223 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6224 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6225 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6224 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6226 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6227 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6228 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6227 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6229 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6230 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6231 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6230 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6232 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6233 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6235 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__807, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6235, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6236 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6237 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTHRUSTING_Lookback()); - - /* "talib/func.pyx":6238 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6238, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6239 - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6240 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6241 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6242 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTHRUSTING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTHRUSTING(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6243 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTHRUSTING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6244 - * retCode = lib.TA_CDLTHRUSTING( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6160 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6248 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_149CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_148CDLTRISTAR[] = " CDLTRISTAR(open, high, low, close)\n\n Tristar Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_149CDLTRISTAR = {"CDLTRISTAR", (PyCFunction)__pyx_pw_5talib_4func_149CDLTRISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_148CDLTRISTAR}; -static PyObject *__pyx_pw_5talib_4func_149CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTRISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 1); __PYX_ERR(0, 6248, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 2); __PYX_ERR(0, 6248, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 3); __PYX_ERR(0, 6248, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTRISTAR") < 0)) __PYX_ERR(0, 6248, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6248, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6248, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6248, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6248, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6248, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_148CDLTRISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_148CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLTRISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6271 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6272 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__808, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6272, __pyx_L1_error) - - /* "talib/func.pyx":6271 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6273 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6274 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__809, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6274, __pyx_L1_error) - - /* "talib/func.pyx":6273 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6275 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6276 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6276, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6275 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6277 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6278 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6279 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__810, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6279, __pyx_L1_error) - - /* "talib/func.pyx":6278 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6280 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6281 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__811, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6281, __pyx_L1_error) - - /* "talib/func.pyx":6280 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6282 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6283 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6283, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6282 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6284 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6285 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6286 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__812, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6286, __pyx_L1_error) - - /* "talib/func.pyx":6285 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6287 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6288 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__813, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6288, __pyx_L1_error) - - /* "talib/func.pyx":6287 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6289 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6290 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6290, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6289 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6291 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6292 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6293 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__814, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6293, __pyx_L1_error) - - /* "talib/func.pyx":6292 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6294 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6295 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__815, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6295, __pyx_L1_error) - - /* "talib/func.pyx":6294 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6296 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6297 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6297, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6296 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6298 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6299 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6300 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6301 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__816, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6301, __pyx_L1_error) - - /* "talib/func.pyx":6300 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6302 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6303 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__817, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6303, __pyx_L1_error) - - /* "talib/func.pyx":6302 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6304 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6305 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__818, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6305, __pyx_L1_error) - - /* "talib/func.pyx":6304 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6306 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6307 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6308 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6309 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6310 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6309 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6311 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6312 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6313 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6312 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6314 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6315 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6316 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6315 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6317 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6318 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6319 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6318 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6320 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6321 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6323 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__819, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6323, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6324 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6325 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLTRISTAR_Lookback()); - - /* "talib/func.pyx":6326 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6326, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6327 - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6328 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6329 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTRISTAR", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6330 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTRISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTRISTAR(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6331 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTRISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTRISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6332 - * retCode = lib.TA_CDLTRISTAR( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLTRISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6248 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6336 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_151CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_150CDLUNIQUE3RIVER[] = " CDLUNIQUE3RIVER(open, high, low, close)\n\n Unique 3 River (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_151CDLUNIQUE3RIVER = {"CDLUNIQUE3RIVER", (PyCFunction)__pyx_pw_5talib_4func_151CDLUNIQUE3RIVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_150CDLUNIQUE3RIVER}; -static PyObject *__pyx_pw_5talib_4func_151CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 1); __PYX_ERR(0, 6336, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 2); __PYX_ERR(0, 6336, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 3); __PYX_ERR(0, 6336, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUNIQUE3RIVER") < 0)) __PYX_ERR(0, 6336, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6336, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6336, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6336, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6336, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6336, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_150CDLUNIQUE3RIVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_150CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6359 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6360 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__820, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6360, __pyx_L1_error) - - /* "talib/func.pyx":6359 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6361 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6362 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__821, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6362, __pyx_L1_error) - - /* "talib/func.pyx":6361 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6363 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6364 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6364, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6363 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6365 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6366 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6367 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__822, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6367, __pyx_L1_error) - - /* "talib/func.pyx":6366 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6368 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6369 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__823, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6369, __pyx_L1_error) - - /* "talib/func.pyx":6368 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6370 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6371 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6371, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6370 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6372 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6373 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6374 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__824, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6374, __pyx_L1_error) - - /* "talib/func.pyx":6373 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6375 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6376 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__825, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6376, __pyx_L1_error) - - /* "talib/func.pyx":6375 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6377 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6378 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6378, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6377 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6379 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6380 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6381 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__826, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6381, __pyx_L1_error) - - /* "talib/func.pyx":6380 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6382 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6383 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__827, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6383, __pyx_L1_error) - - /* "talib/func.pyx":6382 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6384 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6385 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6385, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6384 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6386 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6387 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6388 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6389 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__828, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6389, __pyx_L1_error) - - /* "talib/func.pyx":6388 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6390 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6391 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__829, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6391, __pyx_L1_error) - - /* "talib/func.pyx":6390 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6392 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6393 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__830, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6393, __pyx_L1_error) - - /* "talib/func.pyx":6392 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6394 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6395 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6396 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6397 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6398 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6397 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6399 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6400 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6401 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6400 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6402 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6403 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6404 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6403 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6405 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6406 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6407 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6406 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6408 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6409 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6411 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__831, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6411, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6412 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6413 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLUNIQUE3RIVER_Lookback()); - - /* "talib/func.pyx":6414 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6414, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6415 - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6416 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6417 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6418 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLUNIQUE3RIVER(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6419 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6420 - * retCode = lib.TA_CDLUNIQUE3RIVER( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6336 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6424 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_153CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_152CDLUPSIDEGAP2CROWS[] = " CDLUPSIDEGAP2CROWS(open, high, low, close)\n\n Upside Gap Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_153CDLUPSIDEGAP2CROWS = {"CDLUPSIDEGAP2CROWS", (PyCFunction)__pyx_pw_5talib_4func_153CDLUPSIDEGAP2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_152CDLUPSIDEGAP2CROWS}; -static PyObject *__pyx_pw_5talib_4func_153CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 1); __PYX_ERR(0, 6424, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 2); __PYX_ERR(0, 6424, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 3); __PYX_ERR(0, 6424, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUPSIDEGAP2CROWS") < 0)) __PYX_ERR(0, 6424, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6424, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6424, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6424, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6424, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6424, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_152CDLUPSIDEGAP2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_152CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6447 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6448 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__832, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6448, __pyx_L1_error) - - /* "talib/func.pyx":6447 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6449 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6450 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__833, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6450, __pyx_L1_error) - - /* "talib/func.pyx":6449 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6451 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6452 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6452, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6451 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6453 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6454 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6455 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__834, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6455, __pyx_L1_error) - - /* "talib/func.pyx":6454 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6456 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6457 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__835, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6457, __pyx_L1_error) - - /* "talib/func.pyx":6456 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6458 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6459 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6459, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6458 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6460 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6461 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6462 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__836, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6462, __pyx_L1_error) - - /* "talib/func.pyx":6461 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6463 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6464 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__837, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6464, __pyx_L1_error) - - /* "talib/func.pyx":6463 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6465 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6466 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6466, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6465 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6467 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6468 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6469 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__838, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6469, __pyx_L1_error) - - /* "talib/func.pyx":6468 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6470 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6471 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__839, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6471, __pyx_L1_error) - - /* "talib/func.pyx":6470 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6472 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6473 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6473, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6472 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6474 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6475 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6476 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6477 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__840, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6477, __pyx_L1_error) - - /* "talib/func.pyx":6476 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6478 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6479 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__841, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6479, __pyx_L1_error) - - /* "talib/func.pyx":6478 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6480 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6481 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__842, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6481, __pyx_L1_error) - - /* "talib/func.pyx":6480 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6482 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6483 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6484 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6485 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6486 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6485 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6487 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6488 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6489 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6488 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6490 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6491 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6492 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6491 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6493 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6494 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6495 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6494 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6496 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6497 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6499 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__843, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6499, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6500 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6501 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLUPSIDEGAP2CROWS_Lookback()); - - /* "talib/func.pyx":6502 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6502, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6503 - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6504 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6505 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6506 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLUPSIDEGAP2CROWS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6507 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6508 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6424 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6512 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_155CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_154CDLXSIDEGAP3METHODS[] = " CDLXSIDEGAP3METHODS(open, high, low, close)\n\n Upside/Downside Gap Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_155CDLXSIDEGAP3METHODS = {"CDLXSIDEGAP3METHODS", (PyCFunction)__pyx_pw_5talib_4func_155CDLXSIDEGAP3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_154CDLXSIDEGAP3METHODS}; -static PyObject *__pyx_pw_5talib_4func_155CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 1); __PYX_ERR(0, 6512, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 2); __PYX_ERR(0, 6512, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 3); __PYX_ERR(0, 6512, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLXSIDEGAP3METHODS") < 0)) __PYX_ERR(0, 6512, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6512, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 6512, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6512, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6512, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6512, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_154CDLXSIDEGAP3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_154CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":6535 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6536 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__844, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6536, __pyx_L1_error) - - /* "talib/func.pyx":6535 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/func.pyx":6537 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6538 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__845, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6538, __pyx_L1_error) - - /* "talib/func.pyx":6537 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6539 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6540 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6540, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6539 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/func.pyx":6541 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/func.pyx":6542 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6543 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__846, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6543, __pyx_L1_error) - - /* "talib/func.pyx":6542 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":6544 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6545 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__847, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6545, __pyx_L1_error) - - /* "talib/func.pyx":6544 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6546 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6547 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6547, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6546 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":6548 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":6549 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6550 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__848, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6550, __pyx_L1_error) - - /* "talib/func.pyx":6549 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":6551 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6552 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__849, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6552, __pyx_L1_error) - - /* "talib/func.pyx":6551 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6553 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6554 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6554, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6553 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":6555 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":6556 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6557 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__850, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6557, __pyx_L1_error) - - /* "talib/func.pyx":6556 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":6558 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6559 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__851, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6559, __pyx_L1_error) - - /* "talib/func.pyx":6558 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6560 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6561 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6561, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6560 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":6562 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":6563 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/func.pyx":6564 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6565 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__852, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6565, __pyx_L1_error) - - /* "talib/func.pyx":6564 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/func.pyx":6566 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6567 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__853, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6567, __pyx_L1_error) - - /* "talib/func.pyx":6566 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":6568 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6569 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__854, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6569, __pyx_L1_error) - - /* "talib/func.pyx":6568 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6570 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = open_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6571 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = open_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6572 - * begidx = 0 - * for i from 0 <= i < length: - * val = open_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_open_data[__pyx_v_i]); - - /* "talib/func.pyx":6573 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6574 - * val = open_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6573 - * for i from 0 <= i < length: - * val = open_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = high_data[i] - */ - } - - /* "talib/func.pyx":6575 - * if val != val: - * continue - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":6576 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6577 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6576 - * continue - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":6578 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":6579 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6580 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6579 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":6581 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":6582 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6583 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":6582 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6584 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6585 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6587 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__855, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6587, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":6588 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6589 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CDLXSIDEGAP3METHODS_Lookback()); - - /* "talib/func.pyx":6590 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6590, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6591 - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":6592 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6593 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":6594 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLXSIDEGAP3METHODS(0, __pyx_v_endidx, ((double *)(__pyx_v_open_data + __pyx_v_begidx)), ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6595 - * outinteger_data[i] = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6596 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( 0 , endidx , (open_data+begidx) , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":6512 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6600 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_157CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_156CEIL[] = " CEIL(real)\n\n Vector Ceil (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_157CEIL = {"CEIL", (PyCFunction)__pyx_pw_5talib_4func_157CEIL, METH_O, __pyx_doc_5talib_4func_156CEIL}; -static PyObject *__pyx_pw_5talib_4func_157CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CEIL (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6600, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_156CEIL(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_156CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CEIL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":6620 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6621 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__856, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6621, __pyx_L1_error) - - /* "talib/func.pyx":6620 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":6622 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6623 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__857, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6623, __pyx_L1_error) - - /* "talib/func.pyx":6622 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6624 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6625 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6625, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6624 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":6626 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":6627 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":6628 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6629 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6630 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":6631 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6632 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":6631 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6633 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6634 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6636 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CEIL_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__858, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6636, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":6637 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CEIL_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6638 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CEIL_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CEIL_Lookback()); - - /* "talib/func.pyx":6639 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CEIL_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6639, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6640 - * lookback = begidx + lib.TA_CEIL_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6641 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6642 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CEIL", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6643 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CEIL", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CEIL(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6644 - * outreal_data[i] = NaN - * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CEIL", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CEIL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6645 - * retCode = lib.TA_CEIL( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CEIL", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6600 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CEIL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_159CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_158CMO[] = " CMO(real[, timeperiod=?])\n\n Chande Momentum Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_159CMO = {"CMO", (PyCFunction)__pyx_pw_5talib_4func_159CMO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_158CMO}; -static PyObject *__pyx_pw_5talib_4func_159CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CMO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CMO") < 0)) __PYX_ERR(0, 6649, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6649, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CMO", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6649, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6649, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_158CMO(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_158CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CMO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":6671 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6672 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__859, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6672, __pyx_L1_error) - - /* "talib/func.pyx":6671 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":6673 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6674 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__860, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6674, __pyx_L1_error) - - /* "talib/func.pyx":6673 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6675 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6676 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6676, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6675 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":6677 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":6678 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":6679 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6680 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6681 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":6682 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6683 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":6682 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6684 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6685 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6687 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__861, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6687, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":6688 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6689 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CMO_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":6690 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6690, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6691 - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6692 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6693 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CMO", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6694 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CMO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CMO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6695 - * outreal_data[i] = NaN - * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CMO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CMO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6696 - * retCode = lib.TA_CMO( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CMO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6700 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_161CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_160CORREL[] = " CORREL(real0, real1[, timeperiod=?])\n\n Pearson's Correlation Coefficient (r) (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_161CORREL = {"CORREL", (PyCFunction)__pyx_pw_5talib_4func_161CORREL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_160CORREL}; -static PyObject *__pyx_pw_5talib_4func_161CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CORREL (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, 1); __PYX_ERR(0, 6700, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CORREL") < 0)) __PYX_ERR(0, 6700, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6700, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6700, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 6700, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 6700, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_160CORREL(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_160CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("CORREL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":6724 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6725 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__862, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6725, __pyx_L1_error) - - /* "talib/func.pyx":6724 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":6726 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6727 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__863, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6727, __pyx_L1_error) - - /* "talib/func.pyx":6726 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6728 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6729 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6729, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6728 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":6730 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":6731 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6732 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__864, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6732, __pyx_L1_error) - - /* "talib/func.pyx":6731 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":6733 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6734 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__865, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6734, __pyx_L1_error) - - /* "talib/func.pyx":6733 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6735 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6736 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6736, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6735 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":6737 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":6738 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":6739 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6740 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__866, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6740, __pyx_L1_error) - - /* "talib/func.pyx":6739 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6741 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6742 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6743 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":6744 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6745 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":6744 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":6746 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":6747 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6748 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":6747 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6749 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6750 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6752 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__867, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6752, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":6753 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6754 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_CORREL_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":6755 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6755, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6756 - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6757 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6758 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CORREL", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6759 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CORREL", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CORREL(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6760 - * outreal_data[i] = NaN - * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CORREL", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CORREL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6761 - * retCode = lib.TA_CORREL( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_CORREL", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6700 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6765 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_163COS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_162COS[] = " COS(real)\n\n Vector Trigonometric Cos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_163COS = {"COS", (PyCFunction)__pyx_pw_5talib_4func_163COS, METH_O, __pyx_doc_5talib_4func_162COS}; -static PyObject *__pyx_pw_5talib_4func_163COS(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("COS (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6765, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_162COS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_162COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("COS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":6785 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6786 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__868, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6786, __pyx_L1_error) - - /* "talib/func.pyx":6785 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":6787 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6788 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__869, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6788, __pyx_L1_error) - - /* "talib/func.pyx":6787 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6789 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6790 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6790, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6789 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":6791 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":6792 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":6793 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6794 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6795 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":6796 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6797 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":6796 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6798 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6799 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6801 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COS_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__870, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6801, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":6802 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_COS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6803 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COS_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_COS_Lookback()); - - /* "talib/func.pyx":6804 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6804, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6805 - * lookback = begidx + lib.TA_COS_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6806 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6807 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COS", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6808 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_COS", retCode) - * return outreal - */ - __pyx_v_retCode = TA_COS(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6809 - * outreal_data[i] = NaN - * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COS", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_COS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6810 - * retCode = lib.TA_COS( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COS", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6765 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.COS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_165COSH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_164COSH[] = " COSH(real)\n\n Vector Trigonometric Cosh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_165COSH = {"COSH", (PyCFunction)__pyx_pw_5talib_4func_165COSH, METH_O, __pyx_doc_5talib_4func_164COSH}; -static PyObject *__pyx_pw_5talib_4func_165COSH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("COSH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6814, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_164COSH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_164COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("COSH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":6834 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6835 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__871, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6835, __pyx_L1_error) - - /* "talib/func.pyx":6834 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":6836 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6837 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__872, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6837, __pyx_L1_error) - - /* "talib/func.pyx":6836 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6838 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6839 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6839, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6838 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":6840 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":6841 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":6842 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6843 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6844 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":6845 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6846 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":6845 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6847 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6848 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6850 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COSH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__873, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6850, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":6851 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_COSH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6852 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COSH_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_COSH_Lookback()); - - /* "talib/func.pyx":6853 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COSH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6853, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6854 - * lookback = begidx + lib.TA_COSH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6855 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6856 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COSH", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6857 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_COSH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_COSH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6858 - * outreal_data[i] = NaN - * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COSH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_COSH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6859 - * retCode = lib.TA_COSH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_COSH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.COSH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6863 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_167DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_166DEMA[] = " DEMA(real[, timeperiod=?])\n\n Double Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_167DEMA = {"DEMA", (PyCFunction)__pyx_pw_5talib_4func_167DEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_166DEMA}; -static PyObject *__pyx_pw_5talib_4func_167DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DEMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DEMA") < 0)) __PYX_ERR(0, 6863, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6863, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6863, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6863, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_166DEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_166DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("DEMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":6885 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6886 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__874, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6886, __pyx_L1_error) - - /* "talib/func.pyx":6885 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":6887 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6888 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__875, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6888, __pyx_L1_error) - - /* "talib/func.pyx":6887 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6889 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6890 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6890, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6889 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":6891 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":6892 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":6893 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6894 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6895 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":6896 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6897 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":6896 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6898 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6899 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6901 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__876, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6901, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":6902 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6903 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_DEMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":6904 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6904, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6905 - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6906 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6907 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DEMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6908 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DEMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DEMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6909 - * outreal_data[i] = NaN - * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DEMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6910 - * retCode = lib.TA_DEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DEMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6863 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_169DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_168DIV[] = " DIV(real0, real1)\n\n Vector Arithmetic Div (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_169DIV = {"DIV", (PyCFunction)__pyx_pw_5talib_4func_169DIV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_168DIV}; -static PyObject *__pyx_pw_5talib_4func_169DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DIV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, 1); __PYX_ERR(0, 6914, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DIV") < 0)) __PYX_ERR(0, 6914, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6914, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 6914, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 6914, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_168DIV(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_168DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("DIV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":6936 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6937 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__877, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6937, __pyx_L1_error) - - /* "talib/func.pyx":6936 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":6938 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6939 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__878, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6939, __pyx_L1_error) - - /* "talib/func.pyx":6938 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6940 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6941 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6941, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6940 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":6942 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":6943 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6944 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__879, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6944, __pyx_L1_error) - - /* "talib/func.pyx":6943 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":6945 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6946 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__880, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6946, __pyx_L1_error) - - /* "talib/func.pyx":6945 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":6947 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6948 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6948, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6947 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":6949 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":6950 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":6951 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6952 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__881, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6952, __pyx_L1_error) - - /* "talib/func.pyx":6951 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":6953 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":6954 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6955 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":6956 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6957 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":6956 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":6958 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":6959 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":6960 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":6959 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":6961 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":6962 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":6964 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DIV_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__882, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6964, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":6965 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_DIV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":6966 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DIV_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_DIV_Lookback()); - - /* "talib/func.pyx":6967 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DIV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6967, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":6968 - * lookback = begidx + lib.TA_DIV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":6969 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":6970 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DIV", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":6971 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DIV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DIV(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":6972 - * outreal_data[i] = NaN - * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DIV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DIV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":6973 - * retCode = lib.TA_DIV( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DIV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":6977 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_171DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_170DX[] = " DX(high, low, close[, timeperiod=?])\n\n Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_171DX = {"DX", (PyCFunction)__pyx_pw_5talib_4func_171DX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_170DX}; -static PyObject *__pyx_pw_5talib_4func_171DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 1); __PYX_ERR(0, 6977, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 2); __PYX_ERR(0, 6977, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DX") < 0)) __PYX_ERR(0, 6977, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6977, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6977, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6977, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6977, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6977, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_170DX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_170DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("DX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":7001 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7002 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__883, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7002, __pyx_L1_error) - - /* "talib/func.pyx":7001 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":7003 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7004 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__884, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7004, __pyx_L1_error) - - /* "talib/func.pyx":7003 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7005 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7006 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7006, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7005 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":7007 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":7008 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7009 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__885, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7009, __pyx_L1_error) - - /* "talib/func.pyx":7008 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":7010 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7011 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__886, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7011, __pyx_L1_error) - - /* "talib/func.pyx":7010 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7012 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7013 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7013, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7012 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":7014 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":7015 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7016 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__887, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7016, __pyx_L1_error) - - /* "talib/func.pyx":7015 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":7017 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7018 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__888, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7018, __pyx_L1_error) - - /* "talib/func.pyx":7017 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7019 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7020 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7020, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7019 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":7021 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":7022 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":7023 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7024 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__889, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7024, __pyx_L1_error) - - /* "talib/func.pyx":7023 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":7025 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7026 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__890, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7026, __pyx_L1_error) - - /* "talib/func.pyx":7025 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":7027 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7028 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7029 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":7030 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7031 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":7030 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":7032 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":7033 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7034 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":7033 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":7035 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":7036 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7037 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":7036 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7038 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7039 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7041 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__891, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7041, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":7042 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7043 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_DX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7044 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7044, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7045 - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7046 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7047 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DX", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7048 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DX(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7049 - * outreal_data[i] = NaN - * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7050 - * retCode = lib.TA_DX( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_DX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":6977 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7054 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_173EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_172EMA[] = " EMA(real[, timeperiod=?])\n\n Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_173EMA = {"EMA", (PyCFunction)__pyx_pw_5talib_4func_173EMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_172EMA}; -static PyObject *__pyx_pw_5talib_4func_173EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("EMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "EMA") < 0)) __PYX_ERR(0, 7054, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7054, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("EMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7054, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7054, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_172EMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_172EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("EMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7076 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7077 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__892, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7077, __pyx_L1_error) - - /* "talib/func.pyx":7076 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7078 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7079 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__893, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7079, __pyx_L1_error) - - /* "talib/func.pyx":7078 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7080 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7081 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7081, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7080 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7082 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7083 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7084 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7085 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7086 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7087 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7088 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7087 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7089 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7090 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7092 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__894, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7092, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7093 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7094 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_EMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7095 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7095, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7096 - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7097 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7098 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7099 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_EMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_EMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7100 - * outreal_data[i] = NaN - * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_EMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7101 - * retCode = lib.TA_EMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7054 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7105 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_175EXP(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_174EXP[] = " EXP(real)\n\n Vector Arithmetic Exp (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_175EXP = {"EXP", (PyCFunction)__pyx_pw_5talib_4func_175EXP, METH_O, __pyx_doc_5talib_4func_174EXP}; -static PyObject *__pyx_pw_5talib_4func_175EXP(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("EXP (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7105, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_174EXP(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_174EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("EXP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7125 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7126 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__895, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7126, __pyx_L1_error) - - /* "talib/func.pyx":7125 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7127 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7128 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__896, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7128, __pyx_L1_error) - - /* "talib/func.pyx":7127 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7129 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7130 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7130, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7129 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7131 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7132 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7133 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7134 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7135 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7136 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7137 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7136 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7138 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7139 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7141 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EXP_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__897, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7141, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7142 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_EXP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7143 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EXP_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_EXP_Lookback()); - - /* "talib/func.pyx":7144 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EXP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7144, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7145 - * lookback = begidx + lib.TA_EXP_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7146 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7147 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EXP", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7148 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_EXP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_EXP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7149 - * outreal_data[i] = NaN - * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EXP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_EXP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7150 - * retCode = lib.TA_EXP( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_EXP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7105 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.EXP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7154 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_177FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_176FLOOR[] = " FLOOR(real)\n\n Vector Floor (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_177FLOOR = {"FLOOR", (PyCFunction)__pyx_pw_5talib_4func_177FLOOR, METH_O, __pyx_doc_5talib_4func_176FLOOR}; -static PyObject *__pyx_pw_5talib_4func_177FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("FLOOR (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7154, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_176FLOOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_176FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("FLOOR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7174 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7175 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__898, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7175, __pyx_L1_error) - - /* "talib/func.pyx":7174 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7176 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7177 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__899, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7177, __pyx_L1_error) - - /* "talib/func.pyx":7176 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7178 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7179 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7179, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7178 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7180 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7181 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7182 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7183 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7184 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7185 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7186 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7185 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7187 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7188 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7190 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_FLOOR_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__900, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7190, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7191 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_FLOOR_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7192 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_FLOOR_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_FLOOR_Lookback()); - - /* "talib/func.pyx":7193 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_FLOOR_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7193, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7194 - * lookback = begidx + lib.TA_FLOOR_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7195 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7196 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_FLOOR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7197 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_FLOOR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_FLOOR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7198 - * outreal_data[i] = NaN - * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_FLOOR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_FLOOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7199 - * retCode = lib.TA_FLOOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_FLOOR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7154 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.FLOOR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7203 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_179HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_178HT_DCPERIOD[] = " HT_DCPERIOD(real)\n\n Hilbert Transform - Dominant Cycle Period (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_179HT_DCPERIOD = {"HT_DCPERIOD", (PyCFunction)__pyx_pw_5talib_4func_179HT_DCPERIOD, METH_O, __pyx_doc_5talib_4func_178HT_DCPERIOD}; -static PyObject *__pyx_pw_5talib_4func_179HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_DCPERIOD (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7203, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_178HT_DCPERIOD(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_178HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_DCPERIOD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7223 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7224 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__901, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7224, __pyx_L1_error) - - /* "talib/func.pyx":7223 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7225 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7226 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__902, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7226, __pyx_L1_error) - - /* "talib/func.pyx":7225 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7227 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7228 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7228, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7227 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7229 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7230 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7231 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7232 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7233 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7234 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7235 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7234 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7236 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7237 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7239 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__903, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7239, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7240 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7241 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_DCPERIOD_Lookback()); - - /* "talib/func.pyx":7242 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7242, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7243 - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7244 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7245 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7246 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_DCPERIOD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_DCPERIOD(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7247 - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_DCPERIOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7248 - * retCode = lib.TA_HT_DCPERIOD( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7203 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_DCPERIOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7252 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_181HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_180HT_DCPHASE[] = " HT_DCPHASE(real)\n\n Hilbert Transform - Dominant Cycle Phase (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_181HT_DCPHASE = {"HT_DCPHASE", (PyCFunction)__pyx_pw_5talib_4func_181HT_DCPHASE, METH_O, __pyx_doc_5talib_4func_180HT_DCPHASE}; -static PyObject *__pyx_pw_5talib_4func_181HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_DCPHASE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7252, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_180HT_DCPHASE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_180HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_DCPHASE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7272 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7273 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__904, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7273, __pyx_L1_error) - - /* "talib/func.pyx":7272 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7274 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7275 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__905, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7275, __pyx_L1_error) - - /* "talib/func.pyx":7274 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7276 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7277 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7277, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7276 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7278 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7279 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7280 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7281 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7282 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7283 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7284 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7283 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7285 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7286 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7288 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__906, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7288, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7289 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7290 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_DCPHASE_Lookback()); - - /* "talib/func.pyx":7291 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7291, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7292 - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7293 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7294 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPHASE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7295 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_DCPHASE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_DCPHASE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7296 - * outreal_data[i] = NaN - * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPHASE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_DCPHASE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7297 - * retCode = lib.TA_HT_DCPHASE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_DCPHASE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7252 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_DCPHASE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7301 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_183HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_182HT_PHASOR[] = " HT_PHASOR(real)\n\n Hilbert Transform - Phasor Components (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n inphase\n quadrature\n "; -static PyMethodDef __pyx_mdef_5talib_4func_183HT_PHASOR = {"HT_PHASOR", (PyCFunction)__pyx_pw_5talib_4func_183HT_PHASOR, METH_O, __pyx_doc_5talib_4func_182HT_PHASOR}; -static PyObject *__pyx_pw_5talib_4func_183HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_PHASOR (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7301, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_182HT_PHASOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_182HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinphase = 0; - double *__pyx_v_outinphase_data; - PyArrayObject *__pyx_v_outquadrature = 0; - double *__pyx_v_outquadrature_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_PHASOR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7324 - * np.ndarray outquadrature - * double* outquadrature_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7325 - * double* outquadrature_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__907, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7325, __pyx_L1_error) - - /* "talib/func.pyx":7324 - * np.ndarray outquadrature - * double* outquadrature_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7326 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7327 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__908, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7327, __pyx_L1_error) - - /* "talib/func.pyx":7326 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7328 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7329 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7329, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7328 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7330 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7331 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7332 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7333 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7334 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7335 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7336 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7335 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7337 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7338 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7340 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__909, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7340, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7341 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) - * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7342 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) # <<<<<<<<<<<<<< - * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outinphase_data = outinphase.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_PHASOR_Lookback()); - - /* "talib/func.pyx":7343 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) - * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinphase_data = outinphase.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7343, __pyx_L1_error) - __pyx_v_outinphase = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7344 - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) - * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outinphase_data = outinphase.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinphase_data[i] = NaN - */ - __pyx_v_outinphase_data = ((double *)__pyx_v_outinphase->data); - - /* "talib/func.pyx":7345 - * outinphase = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outinphase_data = outinphase.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinphase_data[i] = NaN - * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7346 - * outinphase_data = outinphase.data - * for i from 0 <= i < min(lookback, length): - * outinphase_data[i] = NaN # <<<<<<<<<<<<<< - * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outquadrature_data = outquadrature.data - */ - (__pyx_v_outinphase_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7347 - * for i from 0 <= i < min(lookback, length): - * outinphase_data[i] = NaN - * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outquadrature_data = outquadrature.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7347, __pyx_L1_error) - __pyx_v_outquadrature = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7348 - * outinphase_data[i] = NaN - * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outquadrature_data = outquadrature.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outquadrature_data[i] = NaN - */ - __pyx_v_outquadrature_data = ((double *)__pyx_v_outquadrature->data); - - /* "talib/func.pyx":7349 - * outquadrature = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outquadrature_data = outquadrature.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outquadrature_data[i] = NaN - * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7350 - * outquadrature_data = outquadrature.data - * for i from 0 <= i < min(lookback, length): - * outquadrature_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) - * _ta_check_success("TA_HT_PHASOR", retCode) - */ - (__pyx_v_outquadrature_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7351 - * for i from 0 <= i < min(lookback, length): - * outquadrature_data[i] = NaN - * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_PHASOR", retCode) - * return outinphase , outquadrature - */ - __pyx_v_retCode = TA_HT_PHASOR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outinphase_data + __pyx_v_lookback)), ((double *)(__pyx_v_outquadrature_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7352 - * outquadrature_data[i] = NaN - * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) - * _ta_check_success("TA_HT_PHASOR", retCode) # <<<<<<<<<<<<<< - * return outinphase , outquadrature - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_PHASOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7353 - * retCode = lib.TA_HT_PHASOR( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinphase_data+lookback) , (outquadrature_data+lookback) ) - * _ta_check_success("TA_HT_PHASOR", retCode) - * return outinphase , outquadrature # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outinphase)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outinphase)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outinphase)); - __Pyx_INCREF(((PyObject *)__pyx_v_outquadrature)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outquadrature)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outquadrature)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":7301 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_PHASOR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinphase); - __Pyx_XDECREF((PyObject *)__pyx_v_outquadrature); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_185HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_184HT_SINE[] = " HT_SINE(real)\n\n Hilbert Transform - SineWave (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n sine\n leadsine\n "; -static PyMethodDef __pyx_mdef_5talib_4func_185HT_SINE = {"HT_SINE", (PyCFunction)__pyx_pw_5talib_4func_185HT_SINE, METH_O, __pyx_doc_5talib_4func_184HT_SINE}; -static PyObject *__pyx_pw_5talib_4func_185HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_SINE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7357, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_184HT_SINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_184HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outsine = 0; - double *__pyx_v_outsine_data; - PyArrayObject *__pyx_v_outleadsine = 0; - double *__pyx_v_outleadsine_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_SINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7380 - * np.ndarray outleadsine - * double* outleadsine_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7381 - * double* outleadsine_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__910, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7381, __pyx_L1_error) - - /* "talib/func.pyx":7380 - * np.ndarray outleadsine - * double* outleadsine_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7382 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7383 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__911, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7383, __pyx_L1_error) - - /* "talib/func.pyx":7382 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7384 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7385 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7385, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7384 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7386 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7387 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7388 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7389 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7390 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7391 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7392 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7391 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7393 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7394 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7396 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__912, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7396, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7397 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) - * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7398 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) # <<<<<<<<<<<<<< - * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outsine_data = outsine.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_SINE_Lookback()); - - /* "talib/func.pyx":7399 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) - * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outsine_data = outsine.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7399, __pyx_L1_error) - __pyx_v_outsine = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7400 - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) - * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outsine_data = outsine.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outsine_data[i] = NaN - */ - __pyx_v_outsine_data = ((double *)__pyx_v_outsine->data); - - /* "talib/func.pyx":7401 - * outsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outsine_data = outsine.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outsine_data[i] = NaN - * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7402 - * outsine_data = outsine.data - * for i from 0 <= i < min(lookback, length): - * outsine_data[i] = NaN # <<<<<<<<<<<<<< - * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outleadsine_data = outleadsine.data - */ - (__pyx_v_outsine_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7403 - * for i from 0 <= i < min(lookback, length): - * outsine_data[i] = NaN - * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outleadsine_data = outleadsine.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7403, __pyx_L1_error) - __pyx_v_outleadsine = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7404 - * outsine_data[i] = NaN - * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outleadsine_data = outleadsine.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outleadsine_data[i] = NaN - */ - __pyx_v_outleadsine_data = ((double *)__pyx_v_outleadsine->data); - - /* "talib/func.pyx":7405 - * outleadsine = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outleadsine_data = outleadsine.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outleadsine_data[i] = NaN - * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7406 - * outleadsine_data = outleadsine.data - * for i from 0 <= i < min(lookback, length): - * outleadsine_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) - * _ta_check_success("TA_HT_SINE", retCode) - */ - (__pyx_v_outleadsine_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7407 - * for i from 0 <= i < min(lookback, length): - * outleadsine_data[i] = NaN - * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_SINE", retCode) - * return outsine , outleadsine - */ - __pyx_v_retCode = TA_HT_SINE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outsine_data + __pyx_v_lookback)), ((double *)(__pyx_v_outleadsine_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7408 - * outleadsine_data[i] = NaN - * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) - * _ta_check_success("TA_HT_SINE", retCode) # <<<<<<<<<<<<<< - * return outsine , outleadsine - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_SINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7409 - * retCode = lib.TA_HT_SINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outsine_data+lookback) , (outleadsine_data+lookback) ) - * _ta_check_success("TA_HT_SINE", retCode) - * return outsine , outleadsine # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outsine)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outsine)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outsine)); - __Pyx_INCREF(((PyObject *)__pyx_v_outleadsine)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outleadsine)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outleadsine)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_SINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outsine); - __Pyx_XDECREF((PyObject *)__pyx_v_outleadsine); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_187HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_186HT_TRENDLINE[] = " HT_TRENDLINE(real)\n\n Hilbert Transform - Instantaneous Trendline (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_187HT_TRENDLINE = {"HT_TRENDLINE", (PyCFunction)__pyx_pw_5talib_4func_187HT_TRENDLINE, METH_O, __pyx_doc_5talib_4func_186HT_TRENDLINE}; -static PyObject *__pyx_pw_5talib_4func_187HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_TRENDLINE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7413, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_186HT_TRENDLINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_186HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_TRENDLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7434 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__913, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7434, __pyx_L1_error) - - /* "talib/func.pyx":7433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7435 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7436 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__914, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7436, __pyx_L1_error) - - /* "talib/func.pyx":7435 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7437 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7438 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7438, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7437 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7439 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7440 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7441 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7442 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7443 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7444 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7445 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7444 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7446 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7447 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7449 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__915, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7449, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7450 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7451 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_TRENDLINE_Lookback()); - - /* "talib/func.pyx":7452 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7452, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7453 - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7454 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7455 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7456 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_TRENDLINE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_TRENDLINE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7457 - * outreal_data[i] = NaN - * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_TRENDLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7458 - * retCode = lib.TA_HT_TRENDLINE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_TRENDLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_189HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_188HT_TRENDMODE[] = " HT_TRENDMODE(real)\n\n Hilbert Transform - Trend vs Cycle Mode (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_189HT_TRENDMODE = {"HT_TRENDMODE", (PyCFunction)__pyx_pw_5talib_4func_189HT_TRENDMODE, METH_O, __pyx_doc_5talib_4func_188HT_TRENDMODE}; -static PyObject *__pyx_pw_5talib_4func_189HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_TRENDMODE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7462, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_188HT_TRENDMODE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_188HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("HT_TRENDMODE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7482 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7483 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__916, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7483, __pyx_L1_error) - - /* "talib/func.pyx":7482 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7484 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7485 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__917, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7485, __pyx_L1_error) - - /* "talib/func.pyx":7484 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7486 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7487 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7487, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7486 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7488 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7489 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7490 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7491 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7492 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7493 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7494 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7493 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7495 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7496 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7498 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__918, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7498, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7499 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7500 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_HT_TRENDMODE_Lookback()); - - /* "talib/func.pyx":7501 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7501, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7502 - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":7503 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7504 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":7505 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_TRENDMODE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_HT_TRENDMODE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7506 - * outinteger_data[i] = 0 - * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_TRENDMODE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7507 - * retCode = lib.TA_HT_TRENDMODE( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":7462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.HT_TRENDMODE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_191KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_190KAMA[] = " KAMA(real[, timeperiod=?])\n\n Kaufman Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_191KAMA = {"KAMA", (PyCFunction)__pyx_pw_5talib_4func_191KAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_190KAMA}; -static PyObject *__pyx_pw_5talib_4func_191KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("KAMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "KAMA") < 0)) __PYX_ERR(0, 7511, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7511, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("KAMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7511, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7511, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_190KAMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_190KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("KAMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7533 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7534 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__919, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7534, __pyx_L1_error) - - /* "talib/func.pyx":7533 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7535 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7536 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__920, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7536, __pyx_L1_error) - - /* "talib/func.pyx":7535 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7537 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7538 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7538, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7537 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7539 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7540 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7541 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7542 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7543 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7544 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7545 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7544 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7546 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7547 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7549 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__921, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7549, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7550 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7551 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_KAMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7552 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7552, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7553 - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7554 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7555 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_KAMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7556 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_KAMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_KAMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7557 - * outreal_data[i] = NaN - * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_KAMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_KAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7558 - * retCode = lib.TA_KAMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_KAMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7562 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_193LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_192LINEARREG[] = " LINEARREG(real[, timeperiod=?])\n\n Linear Regression (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_193LINEARREG = {"LINEARREG", (PyCFunction)__pyx_pw_5talib_4func_193LINEARREG, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_192LINEARREG}; -static PyObject *__pyx_pw_5talib_4func_193LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG") < 0)) __PYX_ERR(0, 7562, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7562, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7562, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7562, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_192LINEARREG(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_192LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LINEARREG", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7584 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7585 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__922, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7585, __pyx_L1_error) - - /* "talib/func.pyx":7584 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7586 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7587 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__923, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7587, __pyx_L1_error) - - /* "talib/func.pyx":7586 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7588 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7589 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7589, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7588 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7590 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7591 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7592 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7593 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7594 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7595 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7596 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7595 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7597 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7598 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7600 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__924, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7600, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7601 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7602 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7603 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7603, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7604 - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7605 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7606 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7607 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7608 - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7609 - * retCode = lib.TA_LINEARREG( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7562 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_195LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_194LINEARREG_ANGLE[] = " LINEARREG_ANGLE(real[, timeperiod=?])\n\n Linear Regression Angle (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_195LINEARREG_ANGLE = {"LINEARREG_ANGLE", (PyCFunction)__pyx_pw_5talib_4func_195LINEARREG_ANGLE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_194LINEARREG_ANGLE}; -static PyObject *__pyx_pw_5talib_4func_195LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_ANGLE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_ANGLE") < 0)) __PYX_ERR(0, 7613, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7613, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_ANGLE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7613, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7613, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_194LINEARREG_ANGLE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_194LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LINEARREG_ANGLE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7635 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7636 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__925, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7636, __pyx_L1_error) - - /* "talib/func.pyx":7635 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7637 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7638 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__926, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7638, __pyx_L1_error) - - /* "talib/func.pyx":7637 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7639 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7640 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7640, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7639 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7641 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7642 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7643 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7644 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7645 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7646 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7647 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7646 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7648 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7649 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7651 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__927, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7651, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7652 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7653 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_ANGLE_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7654 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7654, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7655 - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7656 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7657 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7658 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_ANGLE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7659 - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7660 - * retCode = lib.TA_LINEARREG_ANGLE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_197LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_196LINEARREG_INTERCEPT[] = " LINEARREG_INTERCEPT(real[, timeperiod=?])\n\n Linear Regression Intercept (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_197LINEARREG_INTERCEPT = {"LINEARREG_INTERCEPT", (PyCFunction)__pyx_pw_5talib_4func_197LINEARREG_INTERCEPT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_196LINEARREG_INTERCEPT}; -static PyObject *__pyx_pw_5talib_4func_197LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_INTERCEPT") < 0)) __PYX_ERR(0, 7664, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7664, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_INTERCEPT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7664, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7664, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_196LINEARREG_INTERCEPT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_196LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7686 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7687 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__928, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7687, __pyx_L1_error) - - /* "talib/func.pyx":7686 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7688 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7689 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__929, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7689, __pyx_L1_error) - - /* "talib/func.pyx":7688 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7690 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7691 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7691, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7690 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7692 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7693 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7694 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7695 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7696 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7697 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7698 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7697 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7699 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7700 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7702 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__930, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7702, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7703 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7704 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_INTERCEPT_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7705 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7705, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7706 - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7707 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7708 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7709 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_INTERCEPT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7710 - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7711 - * retCode = lib.TA_LINEARREG_INTERCEPT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_199LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_198LINEARREG_SLOPE[] = " LINEARREG_SLOPE(real[, timeperiod=?])\n\n Linear Regression Slope (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_199LINEARREG_SLOPE = {"LINEARREG_SLOPE", (PyCFunction)__pyx_pw_5talib_4func_199LINEARREG_SLOPE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_198LINEARREG_SLOPE}; -static PyObject *__pyx_pw_5talib_4func_199LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_SLOPE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_SLOPE") < 0)) __PYX_ERR(0, 7715, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7715, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_SLOPE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7715, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7715, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_198LINEARREG_SLOPE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_198LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LINEARREG_SLOPE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7737 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7738 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__931, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7738, __pyx_L1_error) - - /* "talib/func.pyx":7737 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7739 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7740 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__932, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7740, __pyx_L1_error) - - /* "talib/func.pyx":7739 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7741 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7742 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7742, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7741 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7743 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7744 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7745 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7746 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7747 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7748 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7749 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7748 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7750 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7751 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7753 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__933, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7753, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7754 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7755 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LINEARREG_SLOPE_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":7756 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7756, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7757 - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7758 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7759 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7760 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_SLOPE(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7761 - * outreal_data[i] = NaN - * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7762 - * retCode = lib.TA_LINEARREG_SLOPE( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7766 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_201LN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_200LN[] = " LN(real)\n\n Vector Log Natural (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_201LN = {"LN", (PyCFunction)__pyx_pw_5talib_4func_201LN, METH_O, __pyx_doc_5talib_4func_200LN}; -static PyObject *__pyx_pw_5talib_4func_201LN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7766, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_200LN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_200LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7786 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7787 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__934, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7787, __pyx_L1_error) - - /* "talib/func.pyx":7786 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7788 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7789 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__935, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7789, __pyx_L1_error) - - /* "talib/func.pyx":7788 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7790 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7791 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7791, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7790 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7792 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7793 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7794 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7795 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7796 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7797 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7798 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7797 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7799 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7800 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7802 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__936, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7802, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7803 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7804 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LN_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LN_Lookback()); - - /* "talib/func.pyx":7805 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7805, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7806 - * lookback = begidx + lib.TA_LN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7807 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7808 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7809 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7810 - * outreal_data[i] = NaN - * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7811 - * retCode = lib.TA_LN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7766 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7815 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_203LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_202LOG10[] = " LOG10(real)\n\n Vector Log10 (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_203LOG10 = {"LOG10", (PyCFunction)__pyx_pw_5talib_4func_203LOG10, METH_O, __pyx_doc_5talib_4func_202LOG10}; -static PyObject *__pyx_pw_5talib_4func_203LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LOG10 (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7815, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_202LOG10(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_202LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("LOG10", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7835 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7836 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__937, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7836, __pyx_L1_error) - - /* "talib/func.pyx":7835 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7837 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7838 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__938, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7838, __pyx_L1_error) - - /* "talib/func.pyx":7837 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7839 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7840 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7840, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7839 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7841 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7842 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7843 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7844 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7845 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7846 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7847 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7846 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7848 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7849 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7851 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LOG10_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__939, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7851, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7852 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_LOG10_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7853 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LOG10_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_LOG10_Lookback()); - - /* "talib/func.pyx":7854 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LOG10_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7854, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7854, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7855 - * lookback = begidx + lib.TA_LOG10_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7856 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7857 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LOG10", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7858 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LOG10", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LOG10(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7859 - * outreal_data[i] = NaN - * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LOG10", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LOG10, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7860 - * retCode = lib.TA_LOG10( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_LOG10", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7815 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.LOG10", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7864 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_205MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_204MA[] = " MA(real[, timeperiod=?, matype=?])\n\n Moving average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_205MA = {"MA", (PyCFunction)__pyx_pw_5talib_4func_205MA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_204MA}; -static PyObject *__pyx_pw_5talib_4func_205MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_matype,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MA") < 0)) __PYX_ERR(0, 7864, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7864, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7864, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7864, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7864, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_204MA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_204MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7887 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7888 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__940, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7888, __pyx_L1_error) - - /* "talib/func.pyx":7887 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7889 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7890 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__941, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7890, __pyx_L1_error) - - /* "talib/func.pyx":7889 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7891 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7892 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7892, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7891 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7893 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7894 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7895 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7896 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7897 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7898 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7899 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7898 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7900 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7901 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7903 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__942, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7903, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7904 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7905 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MA_Lookback(__pyx_v_timeperiod, __pyx_v_matype)); - - /* "talib/func.pyx":7906 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7906, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7907 - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":7908 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7909 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7910 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7911 - * outreal_data[i] = NaN - * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7912 - * retCode = lib.TA_MA( 0 , endidx , (real_data+begidx) , timeperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":7864 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7916 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_207MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_206MACD[] = " MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?])\n\n Moving Average Convergence/Divergence (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_4func_207MACD = {"MACD", (PyCFunction)__pyx_pw_5talib_4func_207MACD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_206MACD}; -static PyObject *__pyx_pw_5talib_4func_207MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_signalperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_signalperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACD") < 0)) __PYX_ERR(0, 7916, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7916, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7916, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7916, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACD", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7916, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7916, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_206MACD(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_206MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outmacd = 0; - double *__pyx_v_outmacd_data; - PyArrayObject *__pyx_v_outmacdsignal = 0; - double *__pyx_v_outmacdsignal_data; - PyArrayObject *__pyx_v_outmacdhist = 0; - double *__pyx_v_outmacdhist_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MACD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":7946 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7947 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__943, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7947, __pyx_L1_error) - - /* "talib/func.pyx":7946 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":7948 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7949 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__944, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7949, __pyx_L1_error) - - /* "talib/func.pyx":7948 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":7950 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7951 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7951, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7950 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":7952 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":7953 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":7954 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":7955 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7956 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":7957 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":7958 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":7957 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":7959 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":7960 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":7962 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__945, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7962, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":7963 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":7964 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) # <<<<<<<<<<<<<< - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MACD_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod)); - - /* "talib/func.pyx":7965 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7965, __pyx_L1_error) - __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7966 - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - */ - __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); - - /* "talib/func.pyx":7967 - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7968 - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - */ - (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7969 - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7969, __pyx_L1_error) - __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7970 - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - */ - __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); - - /* "talib/func.pyx":7971 - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7972 - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - */ - (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7973 - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7973, __pyx_L1_error) - __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":7974 - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - */ - __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); - - /* "talib/func.pyx":7975 - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":7976 - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACD", retCode) - */ - (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":7977 - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACD", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACD(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); - - /* "talib/func.pyx":7978 - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACD", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":7979 - * retCode = lib.TA_MACD( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACD", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); - PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":7916 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":7983 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_209MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_208MACDEXT[] = " MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?])\n\n MACD with controllable MA type (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n fastmatype: 0\n slowperiod: 26\n slowmatype: 0\n signalperiod: 9\n signalmatype: 0\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_4func_209MACDEXT = {"MACDEXT", (PyCFunction)__pyx_pw_5talib_4func_209MACDEXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_208MACDEXT}; -static PyObject *__pyx_pw_5talib_4func_209MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_fastmatype; - int __pyx_v_slowperiod; - int __pyx_v_slowmatype; - int __pyx_v_signalperiod; - int __pyx_v_signalmatype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACDEXT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_fastmatype,&__pyx_n_s_slowperiod,&__pyx_n_s_slowmatype,&__pyx_n_s_signalperiod,&__pyx_n_s_signalmatype,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastmatype); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowmatype); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalmatype); - if (value) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDEXT") < 0)) __PYX_ERR(0, 7983, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_fastmatype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_fastmatype = ((int)0); - } - if (values[3]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_slowmatype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_slowmatype = ((int)0); - } - if (values[5]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - if (values[6]) { - __pyx_v_signalmatype = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_signalmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7983, __pyx_L3_error) - } else { - __pyx_v_signalmatype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACDEXT", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7983, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7983, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_208MACDEXT(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_208MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outmacd = 0; - double *__pyx_v_outmacd_data; - PyArrayObject *__pyx_v_outmacdsignal = 0; - double *__pyx_v_outmacdsignal_data; - PyArrayObject *__pyx_v_outmacdhist = 0; - double *__pyx_v_outmacdhist_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MACDEXT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8016 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8017 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__946, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8017, __pyx_L1_error) - - /* "talib/func.pyx":8016 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8018 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8019 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__947, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8019, __pyx_L1_error) - - /* "talib/func.pyx":8018 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8020 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8021 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8021, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8020 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8022 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8023 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8024 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8025 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8026 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8027 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8028 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8027 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8029 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8030 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8032 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__948, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8032, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8033 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8034 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) # <<<<<<<<<<<<<< - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MACDEXT_Lookback(__pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype)); - - /* "talib/func.pyx":8035 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8035, __pyx_L1_error) - __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8036 - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - */ - __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); - - /* "talib/func.pyx":8037 - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8038 - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - */ - (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8039 - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8039, __pyx_L1_error) - __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8040 - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - */ - __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); - - /* "talib/func.pyx":8041 - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8042 - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - */ - (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8043 - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8043, __pyx_L1_error) - __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8044 - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - */ - __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); - - /* "talib/func.pyx":8045 - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8046 - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDEXT", retCode) - */ - (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8047 - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACDEXT", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACDEXT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8048 - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDEXT", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACDEXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8049 - * retCode = lib.TA_MACDEXT( 0 , endidx , (real_data+begidx) , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDEXT", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); - PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":7983 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_211MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_210MACDFIX[] = " MACDFIX(real[, signalperiod=?])\n\n Moving Average Convergence/Divergence Fix 12/26 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_4func_211MACDFIX = {"MACDFIX", (PyCFunction)__pyx_pw_5talib_4func_211MACDFIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_210MACDFIX}; -static PyObject *__pyx_pw_5talib_4func_211MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_signalperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACDFIX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_signalperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDFIX") < 0)) __PYX_ERR(0, 8053, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8053, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACDFIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8053, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8053, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_210MACDFIX(__pyx_self, __pyx_v_real, __pyx_v_signalperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_210MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outmacd = 0; - double *__pyx_v_outmacd_data; - PyArrayObject *__pyx_v_outmacdsignal = 0; - double *__pyx_v_outmacdsignal_data; - PyArrayObject *__pyx_v_outmacdhist = 0; - double *__pyx_v_outmacdhist_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MACDFIX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8081 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8082 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__949, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8082, __pyx_L1_error) - - /* "talib/func.pyx":8081 - * np.ndarray outmacdhist - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8083 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8084 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__950, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8084, __pyx_L1_error) - - /* "talib/func.pyx":8083 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8085 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8086 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8086, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8085 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8087 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8088 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8089 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8090 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8091 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8092 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8093 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8092 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8094 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8095 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8097 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__951, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8097, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8098 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8099 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) # <<<<<<<<<<<<<< - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MACDFIX_Lookback(__pyx_v_signalperiod)); - - /* "talib/func.pyx":8100 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8100, __pyx_L1_error) - __pyx_v_outmacd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8101 - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - */ - __pyx_v_outmacd_data = ((double *)__pyx_v_outmacd->data); - - /* "talib/func.pyx":8102 - * outmacd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8103 - * outmacd_data = outmacd.data - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - */ - (__pyx_v_outmacd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8104 - * for i from 0 <= i < min(lookback, length): - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8104, __pyx_L1_error) - __pyx_v_outmacdsignal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8105 - * outmacd_data[i] = NaN - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - */ - __pyx_v_outmacdsignal_data = ((double *)__pyx_v_outmacdsignal->data); - - /* "talib/func.pyx":8106 - * outmacdsignal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8107 - * outmacdsignal_data = outmacdsignal.data - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN # <<<<<<<<<<<<<< - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - */ - (__pyx_v_outmacdsignal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8108 - * for i from 0 <= i < min(lookback, length): - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8108, __pyx_L1_error) - __pyx_v_outmacdhist = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8109 - * outmacdsignal_data[i] = NaN - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - */ - __pyx_v_outmacdhist_data = ((double *)__pyx_v_outmacdhist->data); - - /* "talib/func.pyx":8110 - * outmacdhist = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8111 - * outmacdhist_data = outmacdhist.data - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDFIX", retCode) - */ - (__pyx_v_outmacdhist_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8112 - * for i from 0 <= i < min(lookback, length): - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACDFIX", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACDFIX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmacd_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdsignal_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmacdhist_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8113 - * outmacdhist_data[i] = NaN - * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDFIX", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACDFIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8114 - * retCode = lib.TA_MACDFIX( 0 , endidx , (real_data+begidx) , signalperiod , &outbegidx , &outnbelement , (outmacd_data+lookback) , (outmacdsignal_data+lookback) , (outmacdhist_data+lookback) ) - * _ta_check_success("TA_MACDFIX", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacd)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmacd)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdsignal)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmacdsignal)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmacdhist)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmacdhist)); - PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_outmacdhist)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":8053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outmacd); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdsignal); - __Pyx_XDECREF((PyObject *)__pyx_v_outmacdhist); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8118 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_213MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_212MAMA[] = " MAMA(real[, fastlimit=?, slowlimit=?])\n\n MESA Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastlimit: 0.5\n slowlimit: 0.05\n Outputs:\n mama\n fama\n "; -static PyMethodDef __pyx_mdef_5talib_4func_213MAMA = {"MAMA", (PyCFunction)__pyx_pw_5talib_4func_213MAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_212MAMA}; -static PyObject *__pyx_pw_5talib_4func_213MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - double __pyx_v_fastlimit; - double __pyx_v_slowlimit; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastlimit,&__pyx_n_s_slowlimit,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastlimit); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowlimit); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAMA") < 0)) __PYX_ERR(0, 8118, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastlimit = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fastlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8118, __pyx_L3_error) - } else { - __pyx_v_fastlimit = ((double)-4e37); - } - if (values[2]) { - __pyx_v_slowlimit = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_slowlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8118, __pyx_L3_error) - } else { - __pyx_v_slowlimit = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAMA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8118, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8118, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_212MAMA(__pyx_self, __pyx_v_real, __pyx_v_fastlimit, __pyx_v_slowlimit); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_212MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outmama = 0; - double *__pyx_v_outmama_data; - PyArrayObject *__pyx_v_outfama = 0; - double *__pyx_v_outfama_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MAMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8144 - * np.ndarray outfama - * double* outfama_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8145 - * double* outfama_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__952, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8145, __pyx_L1_error) - - /* "talib/func.pyx":8144 - * np.ndarray outfama - * double* outfama_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8146 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8147 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__953, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8147, __pyx_L1_error) - - /* "talib/func.pyx":8146 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8148 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8149 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8149, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8148 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8150 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8151 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8152 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8153 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8154 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8155 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8156 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8155 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8157 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8158 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8160 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__954, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8160, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8161 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) - * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8162 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) # <<<<<<<<<<<<<< - * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmama_data = outmama.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MAMA_Lookback(__pyx_v_fastlimit, __pyx_v_slowlimit)); - - /* "talib/func.pyx":8163 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) - * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmama_data = outmama.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8163, __pyx_L1_error) - __pyx_v_outmama = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8164 - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) - * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmama_data = outmama.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmama_data[i] = NaN - */ - __pyx_v_outmama_data = ((double *)__pyx_v_outmama->data); - - /* "talib/func.pyx":8165 - * outmama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmama_data = outmama.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmama_data[i] = NaN - * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8166 - * outmama_data = outmama.data - * for i from 0 <= i < min(lookback, length): - * outmama_data[i] = NaN # <<<<<<<<<<<<<< - * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfama_data = outfama.data - */ - (__pyx_v_outmama_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8167 - * for i from 0 <= i < min(lookback, length): - * outmama_data[i] = NaN - * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outfama_data = outfama.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8167, __pyx_L1_error) - __pyx_v_outfama = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8168 - * outmama_data[i] = NaN - * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfama_data = outfama.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outfama_data[i] = NaN - */ - __pyx_v_outfama_data = ((double *)__pyx_v_outfama->data); - - /* "talib/func.pyx":8169 - * outfama = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfama_data = outfama.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outfama_data[i] = NaN - * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8170 - * outfama_data = outfama.data - * for i from 0 <= i < min(lookback, length): - * outfama_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) - * _ta_check_success("TA_MAMA", retCode) - */ - (__pyx_v_outfama_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8171 - * for i from 0 <= i < min(lookback, length): - * outfama_data[i] = NaN - * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAMA", retCode) - * return outmama , outfama - */ - __pyx_v_retCode = TA_MAMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastlimit, __pyx_v_slowlimit, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmama_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfama_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8172 - * outfama_data[i] = NaN - * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) - * _ta_check_success("TA_MAMA", retCode) # <<<<<<<<<<<<<< - * return outmama , outfama - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8173 - * retCode = lib.TA_MAMA( 0 , endidx , (real_data+begidx) , fastlimit , slowlimit , &outbegidx , &outnbelement , (outmama_data+lookback) , (outfama_data+lookback) ) - * _ta_check_success("TA_MAMA", retCode) - * return outmama , outfama # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outmama)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmama)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmama)); - __Pyx_INCREF(((PyObject *)__pyx_v_outfama)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outfama)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfama)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":8118 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outmama); - __Pyx_XDECREF((PyObject *)__pyx_v_outfama); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8177 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_215MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_214MAVP[] = " MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?])\n\n Moving average with variable period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n periods: (any ndarray)\n Parameters:\n minperiod: 2\n maxperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_215MAVP = {"MAVP", (PyCFunction)__pyx_pw_5talib_4func_215MAVP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_214MAVP}; -static PyObject *__pyx_pw_5talib_4func_215MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - PyArrayObject *__pyx_v_periods = 0; - int __pyx_v_minperiod; - int __pyx_v_maxperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAVP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_periods,&__pyx_n_s_minperiod,&__pyx_n_s_maxperiod,&__pyx_n_s_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, 1); __PYX_ERR(0, 8177, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxperiod); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAVP") < 0)) __PYX_ERR(0, 8177, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - __pyx_v_periods = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_minperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8177, __pyx_L3_error) - } else { - __pyx_v_minperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_maxperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8177, __pyx_L3_error) - } else { - __pyx_v_maxperiod = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8177, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8177, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8177, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periods), __pyx_ptype_5numpy_ndarray, 0, "periods", 0))) __PYX_ERR(0, 8177, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_214MAVP(__pyx_self, __pyx_v_real, __pyx_v_periods, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_214MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - double *__pyx_v_periods_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MAVP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - __Pyx_INCREF((PyObject *)__pyx_v_periods); - - /* "talib/func.pyx":8203 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8204 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__955, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8204, __pyx_L1_error) - - /* "talib/func.pyx":8203 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8205 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8206 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__956, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8206, __pyx_L1_error) - - /* "talib/func.pyx":8205 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8207 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8208 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8208, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8207 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8209 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8210 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("periods is not double") - * if periods.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_periods) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8211 - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") # <<<<<<<<<<<<<< - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__957, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8211, __pyx_L1_error) - - /* "talib/func.pyx":8210 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("periods is not double") - * if periods.ndim != 1: - */ - } - - /* "talib/func.pyx":8212 - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - * if periods.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_periods->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8213 - * raise Exception("periods is not double") - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__958, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8213, __pyx_L1_error) - - /* "talib/func.pyx":8212 - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - * if periods.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8214 - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_periods) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8215 - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) # <<<<<<<<<<<<<< - * periods_data = periods.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_periods); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8215, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_periods, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8214 - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - */ - } - - /* "talib/func.pyx":8216 - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * if length != periods.shape[0]: - */ - __pyx_v_periods_data = ((double *)__pyx_v_periods->data); - - /* "talib/func.pyx":8217 - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * if length != periods.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8218 - * periods_data = periods.data - * length = real.shape[0] - * if length != periods.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_periods->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8219 - * length = real.shape[0] - * if length != periods.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__959, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8219, __pyx_L1_error) - - /* "talib/func.pyx":8218 - * periods_data = periods.data - * length = real.shape[0] - * if length != periods.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8220 - * if length != periods.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8221 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8222 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8223 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = periods_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8224 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = periods_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8223 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = periods_data[i] - */ - } - - /* "talib/func.pyx":8225 - * if val != val: - * continue - * val = periods_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_periods_data[__pyx_v_i]); - - /* "talib/func.pyx":8226 - * continue - * val = periods_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8227 - * val = periods_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8226 - * continue - * val = periods_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8228 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8229 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8231 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__960, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8231, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":8232 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8233 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MAVP_Lookback(__pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype)); - - /* "talib/func.pyx":8234 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8234, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8235 - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8236 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8237 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAVP", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8238 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAVP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MAVP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), ((double *)(__pyx_v_periods_data + __pyx_v_begidx)), __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8239 - * outreal_data[i] = NaN - * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAVP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAVP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8240 - * retCode = lib.TA_MAVP( 0 , endidx , (real_data+begidx) , (periods_data+begidx) , minperiod , maxperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAVP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8177 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XDECREF((PyObject *)__pyx_v_periods); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8244 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_217MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_216MAX[] = " MAX(real[, timeperiod=?])\n\n Highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_217MAX = {"MAX", (PyCFunction)__pyx_pw_5talib_4func_217MAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_216MAX}; -static PyObject *__pyx_pw_5talib_4func_217MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAX") < 0)) __PYX_ERR(0, 8244, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8244, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8244, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8244, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_216MAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_216MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MAX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8266 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8267 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__961, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8267, __pyx_L1_error) - - /* "talib/func.pyx":8266 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8268 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8269 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__962, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8269, __pyx_L1_error) - - /* "talib/func.pyx":8268 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8270 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8271 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8271, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8270 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8272 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8273 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8274 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8275 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8276 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8277 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8278 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8277 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8279 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8280 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8282 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__963, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8282, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8283 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8284 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MAX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8285 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8285, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8286 - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8287 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8288 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAX", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8289 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MAX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8290 - * outreal_data[i] = NaN - * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8291 - * retCode = lib.TA_MAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MAX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8244 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_219MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_218MAXINDEX[] = " MAXINDEX(real[, timeperiod=?])\n\n Index of highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_219MAXINDEX = {"MAXINDEX", (PyCFunction)__pyx_pw_5talib_4func_219MAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_218MAXINDEX}; -static PyObject *__pyx_pw_5talib_4func_219MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAXINDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAXINDEX") < 0)) __PYX_ERR(0, 8295, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8295, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8295, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8295, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_218MAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_218MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MAXINDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8317 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8318 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__964, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8318, __pyx_L1_error) - - /* "talib/func.pyx":8317 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8319 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8320 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__965, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8320, __pyx_L1_error) - - /* "talib/func.pyx":8319 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8321 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8322 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8322, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8321 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8323 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8324 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8325 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8326 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8327 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8328 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8329 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8328 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8330 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8331 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8333 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__966, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8333, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8334 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8335 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MAXINDEX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8336 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8336, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8337 - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":8338 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8339 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MAXINDEX", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":8340 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAXINDEX", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_MAXINDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8341 - * outinteger_data[i] = 0 - * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MAXINDEX", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8342 - * retCode = lib.TA_MAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MAXINDEX", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":8295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_221MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_220MEDPRICE[] = " MEDPRICE(high, low)\n\n Median Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_221MEDPRICE = {"MEDPRICE", (PyCFunction)__pyx_pw_5talib_4func_221MEDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_220MEDPRICE}; -static PyObject *__pyx_pw_5talib_4func_221MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MEDPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, 1); __PYX_ERR(0, 8346, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MEDPRICE") < 0)) __PYX_ERR(0, 8346, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8346, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 8346, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 8346, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_220MEDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_220MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MEDPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":8367 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8368 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__967, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8368, __pyx_L1_error) - - /* "talib/func.pyx":8367 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":8369 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8370 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__968, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8370, __pyx_L1_error) - - /* "talib/func.pyx":8369 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8371 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8372 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8372, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8371 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":8373 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":8374 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8375 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__969, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8375, __pyx_L1_error) - - /* "talib/func.pyx":8374 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":8376 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8377 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__970, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8377, __pyx_L1_error) - - /* "talib/func.pyx":8376 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8378 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8379 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8379, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8378 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":8380 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":8381 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":8382 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8383 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__971, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8383, __pyx_L1_error) - - /* "talib/func.pyx":8382 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8384 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8385 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8386 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":8387 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8388 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8387 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":8389 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":8390 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8391 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8390 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8392 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8393 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8395 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__972, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8395, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":8396 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8397 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MEDPRICE_Lookback()); - - /* "talib/func.pyx":8398 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8398, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8399 - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8400 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8401 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MEDPRICE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8402 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MEDPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MEDPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8403 - * outreal_data[i] = NaN - * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MEDPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MEDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8404 - * retCode = lib.TA_MEDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MEDPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8408 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_223MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_222MFI[] = " MFI(high, low, close, volume[, timeperiod=?])\n\n Money Flow Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_223MFI = {"MFI", (PyCFunction)__pyx_pw_5talib_4func_223MFI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_222MFI}; -static PyObject *__pyx_pw_5talib_4func_223MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MFI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_timeperiod,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 1); __PYX_ERR(0, 8408, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 2); __PYX_ERR(0, 8408, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 3); __PYX_ERR(0, 8408, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MFI") < 0)) __PYX_ERR(0, 8408, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8408, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8408, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 8408, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 8408, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 8408, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 8408, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_222MFI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_222MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MFI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/func.pyx":8433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8434 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__973, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8434, __pyx_L1_error) - - /* "talib/func.pyx":8433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":8435 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8436 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__974, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8436, __pyx_L1_error) - - /* "talib/func.pyx":8435 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8437 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8438 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8438, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8437 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":8439 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":8440 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8441 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__975, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8441, __pyx_L1_error) - - /* "talib/func.pyx":8440 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":8442 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8443 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__976, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8443, __pyx_L1_error) - - /* "talib/func.pyx":8442 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8444 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8445 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8445, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8444 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":8446 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":8447 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8448 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__977, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8448, __pyx_L1_error) - - /* "talib/func.pyx":8447 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":8449 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8450 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__978, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8450, __pyx_L1_error) - - /* "talib/func.pyx":8449 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8451 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8452 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8452, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8451 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":8453 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":8454 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8455 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__979, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8455, __pyx_L1_error) - - /* "talib/func.pyx":8454 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/func.pyx":8456 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8457 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__980, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8457, __pyx_L1_error) - - /* "talib/func.pyx":8456 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8458 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8459 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8459, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8458 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/func.pyx":8460 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/func.pyx":8461 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":8462 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8463 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__981, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8463, __pyx_L1_error) - - /* "talib/func.pyx":8462 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":8464 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8465 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__982, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8465, __pyx_L1_error) - - /* "talib/func.pyx":8464 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/func.pyx":8466 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8467 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__983, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8467, __pyx_L1_error) - - /* "talib/func.pyx":8466 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8468 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8469 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8470 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":8471 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8472 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":8471 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":8473 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":8474 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8475 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":8474 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":8476 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":8477 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8478 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = volume_data[i] - * if val != val: - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":8477 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - } - - /* "talib/func.pyx":8479 - * if val != val: - * continue - * val = volume_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); - - /* "talib/func.pyx":8480 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8481 - * val = volume_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L18_continue; - - /* "talib/func.pyx":8480 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8482 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8483 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L19_break; - __pyx_L18_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8485 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__984, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8485, __pyx_L1_error) - } - __pyx_L19_break:; - - /* "talib/func.pyx":8486 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8487 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MFI_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8488 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8488, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8489 - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8490 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8491 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MFI", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8492 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MFI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MFI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8493 - * outreal_data[i] = NaN - * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MFI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MFI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8494 - * retCode = lib.TA_MFI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , (volume_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MFI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8408 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8498 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_225MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_224MIDPOINT[] = " MIDPOINT(real[, timeperiod=?])\n\n MidPoint over period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_225MIDPOINT = {"MIDPOINT", (PyCFunction)__pyx_pw_5talib_4func_225MIDPOINT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_224MIDPOINT}; -static PyObject *__pyx_pw_5talib_4func_225MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIDPOINT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPOINT") < 0)) __PYX_ERR(0, 8498, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8498, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIDPOINT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8498, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8498, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_224MIDPOINT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_224MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MIDPOINT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8520 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8521 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__985, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8521, __pyx_L1_error) - - /* "talib/func.pyx":8520 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8522 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8523 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__986, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8523, __pyx_L1_error) - - /* "talib/func.pyx":8522 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8524 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8525 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8525, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8524 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8526 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8527 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8528 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8529 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8530 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8531 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8532 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8531 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8533 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8534 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8536 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__987, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8536, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8537 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8538 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MIDPOINT_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8539 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8539, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8540 - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8541 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8542 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPOINT", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8543 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIDPOINT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIDPOINT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8544 - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPOINT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIDPOINT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8545 - * retCode = lib.TA_MIDPOINT( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPOINT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8498 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8549 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_227MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_226MIDPRICE[] = " MIDPRICE(high, low[, timeperiod=?])\n\n Midpoint Price over period (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_227MIDPRICE = {"MIDPRICE", (PyCFunction)__pyx_pw_5talib_4func_227MIDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_226MIDPRICE}; -static PyObject *__pyx_pw_5talib_4func_227MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIDPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, 1); __PYX_ERR(0, 8549, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPRICE") < 0)) __PYX_ERR(0, 8549, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8549, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8549, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 8549, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 8549, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_226MIDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_226MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MIDPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":8572 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8573 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__988, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8573, __pyx_L1_error) - - /* "talib/func.pyx":8572 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":8574 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8575 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__989, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8575, __pyx_L1_error) - - /* "talib/func.pyx":8574 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8576 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8577 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8577, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8576 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":8578 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":8579 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8580 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__990, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8580, __pyx_L1_error) - - /* "talib/func.pyx":8579 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":8581 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8582 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__991, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8582, __pyx_L1_error) - - /* "talib/func.pyx":8581 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8583 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8584 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8584, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8583 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":8585 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":8586 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":8587 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8588 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__992, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8588, __pyx_L1_error) - - /* "talib/func.pyx":8587 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8589 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8590 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8591 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":8592 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8593 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8592 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":8594 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":8595 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8596 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8595 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8597 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8598 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8600 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__993, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8600, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":8601 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8602 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MIDPRICE_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8603 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8603, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8604 - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8605 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8606 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPRICE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8607 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIDPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIDPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8608 - * outreal_data[i] = NaN - * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8609 - * retCode = lib.TA_MIDPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIDPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8549 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_229MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_228MIN[] = " MIN(real[, timeperiod=?])\n\n Lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_229MIN = {"MIN", (PyCFunction)__pyx_pw_5talib_4func_229MIN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_228MIN}; -static PyObject *__pyx_pw_5talib_4func_229MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIN") < 0)) __PYX_ERR(0, 8613, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8613, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIN", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8613, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8613, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_228MIN(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_228MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8635 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8636 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__994, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8636, __pyx_L1_error) - - /* "talib/func.pyx":8635 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8637 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8638 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__995, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8638, __pyx_L1_error) - - /* "talib/func.pyx":8637 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8639 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8640 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8640, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8639 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8641 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8642 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8643 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8644 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8645 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8646 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8647 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8646 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8648 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8649 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8651 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__996, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8651, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8652 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8653 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MIN_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8654 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8654, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8655 - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8656 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8657 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8658 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8659 - * outreal_data[i] = NaN - * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8660 - * retCode = lib.TA_MIN( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_231MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_230MININDEX[] = " MININDEX(real[, timeperiod=?])\n\n Index of lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_4func_231MININDEX = {"MININDEX", (PyCFunction)__pyx_pw_5talib_4func_231MININDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_230MININDEX}; -static PyObject *__pyx_pw_5talib_4func_231MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MININDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MININDEX") < 0)) __PYX_ERR(0, 8664, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8664, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MININDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8664, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8664, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_230MININDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_230MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outinteger = 0; - int *__pyx_v_outinteger_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MININDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8686 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8687 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__997, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8687, __pyx_L1_error) - - /* "talib/func.pyx":8686 - * np.ndarray outinteger - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8688 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8689 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__998, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8689, __pyx_L1_error) - - /* "talib/func.pyx":8688 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8690 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8691 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8691, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8690 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8692 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8693 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8694 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8695 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8696 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8697 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8698 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8697 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8699 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8700 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8702 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__999, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8702, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8703 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8704 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MININDEX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8705 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8705, __pyx_L1_error) - __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8706 - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - */ - __pyx_v_outinteger_data = ((int *)__pyx_v_outinteger->data); - - /* "talib/func.pyx":8707 - * outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outinteger_data[i] = 0 - * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8708 - * outinteger_data = outinteger.data - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MININDEX", retCode) - */ - (__pyx_v_outinteger_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":8709 - * for i from 0 <= i < min(lookback, length): - * outinteger_data[i] = 0 - * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MININDEX", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_MININDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outinteger_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8710 - * outinteger_data[i] = 0 - * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MININDEX", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MININDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8711 - * retCode = lib.TA_MININDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outinteger_data+lookback) ) - * _ta_check_success("TA_MININDEX", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outinteger)); - __pyx_r = ((PyObject *)__pyx_v_outinteger); - goto __pyx_L0; - - /* "talib/func.pyx":8664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outinteger); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_233MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_232MINMAX[] = " MINMAX(real[, timeperiod=?])\n\n Lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n min\n max\n "; -static PyMethodDef __pyx_mdef_5talib_4func_233MINMAX = {"MINMAX", (PyCFunction)__pyx_pw_5talib_4func_233MINMAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_232MINMAX}; -static PyObject *__pyx_pw_5talib_4func_233MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINMAX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAX") < 0)) __PYX_ERR(0, 8715, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8715, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINMAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8715, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8715, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_232MINMAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_232MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outmin = 0; - double *__pyx_v_outmin_data; - PyArrayObject *__pyx_v_outmax = 0; - double *__pyx_v_outmax_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MINMAX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8740 - * np.ndarray outmax - * double* outmax_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8741 - * double* outmax_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1000, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8741, __pyx_L1_error) - - /* "talib/func.pyx":8740 - * np.ndarray outmax - * double* outmax_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8742 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8743 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1001, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8743, __pyx_L1_error) - - /* "talib/func.pyx":8742 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8744 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8745 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8745, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8744 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8746 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8747 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8748 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8749 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8750 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8751 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8752 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8751 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8753 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8754 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8756 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1002, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8756, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8757 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) - * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8758 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmin_data = outmin.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MINMAX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8759 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) - * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmin_data = outmin.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8759, __pyx_L1_error) - __pyx_v_outmin = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8760 - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) - * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmin_data = outmin.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmin_data[i] = NaN - */ - __pyx_v_outmin_data = ((double *)__pyx_v_outmin->data); - - /* "talib/func.pyx":8761 - * outmin = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmin_data = outmin.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmin_data[i] = NaN - * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8762 - * outmin_data = outmin.data - * for i from 0 <= i < min(lookback, length): - * outmin_data[i] = NaN # <<<<<<<<<<<<<< - * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmax_data = outmax.data - */ - (__pyx_v_outmin_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8763 - * for i from 0 <= i < min(lookback, length): - * outmin_data[i] = NaN - * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmax_data = outmax.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8763, __pyx_L1_error) - __pyx_v_outmax = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8764 - * outmin_data[i] = NaN - * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmax_data = outmax.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmax_data[i] = NaN - */ - __pyx_v_outmax_data = ((double *)__pyx_v_outmax->data); - - /* "talib/func.pyx":8765 - * outmax = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outmax_data = outmax.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmax_data[i] = NaN - * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8766 - * outmax_data = outmax.data - * for i from 0 <= i < min(lookback, length): - * outmax_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) - * _ta_check_success("TA_MINMAX", retCode) - */ - (__pyx_v_outmax_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8767 - * for i from 0 <= i < min(lookback, length): - * outmax_data[i] = NaN - * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINMAX", retCode) - * return outmin , outmax - */ - __pyx_v_retCode = TA_MINMAX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outmin_data + __pyx_v_lookback)), ((double *)(__pyx_v_outmax_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8768 - * outmax_data[i] = NaN - * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) - * _ta_check_success("TA_MINMAX", retCode) # <<<<<<<<<<<<<< - * return outmin , outmax - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINMAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8769 - * retCode = lib.TA_MINMAX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outmin_data+lookback) , (outmax_data+lookback) ) - * _ta_check_success("TA_MINMAX", retCode) - * return outmin , outmax # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outmin)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmin)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outmin)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmax)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmax)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmax)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":8715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outmin); - __Pyx_XDECREF((PyObject *)__pyx_v_outmax); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_235MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_234MINMAXINDEX[] = " MINMAXINDEX(real[, timeperiod=?])\n\n Indexes of lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n minidx\n maxidx\n "; -static PyMethodDef __pyx_mdef_5talib_4func_235MINMAXINDEX = {"MINMAXINDEX", (PyCFunction)__pyx_pw_5talib_4func_235MINMAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_234MINMAXINDEX}; -static PyObject *__pyx_pw_5talib_4func_235MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINMAXINDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAXINDEX") < 0)) __PYX_ERR(0, 8773, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8773, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINMAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8773, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8773, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_234MINMAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_234MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outminidx = 0; - int *__pyx_v_outminidx_data; - PyArrayObject *__pyx_v_outmaxidx = 0; - int *__pyx_v_outmaxidx_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MINMAXINDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8798 - * np.ndarray outmaxidx - * int* outmaxidx_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8799 - * int* outmaxidx_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1003, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8799, __pyx_L1_error) - - /* "talib/func.pyx":8798 - * np.ndarray outmaxidx - * int* outmaxidx_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8800 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8801 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1004, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8801, __pyx_L1_error) - - /* "talib/func.pyx":8800 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8802 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8803 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8803, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8802 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":8804 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":8805 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":8806 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8807 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8808 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":8809 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8810 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":8809 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8811 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8812 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8814 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1005, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8814, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":8815 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) - * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8816 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outminidx_data = outminidx.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MINMAXINDEX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8817 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) - * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outminidx_data = outminidx.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8817, __pyx_L1_error) - __pyx_v_outminidx = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8818 - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) - * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outminidx_data = outminidx.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outminidx_data[i] = 0 - */ - __pyx_v_outminidx_data = ((int *)__pyx_v_outminidx->data); - - /* "talib/func.pyx":8819 - * outminidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outminidx_data = outminidx.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outminidx_data[i] = 0 - * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8820 - * outminidx_data = outminidx.data - * for i from 0 <= i < min(lookback, length): - * outminidx_data[i] = 0 # <<<<<<<<<<<<<< - * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outmaxidx_data = outmaxidx.data - */ - (__pyx_v_outminidx_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":8821 - * for i from 0 <= i < min(lookback, length): - * outminidx_data[i] = 0 - * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outmaxidx_data = outmaxidx.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8821, __pyx_L1_error) - __pyx_v_outmaxidx = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8822 - * outminidx_data[i] = 0 - * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outmaxidx_data = outmaxidx.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outmaxidx_data[i] = 0 - */ - __pyx_v_outmaxidx_data = ((int *)__pyx_v_outmaxidx->data); - - /* "talib/func.pyx":8823 - * outmaxidx = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) - * outmaxidx_data = outmaxidx.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outmaxidx_data[i] = 0 - * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8824 - * outmaxidx_data = outmaxidx.data - * for i from 0 <= i < min(lookback, length): - * outmaxidx_data[i] = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) - * _ta_check_success("TA_MINMAXINDEX", retCode) - */ - (__pyx_v_outmaxidx_data[__pyx_v_i]) = 0; - } - - /* "talib/func.pyx":8825 - * for i from 0 <= i < min(lookback, length): - * outmaxidx_data[i] = 0 - * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINMAXINDEX", retCode) - * return outminidx , outmaxidx - */ - __pyx_v_retCode = TA_MINMAXINDEX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((int *)(__pyx_v_outminidx_data + __pyx_v_lookback)), ((int *)(__pyx_v_outmaxidx_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8826 - * outmaxidx_data[i] = 0 - * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) - * _ta_check_success("TA_MINMAXINDEX", retCode) # <<<<<<<<<<<<<< - * return outminidx , outmaxidx - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINMAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8827 - * retCode = lib.TA_MINMAXINDEX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outminidx_data+lookback) , (outmaxidx_data+lookback) ) - * _ta_check_success("TA_MINMAXINDEX", retCode) - * return outminidx , outmaxidx # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outminidx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outminidx)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outminidx)); - __Pyx_INCREF(((PyObject *)__pyx_v_outmaxidx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outmaxidx)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outmaxidx)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":8773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outminidx); - __Pyx_XDECREF((PyObject *)__pyx_v_outmaxidx); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_237MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_236MINUS_DI[] = " MINUS_DI(high, low, close[, timeperiod=?])\n\n Minus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_237MINUS_DI = {"MINUS_DI", (PyCFunction)__pyx_pw_5talib_4func_237MINUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_236MINUS_DI}; -static PyObject *__pyx_pw_5talib_4func_237MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINUS_DI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 1); __PYX_ERR(0, 8831, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 2); __PYX_ERR(0, 8831, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DI") < 0)) __PYX_ERR(0, 8831, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8831, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8831, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 8831, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 8831, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 8831, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_236MINUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_236MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MINUS_DI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":8855 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8856 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1006, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8856, __pyx_L1_error) - - /* "talib/func.pyx":8855 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":8857 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8858 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1007, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8858, __pyx_L1_error) - - /* "talib/func.pyx":8857 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8859 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8860 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8860, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8859 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":8861 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":8862 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8863 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1008, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8863, __pyx_L1_error) - - /* "talib/func.pyx":8862 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":8864 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8865 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1009, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8865, __pyx_L1_error) - - /* "talib/func.pyx":8864 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8866 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8867 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8867, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8866 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":8868 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":8869 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8870 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1010, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8870, __pyx_L1_error) - - /* "talib/func.pyx":8869 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":8871 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8872 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1011, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8872, __pyx_L1_error) - - /* "talib/func.pyx":8871 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8873 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8874 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8874, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8873 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":8875 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":8876 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":8877 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8878 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1012, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8878, __pyx_L1_error) - - /* "talib/func.pyx":8877 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":8879 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8880 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1013, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8880, __pyx_L1_error) - - /* "talib/func.pyx":8879 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8881 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8882 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8883 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":8884 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8885 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":8884 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":8886 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":8887 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8888 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":8887 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":8889 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":8890 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8891 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":8890 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8892 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8893 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8895 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1014, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8895, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":8896 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8897 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MINUS_DI_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8898 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8898, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8899 - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8900 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8901 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DI", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8902 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINUS_DI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MINUS_DI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8903 - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8904 - * retCode = lib.TA_MINUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8908 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_239MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_238MINUS_DM[] = " MINUS_DM(high, low[, timeperiod=?])\n\n Minus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_239MINUS_DM = {"MINUS_DM", (PyCFunction)__pyx_pw_5talib_4func_239MINUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_238MINUS_DM}; -static PyObject *__pyx_pw_5talib_4func_239MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINUS_DM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, 1); __PYX_ERR(0, 8908, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DM") < 0)) __PYX_ERR(0, 8908, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8908, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8908, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 8908, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 8908, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_238MINUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_238MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MINUS_DM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":8931 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8932 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1015, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8932, __pyx_L1_error) - - /* "talib/func.pyx":8931 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":8933 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8934 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1016, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8934, __pyx_L1_error) - - /* "talib/func.pyx":8933 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8935 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8936 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8936, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8935 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":8937 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":8938 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8939 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1017, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8939, __pyx_L1_error) - - /* "talib/func.pyx":8938 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":8940 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8941 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1018, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8941, __pyx_L1_error) - - /* "talib/func.pyx":8940 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8942 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8943 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8943, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8942 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":8944 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":8945 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":8946 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8947 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1019, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8947, __pyx_L1_error) - - /* "talib/func.pyx":8946 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":8948 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":8949 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8950 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":8951 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8952 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8951 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":8953 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":8954 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8955 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":8954 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":8956 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":8957 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":8959 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1020, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8959, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":8960 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":8961 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MINUS_DM_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":8962 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8962, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8963 - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":8964 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":8965 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DM", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":8966 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINUS_DM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MINUS_DM(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":8967 - * outreal_data[i] = NaN - * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":8968 - * retCode = lib.TA_MINUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MINUS_DM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8908 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":8972 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_241MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_240MOM[] = " MOM(real[, timeperiod=?])\n\n Momentum (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_241MOM = {"MOM", (PyCFunction)__pyx_pw_5talib_4func_241MOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_240MOM}; -static PyObject *__pyx_pw_5talib_4func_241MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MOM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MOM") < 0)) __PYX_ERR(0, 8972, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8972, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MOM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8972, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8972, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_240MOM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_240MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MOM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":8994 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8995 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1021, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8995, __pyx_L1_error) - - /* "talib/func.pyx":8994 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":8996 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8997 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1022, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8997, __pyx_L1_error) - - /* "talib/func.pyx":8996 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":8998 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":8999 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8999, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":8998 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9000 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9001 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9002 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9003 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9004 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9005 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9006 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9005 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9007 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9008 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9010 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1023, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9010, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9011 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9012 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MOM_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9013 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9013, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9014 - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9015 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9016 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MOM", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9017 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MOM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MOM(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9018 - * outreal_data[i] = NaN - * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MOM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9019 - * retCode = lib.TA_MOM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MOM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":8972 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9023 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_243MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_242MULT[] = " MULT(real0, real1)\n\n Vector Arithmetic Mult (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_243MULT = {"MULT", (PyCFunction)__pyx_pw_5talib_4func_243MULT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_242MULT}; -static PyObject *__pyx_pw_5talib_4func_243MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MULT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, 1); __PYX_ERR(0, 9023, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MULT") < 0)) __PYX_ERR(0, 9023, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9023, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 9023, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 9023, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_242MULT(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_242MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("MULT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":9045 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9046 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1024, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9046, __pyx_L1_error) - - /* "talib/func.pyx":9045 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":9047 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9048 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1025, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9048, __pyx_L1_error) - - /* "talib/func.pyx":9047 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9049 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9050 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9050, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9049 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":9051 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":9052 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9053 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1026, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9053, __pyx_L1_error) - - /* "talib/func.pyx":9052 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":9054 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9055 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1027, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9055, __pyx_L1_error) - - /* "talib/func.pyx":9054 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9056 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9057 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9057, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9056 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":9058 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":9059 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":9060 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9061 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1028, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9061, __pyx_L1_error) - - /* "talib/func.pyx":9060 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9062 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9063 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9064 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":9065 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9066 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9065 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":9067 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":9068 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9069 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9068 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9070 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9071 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9073 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MULT_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1029, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9073, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":9074 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_MULT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9075 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MULT_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_MULT_Lookback()); - - /* "talib/func.pyx":9076 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MULT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9076, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9077 - * lookback = begidx + lib.TA_MULT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9078 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9079 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MULT", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9080 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MULT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MULT(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9081 - * outreal_data[i] = NaN - * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MULT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MULT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9082 - * retCode = lib.TA_MULT( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_MULT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9023 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9086 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_245NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_244NATR[] = " NATR(high, low, close[, timeperiod=?])\n\n Normalized Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_245NATR = {"NATR", (PyCFunction)__pyx_pw_5talib_4func_245NATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_244NATR}; -static PyObject *__pyx_pw_5talib_4func_245NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("NATR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 1); __PYX_ERR(0, 9086, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 2); __PYX_ERR(0, 9086, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NATR") < 0)) __PYX_ERR(0, 9086, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9086, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9086, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 9086, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 9086, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 9086, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_244NATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_244NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("NATR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":9110 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9111 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1030, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9111, __pyx_L1_error) - - /* "talib/func.pyx":9110 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":9112 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9113 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1031, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9113, __pyx_L1_error) - - /* "talib/func.pyx":9112 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9114 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9115 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9115, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9114 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":9116 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":9117 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9118 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1032, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9118, __pyx_L1_error) - - /* "talib/func.pyx":9117 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":9119 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9120 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1033, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9120, __pyx_L1_error) - - /* "talib/func.pyx":9119 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9121 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9122 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9122, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9121 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":9123 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":9124 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9125 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1034, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9125, __pyx_L1_error) - - /* "talib/func.pyx":9124 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":9126 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9127 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1035, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9127, __pyx_L1_error) - - /* "talib/func.pyx":9126 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9128 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9129 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9129, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9128 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":9130 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":9131 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":9132 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9133 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1036, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9133, __pyx_L1_error) - - /* "talib/func.pyx":9132 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":9134 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9135 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1037, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9135, __pyx_L1_error) - - /* "talib/func.pyx":9134 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9136 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9137 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9138 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":9139 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9140 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9139 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":9141 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":9142 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9143 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9142 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":9144 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":9145 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9146 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9145 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9147 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9148 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9150 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1038, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9150, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":9151 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9152 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_NATR_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9153 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9153, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9154 - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9155 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9156 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_NATR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9157 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_NATR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_NATR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9158 - * outreal_data[i] = NaN - * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_NATR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_NATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9159 - * retCode = lib.TA_NATR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_NATR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9086 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9163 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_247OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_246OBV[] = " OBV(real, volume)\n\n On Balance Volume (Volume Indicators)\n\n Inputs:\n real: (any ndarray)\n prices: ['volume']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_247OBV = {"OBV", (PyCFunction)__pyx_pw_5talib_4func_247OBV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_246OBV}; -static PyObject *__pyx_pw_5talib_4func_247OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - PyArrayObject *__pyx_v_volume = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("OBV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_volume,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, 1); __PYX_ERR(0, 9163, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "OBV") < 0)) __PYX_ERR(0, 9163, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real = ((PyArrayObject *)values[0]); - __pyx_v_volume = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9163, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9163, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 9163, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_246OBV(__pyx_self, __pyx_v_real, __pyx_v_volume); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_246OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("OBV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/func.pyx":9185 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9186 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1039, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9186, __pyx_L1_error) - - /* "talib/func.pyx":9185 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9187 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9188 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1040, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9188, __pyx_L1_error) - - /* "talib/func.pyx":9187 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9189 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9190 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9190, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9189 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9191 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9192 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9193 - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1041, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9193, __pyx_L1_error) - - /* "talib/func.pyx":9192 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/func.pyx":9194 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9195 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1042, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9195, __pyx_L1_error) - - /* "talib/func.pyx":9194 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9196 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9197 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9197, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9196 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/func.pyx":9198 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * if length != volume.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/func.pyx":9199 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9200 - * volume_data = volume.data - * length = real.shape[0] - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9201 - * length = real.shape[0] - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1043, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9201, __pyx_L1_error) - - /* "talib/func.pyx":9200 - * volume_data = volume.data - * length = real.shape[0] - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9202 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9203 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9204 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9205 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9206 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = volume_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9205 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = volume_data[i] - */ - } - - /* "talib/func.pyx":9207 - * if val != val: - * continue - * val = volume_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_volume_data[__pyx_v_i]); - - /* "talib/func.pyx":9208 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9209 - * val = volume_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9208 - * continue - * val = volume_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9210 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9211 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9213 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_OBV_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1044, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9213, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":9214 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_OBV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9215 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_OBV_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_OBV_Lookback()); - - /* "talib/func.pyx":9216 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_OBV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9216, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9217 - * lookback = begidx + lib.TA_OBV_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9218 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9219 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_OBV", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9220 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_OBV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_OBV(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), ((double *)(__pyx_v_volume_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9221 - * outreal_data[i] = NaN - * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_OBV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_OBV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9222 - * retCode = lib.TA_OBV( 0 , endidx , (real_data+begidx) , (volume_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_OBV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9163 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9226 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_249PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_248PLUS_DI[] = " PLUS_DI(high, low, close[, timeperiod=?])\n\n Plus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_249PLUS_DI = {"PLUS_DI", (PyCFunction)__pyx_pw_5talib_4func_249PLUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_248PLUS_DI}; -static PyObject *__pyx_pw_5talib_4func_249PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PLUS_DI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 1); __PYX_ERR(0, 9226, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 2); __PYX_ERR(0, 9226, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DI") < 0)) __PYX_ERR(0, 9226, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9226, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9226, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 9226, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 9226, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 9226, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_248PLUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_248PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("PLUS_DI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":9250 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9251 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1045, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9251, __pyx_L1_error) - - /* "talib/func.pyx":9250 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":9252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1046, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9253, __pyx_L1_error) - - /* "talib/func.pyx":9252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9255 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9255, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":9256 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":9257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1047, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9258, __pyx_L1_error) - - /* "talib/func.pyx":9257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":9259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1048, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9260, __pyx_L1_error) - - /* "talib/func.pyx":9259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9262 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9262, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":9263 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":9264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1049, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9265, __pyx_L1_error) - - /* "talib/func.pyx":9264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":9266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1050, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9267, __pyx_L1_error) - - /* "talib/func.pyx":9266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9269 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9269, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":9270 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":9271 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":9272 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9273 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1051, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9273, __pyx_L1_error) - - /* "talib/func.pyx":9272 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":9274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1052, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9275, __pyx_L1_error) - - /* "talib/func.pyx":9274 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9276 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9277 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9278 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":9279 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9280 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9279 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":9281 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":9282 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9283 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9282 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":9284 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":9285 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9286 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":9285 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9287 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9288 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9290 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1053, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9290, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":9291 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9292 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_PLUS_DI_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9293 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9293, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9294 - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9295 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9296 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DI", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9297 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PLUS_DI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PLUS_DI(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9298 - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PLUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9299 - * retCode = lib.TA_PLUS_DI( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9226 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9303 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_251PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_250PLUS_DM[] = " PLUS_DM(high, low[, timeperiod=?])\n\n Plus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_251PLUS_DM = {"PLUS_DM", (PyCFunction)__pyx_pw_5talib_4func_251PLUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_250PLUS_DM}; -static PyObject *__pyx_pw_5talib_4func_251PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PLUS_DM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, 1); __PYX_ERR(0, 9303, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DM") < 0)) __PYX_ERR(0, 9303, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9303, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9303, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 9303, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 9303, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_250PLUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_250PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("PLUS_DM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":9326 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9327 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1054, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9327, __pyx_L1_error) - - /* "talib/func.pyx":9326 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":9328 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9329 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1055, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9329, __pyx_L1_error) - - /* "talib/func.pyx":9328 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9330 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9331 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9331, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9330 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":9332 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":9333 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9334 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1056, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9334, __pyx_L1_error) - - /* "talib/func.pyx":9333 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":9335 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9336 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1057, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9336, __pyx_L1_error) - - /* "talib/func.pyx":9335 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9337 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9338 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9338, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9337 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":9339 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":9340 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":9341 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9342 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1058, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9342, __pyx_L1_error) - - /* "talib/func.pyx":9341 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9343 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9344 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9345 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":9346 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9347 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9346 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":9348 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":9349 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9350 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9349 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9351 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9352 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9354 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1059, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9354, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":9355 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9356 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_PLUS_DM_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9357 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9357, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9358 - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9359 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9360 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DM", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9361 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PLUS_DM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PLUS_DM(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9362 - * outreal_data[i] = NaN - * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PLUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9363 - * retCode = lib.TA_PLUS_DM( 0 , endidx , (high_data+begidx) , (low_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PLUS_DM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9303 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9367 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_253PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_252PPO[] = " PPO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Percentage Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_253PPO = {"PPO", (PyCFunction)__pyx_pw_5talib_4func_253PPO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_252PPO}; -static PyObject *__pyx_pw_5talib_4func_253PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PPO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PPO") < 0)) __PYX_ERR(0, 9367, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9367, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9367, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9367, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PPO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9367, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9367, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_252PPO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_252PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("PPO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9391 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9392 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1060, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9392, __pyx_L1_error) - - /* "talib/func.pyx":9391 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9393 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9394 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1061, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9394, __pyx_L1_error) - - /* "talib/func.pyx":9393 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9395 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9396 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9396, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9395 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9397 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9398 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9399 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9400 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9401 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9402 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9403 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9402 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9404 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9405 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9407 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1062, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9407, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9408 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9409 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_PPO_Lookback(__pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype)); - - /* "talib/func.pyx":9410 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9410, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9411 - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9412 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9413 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PPO", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9414 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PPO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PPO(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9415 - * outreal_data[i] = NaN - * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PPO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PPO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9416 - * retCode = lib.TA_PPO( 0 , endidx , (real_data+begidx) , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_PPO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9367 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9420 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_255ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_254ROC[] = " ROC(real[, timeperiod=?])\n\n Rate of change : ((real/prevPrice)-1)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_255ROC = {"ROC", (PyCFunction)__pyx_pw_5talib_4func_255ROC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_254ROC}; -static PyObject *__pyx_pw_5talib_4func_255ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROC") < 0)) __PYX_ERR(0, 9420, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9420, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9420, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9420, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_254ROC(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_254ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ROC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9442 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9443 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1063, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9443, __pyx_L1_error) - - /* "talib/func.pyx":9442 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9444 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9445 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1064, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9445, __pyx_L1_error) - - /* "talib/func.pyx":9444 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9446 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9447 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9447, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9446 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9448 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9449 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9450 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9451 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9452 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9453 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9454 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9453 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9455 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9456 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9458 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1065, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9458, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9459 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9460 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ROC_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9461 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9461, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9462 - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9463 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9464 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROC", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9465 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROC(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9466 - * outreal_data[i] = NaN - * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9467 - * retCode = lib.TA_ROC( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9420 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9471 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_257ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_256ROCP[] = " ROCP(real[, timeperiod=?])\n\n Rate of change Percentage: (real-prevPrice)/prevPrice (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_257ROCP = {"ROCP", (PyCFunction)__pyx_pw_5talib_4func_257ROCP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_256ROCP}; -static PyObject *__pyx_pw_5talib_4func_257ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCP") < 0)) __PYX_ERR(0, 9471, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9471, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCP", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9471, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9471, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_256ROCP(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_256ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ROCP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9493 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9494 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1066, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9494, __pyx_L1_error) - - /* "talib/func.pyx":9493 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9495 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9496 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1067, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9496, __pyx_L1_error) - - /* "talib/func.pyx":9495 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9497 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9498 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9498, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9497 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9499 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9500 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9501 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9502 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9503 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9504 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9505 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9504 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9506 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9507 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9509 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1068, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9509, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9510 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9511 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ROCP_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9512 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9512, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9513 - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9514 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9515 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCP", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9516 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCP(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9517 - * outreal_data[i] = NaN - * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9518 - * retCode = lib.TA_ROCP( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9471 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_259ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_258ROCR[] = " ROCR(real[, timeperiod=?])\n\n Rate of change ratio: (real/prevPrice) (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_259ROCR = {"ROCR", (PyCFunction)__pyx_pw_5talib_4func_259ROCR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_258ROCR}; -static PyObject *__pyx_pw_5talib_4func_259ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR") < 0)) __PYX_ERR(0, 9522, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9522, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCR", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9522, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9522, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_258ROCR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_258ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ROCR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9544 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9545 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1069, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9545, __pyx_L1_error) - - /* "talib/func.pyx":9544 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9546 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9547 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1070, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9547, __pyx_L1_error) - - /* "talib/func.pyx":9546 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9548 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9549 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9549, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9548 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9550 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9551 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9552 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9553 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9554 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9555 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9556 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9555 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9557 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9558 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9560 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1071, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9560, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9561 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9562 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ROCR_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9563 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9563, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9564 - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9565 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9566 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9567 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9568 - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9569 - * retCode = lib.TA_ROCR( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9573 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_261ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_260ROCR100[] = " ROCR100(real[, timeperiod=?])\n\n Rate of change ratio 100 scale: (real/prevPrice)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_261ROCR100 = {"ROCR100", (PyCFunction)__pyx_pw_5talib_4func_261ROCR100, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_260ROCR100}; -static PyObject *__pyx_pw_5talib_4func_261ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCR100 (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR100") < 0)) __PYX_ERR(0, 9573, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9573, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCR100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9573, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9573, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_260ROCR100(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_260ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ROCR100", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9595 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9596 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1072, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9596, __pyx_L1_error) - - /* "talib/func.pyx":9595 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9597 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9598 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1073, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9598, __pyx_L1_error) - - /* "talib/func.pyx":9597 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9599 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9600 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9600, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9599 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9601 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9602 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9603 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9604 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9605 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9606 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9607 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9606 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9608 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9609 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9611 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1074, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9611, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9612 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9613 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ROCR100_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9614 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9614, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9615 - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9616 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9617 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR100", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9618 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCR100", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCR100(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9619 - * outreal_data[i] = NaN - * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR100", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCR100, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9620 - * retCode = lib.TA_ROCR100( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ROCR100", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9573 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9624 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_263RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_262RSI[] = " RSI(real[, timeperiod=?])\n\n Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_263RSI = {"RSI", (PyCFunction)__pyx_pw_5talib_4func_263RSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_262RSI}; -static PyObject *__pyx_pw_5talib_4func_263RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("RSI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RSI") < 0)) __PYX_ERR(0, 9624, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9624, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("RSI", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9624, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9624, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_262RSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_262RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("RSI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9646 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9647 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1075, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9647, __pyx_L1_error) - - /* "talib/func.pyx":9646 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9648 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9649 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1076, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9649, __pyx_L1_error) - - /* "talib/func.pyx":9648 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9650 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9651 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9651, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9650 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9652 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9653 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9654 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9655 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9656 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9657 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9658 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9657 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9659 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9660 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9662 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1077, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9662, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9663 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9664 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_RSI_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9665 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9665, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9666 - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9667 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9668 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_RSI", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9669 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_RSI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_RSI(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9670 - * outreal_data[i] = NaN - * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_RSI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_RSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9671 - * retCode = lib.TA_RSI( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_RSI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9624 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_265SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_264SAR[] = " SAR(high, low[, acceleration=?, maximum=?])\n\n Parabolic SAR (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n acceleration: 0.02\n maximum: 0.2\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_265SAR = {"SAR", (PyCFunction)__pyx_pw_5talib_4func_265SAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_264SAR}; -static PyObject *__pyx_pw_5talib_4func_265SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - double __pyx_v_acceleration; - double __pyx_v_maximum; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_acceleration,&__pyx_n_s_maximum,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, 1); __PYX_ERR(0, 9675, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceleration); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maximum); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAR") < 0)) __PYX_ERR(0, 9675, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_acceleration = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_acceleration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9675, __pyx_L3_error) - } else { - __pyx_v_acceleration = ((double)0.02); - } - if (values[3]) { - __pyx_v_maximum = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_maximum == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9675, __pyx_L3_error) - } else { - __pyx_v_maximum = ((double)0.2); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9675, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 9675, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 9675, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_264SAR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_acceleration, __pyx_v_maximum); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_264SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":9699 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9700 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1078, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9700, __pyx_L1_error) - - /* "talib/func.pyx":9699 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":9701 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9702 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1079, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9702, __pyx_L1_error) - - /* "talib/func.pyx":9701 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9703 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9704 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9704, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9703 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":9705 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":9706 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9707 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1080, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9707, __pyx_L1_error) - - /* "talib/func.pyx":9706 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":9708 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9709 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1081, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9709, __pyx_L1_error) - - /* "talib/func.pyx":9708 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9710 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9711 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9711, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9710 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":9712 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":9713 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":9714 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9715 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1082, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9715, __pyx_L1_error) - - /* "talib/func.pyx":9714 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9716 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9717 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9718 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":9719 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9720 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9719 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":9721 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":9722 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9723 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9722 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9724 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9725 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9727 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1083, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9727, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":9728 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9729 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SAR_Lookback(__pyx_v_acceleration, __pyx_v_maximum)); - - /* "talib/func.pyx":9730 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9730, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9731 - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9732 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9733 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9734 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SAR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SAR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_acceleration, __pyx_v_maximum, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9735 - * outreal_data[i] = NaN - * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9736 - * retCode = lib.TA_SAR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , acceleration , maximum , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_267SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_266SAREXT[] = " SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?])\n\n Parabolic SAR - Extended (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n startvalue: 0\n offsetonreverse: 0\n accelerationinitlong: 0.02\n accelerationlong: 0.02\n accelerationmaxlong: 0.2\n accelerationinitshort: 0.02\n accelerationshort: 0.02\n accelerationmaxshort: 0.2\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_267SAREXT = {"SAREXT", (PyCFunction)__pyx_pw_5talib_4func_267SAREXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_266SAREXT}; -static PyObject *__pyx_pw_5talib_4func_267SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - double __pyx_v_startvalue; - double __pyx_v_offsetonreverse; - double __pyx_v_accelerationinitlong; - double __pyx_v_accelerationlong; - double __pyx_v_accelerationmaxlong; - double __pyx_v_accelerationinitshort; - double __pyx_v_accelerationshort; - double __pyx_v_accelerationmaxshort; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SAREXT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_startvalue,&__pyx_n_s_offsetonreverse,&__pyx_n_s_accelerationinitlong,&__pyx_n_s_accelerationlong,&__pyx_n_s_accelerationmaxlong,&__pyx_n_s_accelerationinitshort,&__pyx_n_s_accelerationshort,&__pyx_n_s_accelerationmaxshort,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, 1); __PYX_ERR(0, 9740, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startvalue); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offsetonreverse); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitlong); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationlong); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxlong); - if (value) { values[6] = value; kw_args--; } - } - case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitshort); - if (value) { values[7] = value; kw_args--; } - } - case 8: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationshort); - if (value) { values[8] = value; kw_args--; } - } - case 9: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxshort); - if (value) { values[9] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAREXT") < 0)) __PYX_ERR(0, 9740, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_startvalue = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_startvalue == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_startvalue = ((double)-4e37); - } - if (values[3]) { - __pyx_v_offsetonreverse = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_offsetonreverse == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_offsetonreverse = ((double)-4e37); - } - if (values[4]) { - __pyx_v_accelerationinitlong = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_accelerationinitlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationinitlong = ((double)-4e37); - } - if (values[5]) { - __pyx_v_accelerationlong = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_accelerationlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationlong = ((double)-4e37); - } - if (values[6]) { - __pyx_v_accelerationmaxlong = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_accelerationmaxlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationmaxlong = ((double)-4e37); - } - if (values[7]) { - __pyx_v_accelerationinitshort = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_accelerationinitshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationinitshort = ((double)-4e37); - } - if (values[8]) { - __pyx_v_accelerationshort = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_accelerationshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationshort = ((double)-4e37); - } - if (values[9]) { - __pyx_v_accelerationmaxshort = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_accelerationmaxshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9740, __pyx_L3_error) - } else { - __pyx_v_accelerationmaxshort = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9740, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 9740, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 9740, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_266SAREXT(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_266SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SAREXT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/func.pyx":9770 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9771 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1084, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9771, __pyx_L1_error) - - /* "talib/func.pyx":9770 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":9772 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9773 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1085, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9773, __pyx_L1_error) - - /* "talib/func.pyx":9772 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9774 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9775 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9775, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9774 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":9776 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":9777 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9778 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1086, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9778, __pyx_L1_error) - - /* "talib/func.pyx":9777 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":9779 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9780 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1087, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9780, __pyx_L1_error) - - /* "talib/func.pyx":9779 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9781 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9782 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9782, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9781 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":9783 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":9784 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":9785 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9786 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1088, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9786, __pyx_L1_error) - - /* "talib/func.pyx":9785 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":9787 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9788 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9789 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":9790 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9791 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9790 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":9792 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":9793 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9794 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":9793 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9795 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9796 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9798 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1089, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9798, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":9799 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9800 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SAREXT_Lookback(__pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort)); - - /* "talib/func.pyx":9801 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9801, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9802 - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9803 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9804 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAREXT", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9805 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SAREXT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SAREXT(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9806 - * outreal_data[i] = NaN - * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAREXT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SAREXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9807 - * retCode = lib.TA_SAREXT( 0 , endidx , (high_data+begidx) , (low_data+begidx) , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SAREXT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9811 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_269SIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_268SIN[] = " SIN(real)\n\n Vector Trigonometric Sin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_269SIN = {"SIN", (PyCFunction)__pyx_pw_5talib_4func_269SIN, METH_O, __pyx_doc_5talib_4func_268SIN}; -static PyObject *__pyx_pw_5talib_4func_269SIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SIN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9811, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_268SIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_268SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9831 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9832 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1090, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9832, __pyx_L1_error) - - /* "talib/func.pyx":9831 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9833 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9834 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1091, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9834, __pyx_L1_error) - - /* "talib/func.pyx":9833 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9835 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9836 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9836, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9835 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9837 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9838 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9839 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9840 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9841 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9842 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9843 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9842 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9844 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9845 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9847 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SIN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1092, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9847, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9848 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9849 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SIN_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SIN_Lookback()); - - /* "talib/func.pyx":9850 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9850, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9851 - * lookback = begidx + lib.TA_SIN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9852 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9853 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SIN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9854 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SIN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9855 - * outreal_data[i] = NaN - * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9856 - * retCode = lib.TA_SIN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9811 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9860 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_271SINH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_270SINH[] = " SINH(real)\n\n Vector Trigonometric Sinh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_271SINH = {"SINH", (PyCFunction)__pyx_pw_5talib_4func_271SINH, METH_O, __pyx_doc_5talib_4func_270SINH}; -static PyObject *__pyx_pw_5talib_4func_271SINH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SINH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9860, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_270SINH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_270SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SINH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9880 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9881 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1093, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9881, __pyx_L1_error) - - /* "talib/func.pyx":9880 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9882 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9883 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1094, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9883, __pyx_L1_error) - - /* "talib/func.pyx":9882 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9884 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9885 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9885, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9884 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9886 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9887 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9888 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9889 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9890 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9891 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9892 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9891 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9893 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9894 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9896 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SINH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1095, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9896, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9897 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SINH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9898 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SINH_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SINH_Lookback()); - - /* "talib/func.pyx":9899 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SINH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9899, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9900 - * lookback = begidx + lib.TA_SINH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9901 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9902 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SINH", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9903 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SINH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SINH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9904 - * outreal_data[i] = NaN - * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SINH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SINH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9905 - * retCode = lib.TA_SINH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SINH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9860 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SINH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9909 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_273SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_272SMA[] = " SMA(real[, timeperiod=?])\n\n Simple Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_273SMA = {"SMA", (PyCFunction)__pyx_pw_5talib_4func_273SMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_272SMA}; -static PyObject *__pyx_pw_5talib_4func_273SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SMA") < 0)) __PYX_ERR(0, 9909, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9909, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9909, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9909, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_272SMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_272SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9931 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9932 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1096, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9932, __pyx_L1_error) - - /* "talib/func.pyx":9931 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9933 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9934 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1097, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9934, __pyx_L1_error) - - /* "talib/func.pyx":9933 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9935 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9936 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9936, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9935 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9937 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9938 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9939 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9940 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9941 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9942 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9943 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9942 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9944 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9945 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9947 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1098, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9947, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9948 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9949 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":9950 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9950, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9951 - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":9952 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9953 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":9954 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":9955 - * outreal_data[i] = NaN - * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":9956 - * retCode = lib.TA_SMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9909 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":9960 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_275SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_274SQRT[] = " SQRT(real)\n\n Vector Square Root (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_275SQRT = {"SQRT", (PyCFunction)__pyx_pw_5talib_4func_275SQRT, METH_O, __pyx_doc_5talib_4func_274SQRT}; -static PyObject *__pyx_pw_5talib_4func_275SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SQRT (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 9960, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_274SQRT(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_274SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SQRT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":9980 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9981 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1099, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9981, __pyx_L1_error) - - /* "talib/func.pyx":9980 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":9982 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9983 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9983, __pyx_L1_error) - - /* "talib/func.pyx":9982 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":9984 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9985 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9985, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":9984 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":9986 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":9987 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":9988 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":9989 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":9990 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":9991 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":9992 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":9991 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":9993 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":9994 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":9996 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SQRT_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 9996, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":9997 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SQRT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":9998 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SQRT_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SQRT_Lookback()); - - /* "talib/func.pyx":9999 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SQRT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 9999, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10000 - * lookback = begidx + lib.TA_SQRT_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10001 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10002 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SQRT", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10003 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SQRT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SQRT(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10004 - * outreal_data[i] = NaN - * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SQRT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SQRT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10005 - * retCode = lib.TA_SQRT( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SQRT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":9960 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SQRT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10009 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_277STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_276STDDEV[] = " STDDEV(real[, timeperiod=?, nbdev=?])\n\n Standard Deviation (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_277STDDEV = {"STDDEV", (PyCFunction)__pyx_pw_5talib_4func_277STDDEV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_276STDDEV}; -static PyObject *__pyx_pw_5talib_4func_277STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdev; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STDDEV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDDEV") < 0)) __PYX_ERR(0, 10009, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10009, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10009, __pyx_L3_error) - } else { - __pyx_v_nbdev = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STDDEV", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10009, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10009, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_276STDDEV(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_276STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("STDDEV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10032 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10033 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10033, __pyx_L1_error) - - /* "talib/func.pyx":10032 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10034 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10035 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10035, __pyx_L1_error) - - /* "talib/func.pyx":10034 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10036 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10037 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10037, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10036 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10038 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10039 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10040 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10041 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10042 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10043 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10044 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10043 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10045 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10046 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10048 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10048, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10049 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10050 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_STDDEV_Lookback(__pyx_v_timeperiod, __pyx_v_nbdev)); - - /* "talib/func.pyx":10051 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10051, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10052 - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10053 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10054 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_STDDEV", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10055 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STDDEV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_STDDEV(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10056 - * outreal_data[i] = NaN - * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_STDDEV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STDDEV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10057 - * retCode = lib.TA_STDDEV( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_STDDEV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10009 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10061 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_279STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_278STOCH[] = " STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?])\n\n Stochastic (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n slowk_period: 3\n slowk_matype: 0\n slowd_period: 3\n slowd_matype: 0\n Outputs:\n slowk\n slowd\n "; -static PyMethodDef __pyx_mdef_5talib_4func_279STOCH = {"STOCH", (PyCFunction)__pyx_pw_5talib_4func_279STOCH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_278STOCH}; -static PyObject *__pyx_pw_5talib_4func_279STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_fastk_period; - int __pyx_v_slowk_period; - int __pyx_v_slowk_matype; - int __pyx_v_slowd_period; - int __pyx_v_slowd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_slowk_period,&__pyx_n_s_slowk_matype,&__pyx_n_s_slowd_period,&__pyx_n_s_slowd_matype,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 1); __PYX_ERR(0, 10061, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 2); __PYX_ERR(0, 10061, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_period); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_matype); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_period); - if (value) { values[6] = value; kw_args--; } - } - case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_matype); - if (value) { values[7] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCH") < 0)) __PYX_ERR(0, 10061, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10061, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_slowk_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10061, __pyx_L3_error) - } else { - __pyx_v_slowk_period = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_slowk_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowk_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10061, __pyx_L3_error) - } else { - __pyx_v_slowk_matype = ((int)0); - } - if (values[6]) { - __pyx_v_slowd_period = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_slowd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10061, __pyx_L3_error) - } else { - __pyx_v_slowd_period = ((int)-2147483648); - } - if (values[7]) { - __pyx_v_slowd_matype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_slowd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10061, __pyx_L3_error) - } else { - __pyx_v_slowd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10061, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 10061, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 10061, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 10061, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_278STOCH(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_278STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outslowk = 0; - double *__pyx_v_outslowk_data; - PyArrayObject *__pyx_v_outslowd = 0; - double *__pyx_v_outslowd_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("STOCH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":10092 - * np.ndarray outslowd - * double* outslowd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10093 - * double* outslowd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10093, __pyx_L1_error) - - /* "talib/func.pyx":10092 - * np.ndarray outslowd - * double* outslowd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":10094 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10095 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10095, __pyx_L1_error) - - /* "talib/func.pyx":10094 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10096 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10097 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10097, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10096 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":10098 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":10099 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10100 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10100, __pyx_L1_error) - - /* "talib/func.pyx":10099 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":10101 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10102 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10102, __pyx_L1_error) - - /* "talib/func.pyx":10101 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10103 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10104 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10104, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10103 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":10105 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":10106 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10107 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10107, __pyx_L1_error) - - /* "talib/func.pyx":10106 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":10108 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10109 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10109, __pyx_L1_error) - - /* "talib/func.pyx":10108 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10110 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10111 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10111, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10110 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":10112 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":10113 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":10114 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10115 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10115, __pyx_L1_error) - - /* "talib/func.pyx":10114 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":10116 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10117 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10117, __pyx_L1_error) - - /* "talib/func.pyx":10116 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10118 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10119 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10120 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":10121 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10122 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10121 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":10123 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":10124 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10125 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10124 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":10126 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":10127 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10128 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10127 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10129 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10130 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10132 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10132, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":10133 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) - * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10134 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) # <<<<<<<<<<<<<< - * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowk_data = outslowk.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_STOCH_Lookback(__pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype)); - - /* "talib/func.pyx":10135 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) - * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outslowk_data = outslowk.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10135, __pyx_L1_error) - __pyx_v_outslowk = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10136 - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) - * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowk_data = outslowk.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outslowk_data[i] = NaN - */ - __pyx_v_outslowk_data = ((double *)__pyx_v_outslowk->data); - - /* "talib/func.pyx":10137 - * outslowk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowk_data = outslowk.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outslowk_data[i] = NaN - * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10138 - * outslowk_data = outslowk.data - * for i from 0 <= i < min(lookback, length): - * outslowk_data[i] = NaN # <<<<<<<<<<<<<< - * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowd_data = outslowd.data - */ - (__pyx_v_outslowk_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10139 - * for i from 0 <= i < min(lookback, length): - * outslowk_data[i] = NaN - * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outslowd_data = outslowd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10139, __pyx_L1_error) - __pyx_v_outslowd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10140 - * outslowk_data[i] = NaN - * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowd_data = outslowd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outslowd_data[i] = NaN - */ - __pyx_v_outslowd_data = ((double *)__pyx_v_outslowd->data); - - /* "talib/func.pyx":10141 - * outslowd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outslowd_data = outslowd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outslowd_data[i] = NaN - * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10142 - * outslowd_data = outslowd.data - * for i from 0 <= i < min(lookback, length): - * outslowd_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) - * _ta_check_success("TA_STOCH", retCode) - */ - (__pyx_v_outslowd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10143 - * for i from 0 <= i < min(lookback, length): - * outslowd_data[i] = NaN - * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCH", retCode) - * return outslowk , outslowd - */ - __pyx_v_retCode = TA_STOCH(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outslowk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outslowd_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10144 - * outslowd_data[i] = NaN - * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) - * _ta_check_success("TA_STOCH", retCode) # <<<<<<<<<<<<<< - * return outslowk , outslowd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10145 - * retCode = lib.TA_STOCH( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , (outslowk_data+lookback) , (outslowd_data+lookback) ) - * _ta_check_success("TA_STOCH", retCode) - * return outslowk , outslowd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outslowk)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outslowk)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outslowk)); - __Pyx_INCREF(((PyObject *)__pyx_v_outslowd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outslowd)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outslowd)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":10061 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outslowk); - __Pyx_XDECREF((PyObject *)__pyx_v_outslowd); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10149 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_281STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_280STOCHF[] = " STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Fast (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; -static PyMethodDef __pyx_mdef_5talib_4func_281STOCHF = {"STOCHF", (PyCFunction)__pyx_pw_5talib_4func_281STOCHF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_280STOCHF}; -static PyObject *__pyx_pw_5talib_4func_281STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_fastk_period; - int __pyx_v_fastd_period; - int __pyx_v_fastd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCHF (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 1); __PYX_ERR(0, 10149, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 2); __PYX_ERR(0, 10149, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHF") < 0)) __PYX_ERR(0, 10149, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10149, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10149, __pyx_L3_error) - } else { - __pyx_v_fastd_period = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10149, __pyx_L3_error) - } else { - __pyx_v_fastd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10149, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 10149, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 10149, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 10149, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_280STOCHF(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_280STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outfastk = 0; - double *__pyx_v_outfastk_data; - PyArrayObject *__pyx_v_outfastd = 0; - double *__pyx_v_outfastd_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("STOCHF", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":10178 - * np.ndarray outfastd - * double* outfastd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10179 - * double* outfastd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10179, __pyx_L1_error) - - /* "talib/func.pyx":10178 - * np.ndarray outfastd - * double* outfastd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":10180 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10181 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10181, __pyx_L1_error) - - /* "talib/func.pyx":10180 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10182 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10183 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10183, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10182 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":10184 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":10185 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10186 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10186, __pyx_L1_error) - - /* "talib/func.pyx":10185 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":10187 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10188 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10188, __pyx_L1_error) - - /* "talib/func.pyx":10187 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10189 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10190 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10190, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10189 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":10191 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":10192 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10193 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10193, __pyx_L1_error) - - /* "talib/func.pyx":10192 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":10194 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10195 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10195, __pyx_L1_error) - - /* "talib/func.pyx":10194 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10196 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10197 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10197, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10196 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":10198 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":10199 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":10200 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10201 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10201, __pyx_L1_error) - - /* "talib/func.pyx":10200 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":10202 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10203 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10203, __pyx_L1_error) - - /* "talib/func.pyx":10202 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10204 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10205 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10206 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":10207 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10208 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10207 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":10209 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":10210 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10211 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10210 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":10212 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":10213 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10214 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10213 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10215 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10216 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10218 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10218, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":10219 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10220 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) # <<<<<<<<<<<<<< - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_STOCHF_Lookback(__pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype)); - - /* "talib/func.pyx":10221 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10221, __pyx_L1_error) - __pyx_v_outfastk = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10222 - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN - */ - __pyx_v_outfastk_data = ((double *)__pyx_v_outfastk->data); - - /* "talib/func.pyx":10223 - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10224 - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN # <<<<<<<<<<<<<< - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data - */ - (__pyx_v_outfastk_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10225 - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10225, __pyx_L1_error) - __pyx_v_outfastd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10226 - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN - */ - __pyx_v_outfastd_data = ((double *)__pyx_v_outfastd->data); - - /* "talib/func.pyx":10227 - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10228 - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHF", retCode) - */ - (__pyx_v_outfastd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10229 - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCHF", retCode) - * return outfastk , outfastd - */ - __pyx_v_retCode = TA_STOCHF(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outfastk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfastd_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10230 - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHF", retCode) # <<<<<<<<<<<<<< - * return outfastk , outfastd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCHF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10231 - * retCode = lib.TA_STOCHF( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHF", retCode) - * return outfastk , outfastd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outfastk)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastk)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outfastk)); - __Pyx_INCREF(((PyObject *)__pyx_v_outfastd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastd)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfastd)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":10149 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outfastk); - __Pyx_XDECREF((PyObject *)__pyx_v_outfastd); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10235 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_283STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_282STOCHRSI[] = " STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; -static PyMethodDef __pyx_mdef_5talib_4func_283STOCHRSI = {"STOCHRSI", (PyCFunction)__pyx_pw_5talib_4func_283STOCHRSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_282STOCHRSI}; -static PyObject *__pyx_pw_5talib_4func_283STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - int __pyx_v_fastk_period; - int __pyx_v_fastd_period; - int __pyx_v_fastd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCHRSI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHRSI") < 0)) __PYX_ERR(0, 10235, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10235, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10235, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10235, __pyx_L3_error) - } else { - __pyx_v_fastd_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10235, __pyx_L3_error) - } else { - __pyx_v_fastd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCHRSI", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10235, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10235, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_282STOCHRSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_282STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outfastk = 0; - double *__pyx_v_outfastk_data; - PyArrayObject *__pyx_v_outfastd = 0; - double *__pyx_v_outfastd_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("STOCHRSI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10263 - * np.ndarray outfastd - * double* outfastd_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10264 - * double* outfastd_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10264, __pyx_L1_error) - - /* "talib/func.pyx":10263 - * np.ndarray outfastd - * double* outfastd_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10265 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10266 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10266, __pyx_L1_error) - - /* "talib/func.pyx":10265 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10267 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10268 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10268, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10267 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10269 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10270 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10271 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10272 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10273 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10274 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10275 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10274 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10276 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10277 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10279 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10279, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10280 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10281 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) # <<<<<<<<<<<<<< - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_STOCHRSI_Lookback(__pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype)); - - /* "talib/func.pyx":10282 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10282, __pyx_L1_error) - __pyx_v_outfastk = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10283 - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN - */ - __pyx_v_outfastk_data = ((double *)__pyx_v_outfastk->data); - - /* "talib/func.pyx":10284 - * outfastk = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10285 - * outfastk_data = outfastk.data - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN # <<<<<<<<<<<<<< - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data - */ - (__pyx_v_outfastk_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10286 - * for i from 0 <= i < min(lookback, length): - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10286, __pyx_L1_error) - __pyx_v_outfastd = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10287 - * outfastk_data[i] = NaN - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN - */ - __pyx_v_outfastd_data = ((double *)__pyx_v_outfastd->data); - - /* "talib/func.pyx":10288 - * outfastd = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10289 - * outfastd_data = outfastd.data - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHRSI", retCode) - */ - (__pyx_v_outfastd_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10290 - * for i from 0 <= i < min(lookback, length): - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCHRSI", retCode) - * return outfastk , outfastd - */ - __pyx_v_retCode = TA_STOCHRSI(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outfastk_data + __pyx_v_lookback)), ((double *)(__pyx_v_outfastd_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10291 - * outfastd_data[i] = NaN - * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHRSI", retCode) # <<<<<<<<<<<<<< - * return outfastk , outfastd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCHRSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10292 - * retCode = lib.TA_STOCHRSI( 0 , endidx , (real_data+begidx) , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , (outfastk_data+lookback) , (outfastd_data+lookback) ) - * _ta_check_success("TA_STOCHRSI", retCode) - * return outfastk , outfastd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_outfastk)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastk)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_outfastk)); - __Pyx_INCREF(((PyObject *)__pyx_v_outfastd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_outfastd)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_outfastd)); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/func.pyx":10235 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outfastk); - __Pyx_XDECREF((PyObject *)__pyx_v_outfastd); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_285SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_284SUB[] = " SUB(real0, real1)\n\n Vector Arithmetic Substraction (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_285SUB = {"SUB", (PyCFunction)__pyx_pw_5talib_4func_285SUB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_284SUB}; -static PyObject *__pyx_pw_5talib_4func_285SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SUB (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, 1); __PYX_ERR(0, 10296, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUB") < 0)) __PYX_ERR(0, 10296, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10296, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 10296, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 10296, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_284SUB(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_284SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SUB", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/func.pyx":10318 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10319 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10319, __pyx_L1_error) - - /* "talib/func.pyx":10318 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/func.pyx":10320 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10321 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10321, __pyx_L1_error) - - /* "talib/func.pyx":10320 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10322 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10323 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10323, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10322 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/func.pyx":10324 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/func.pyx":10325 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10326 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10326, __pyx_L1_error) - - /* "talib/func.pyx":10325 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/func.pyx":10327 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10328 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10328, __pyx_L1_error) - - /* "talib/func.pyx":10327 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10329 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10330 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10330, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10329 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/func.pyx":10331 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/func.pyx":10332 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/func.pyx":10333 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10334 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10334, __pyx_L1_error) - - /* "talib/func.pyx":10333 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10335 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real0_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10336 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real0_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10337 - * begidx = 0 - * for i from 0 <= i < length: - * val = real0_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real0_data[__pyx_v_i]); - - /* "talib/func.pyx":10338 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10339 - * val = real0_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = real1_data[i] - * if val != val: - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":10338 - * for i from 0 <= i < length: - * val = real0_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = real1_data[i] - */ - } - - /* "talib/func.pyx":10340 - * if val != val: - * continue - * val = real1_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real1_data[__pyx_v_i]); - - /* "talib/func.pyx":10341 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10342 - * val = real1_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L10_continue; - - /* "talib/func.pyx":10341 - * continue - * val = real1_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10343 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10344 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L11_break; - __pyx_L10_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10346 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUB_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10346, __pyx_L1_error) - } - __pyx_L11_break:; - - /* "talib/func.pyx":10347 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SUB_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10348 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUB_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SUB_Lookback()); - - /* "talib/func.pyx":10349 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUB_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10349, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10350 - * lookback = begidx + lib.TA_SUB_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10351 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10352 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUB", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10353 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SUB", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SUB(0, __pyx_v_endidx, ((double *)(__pyx_v_real0_data + __pyx_v_begidx)), ((double *)(__pyx_v_real1_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10354 - * outreal_data[i] = NaN - * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUB", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SUB, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10355 - * retCode = lib.TA_SUB( 0 , endidx , (real0_data+begidx) , (real1_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUB", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_287SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_286SUM[] = " SUM(real[, timeperiod=?])\n\n Summation (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_287SUM = {"SUM", (PyCFunction)__pyx_pw_5talib_4func_287SUM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_286SUM}; -static PyObject *__pyx_pw_5talib_4func_287SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SUM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUM") < 0)) __PYX_ERR(0, 10359, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10359, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SUM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10359, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10359, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_286SUM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_286SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("SUM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10381 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10382 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10382, __pyx_L1_error) - - /* "talib/func.pyx":10381 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10383 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10384 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10384, __pyx_L1_error) - - /* "talib/func.pyx":10383 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10385 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10386 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10386, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10385 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10387 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10388 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10389 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10390 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10391 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10392 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10393 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10392 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10394 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10395 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10397 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10397, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10398 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10399 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_SUM_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":10400 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10400, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10401 - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10402 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10403 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUM", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10404 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SUM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SUM(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10405 - * outreal_data[i] = NaN - * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SUM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10406 - * retCode = lib.TA_SUM( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_SUM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_289T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_288T3[] = " T3(real[, timeperiod=?, vfactor=?])\n\n Triple Exponential Moving Average (T3) (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n vfactor: 0.7\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_289T3 = {"T3", (PyCFunction)__pyx_pw_5talib_4func_289T3, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_288T3}; -static PyObject *__pyx_pw_5talib_4func_289T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_vfactor; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("T3 (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_vfactor,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vfactor); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "T3") < 0)) __PYX_ERR(0, 10410, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10410, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_vfactor = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_vfactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10410, __pyx_L3_error) - } else { - __pyx_v_vfactor = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("T3", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10410, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10410, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_288T3(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_vfactor); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_288T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("T3", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10434 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10434, __pyx_L1_error) - - /* "talib/func.pyx":10433 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10435 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10436 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10436, __pyx_L1_error) - - /* "talib/func.pyx":10435 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10437 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10438 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10438, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10437 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10439 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10440 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10441 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10442 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10443 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10444 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10445 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10444 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10446 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10447 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10449 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10449, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10450 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10451 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_T3_Lookback(__pyx_v_timeperiod, __pyx_v_vfactor)); - - /* "talib/func.pyx":10452 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10452, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10453 - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10454 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10455 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_T3", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10456 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_T3", retCode) - * return outreal - */ - __pyx_v_retCode = TA_T3(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_vfactor, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10457 - * outreal_data[i] = NaN - * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_T3", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_T3, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10458 - * retCode = lib.TA_T3( 0 , endidx , (real_data+begidx) , timeperiod , vfactor , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_T3", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_291TAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_290TAN[] = " TAN(real)\n\n Vector Trigonometric Tan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_291TAN = {"TAN", (PyCFunction)__pyx_pw_5talib_4func_291TAN, METH_O, __pyx_doc_5talib_4func_290TAN}; -static PyObject *__pyx_pw_5talib_4func_291TAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TAN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10462, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_290TAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_290TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10482 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10483 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10483, __pyx_L1_error) - - /* "talib/func.pyx":10482 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10484 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10485 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10485, __pyx_L1_error) - - /* "talib/func.pyx":10484 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10486 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10487 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10487, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10486 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10488 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10489 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10490 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10491 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10492 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10493 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10494 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10493 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10495 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10496 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10498 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TAN_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10498, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10499 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10500 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TAN_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TAN_Lookback()); - - /* "talib/func.pyx":10501 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10501, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10502 - * lookback = begidx + lib.TA_TAN_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10503 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10504 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TAN", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10505 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TAN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TAN(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10506 - * outreal_data[i] = NaN - * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TAN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10507 - * retCode = lib.TA_TAN( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TAN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_293TANH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_4func_292TANH[] = " TANH(real)\n\n Vector Trigonometric Tanh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_293TANH = {"TANH", (PyCFunction)__pyx_pw_5talib_4func_293TANH, METH_O, __pyx_doc_5talib_4func_292TANH}; -static PyObject *__pyx_pw_5talib_4func_293TANH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TANH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10511, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_292TANH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_292TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TANH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10531 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10532 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10532, __pyx_L1_error) - - /* "talib/func.pyx":10531 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10533 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10534 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10534, __pyx_L1_error) - - /* "talib/func.pyx":10533 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10535 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10536 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10536, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10535 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10537 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10538 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10539 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10540 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10541 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10542 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10543 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10542 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10544 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10545 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10547 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TANH_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10547, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10548 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TANH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10549 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TANH_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TANH_Lookback()); - - /* "talib/func.pyx":10550 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TANH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10550, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10551 - * lookback = begidx + lib.TA_TANH_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10552 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10553 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TANH", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10554 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TANH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TANH(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10555 - * outreal_data[i] = NaN - * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TANH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TANH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10556 - * retCode = lib.TA_TANH( 0 , endidx , (real_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TANH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TANH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10560 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_295TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_294TEMA[] = " TEMA(real[, timeperiod=?])\n\n Triple Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_295TEMA = {"TEMA", (PyCFunction)__pyx_pw_5talib_4func_295TEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_294TEMA}; -static PyObject *__pyx_pw_5talib_4func_295TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TEMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TEMA") < 0)) __PYX_ERR(0, 10560, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10560, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10560, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10560, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_294TEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_294TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TEMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10582 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10583 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10583, __pyx_L1_error) - - /* "talib/func.pyx":10582 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10584 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10585 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10585, __pyx_L1_error) - - /* "talib/func.pyx":10584 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10586 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10587 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10587, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10586 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10588 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10589 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10590 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10591 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10592 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10593 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10594 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10593 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10595 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10596 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10598 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10598, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10599 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10600 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TEMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":10601 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10601, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10602 - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10603 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10604 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TEMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10605 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TEMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TEMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10606 - * outreal_data[i] = NaN - * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TEMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10607 - * retCode = lib.TA_TEMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TEMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10560 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10611 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_297TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_296TRANGE[] = " TRANGE(high, low, close)\n\n True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_297TRANGE = {"TRANGE", (PyCFunction)__pyx_pw_5talib_4func_297TRANGE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_296TRANGE}; -static PyObject *__pyx_pw_5talib_4func_297TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRANGE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 1); __PYX_ERR(0, 10611, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 2); __PYX_ERR(0, 10611, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRANGE") < 0)) __PYX_ERR(0, 10611, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10611, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 10611, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 10611, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 10611, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_296TRANGE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_296TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TRANGE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":10633 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10634 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10634, __pyx_L1_error) - - /* "talib/func.pyx":10633 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":10635 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10636 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10636, __pyx_L1_error) - - /* "talib/func.pyx":10635 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10637 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10638 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10638, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10637 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":10639 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":10640 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10641 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10641, __pyx_L1_error) - - /* "talib/func.pyx":10640 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":10642 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10643 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10643, __pyx_L1_error) - - /* "talib/func.pyx":10642 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10644 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10645 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10645, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10644 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":10646 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":10647 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10648 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10648, __pyx_L1_error) - - /* "talib/func.pyx":10647 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":10649 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10650 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10650, __pyx_L1_error) - - /* "talib/func.pyx":10649 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10651 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10652 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10652, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10651 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":10653 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":10654 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":10655 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10656 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10656, __pyx_L1_error) - - /* "talib/func.pyx":10655 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":10657 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10658 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10658, __pyx_L1_error) - - /* "talib/func.pyx":10657 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10659 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10660 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10661 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":10662 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10663 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10662 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":10664 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":10665 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10666 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10665 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":10667 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":10668 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10669 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10668 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10670 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10671 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10673 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRANGE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10673, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":10674 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TRANGE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10675 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRANGE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TRANGE_Lookback()); - - /* "talib/func.pyx":10676 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRANGE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10676, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10677 - * lookback = begidx + lib.TA_TRANGE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10678 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10679 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRANGE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10680 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRANGE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRANGE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10681 - * outreal_data[i] = NaN - * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRANGE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRANGE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10682 - * retCode = lib.TA_TRANGE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRANGE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10611 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10686 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_299TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_298TRIMA[] = " TRIMA(real[, timeperiod=?])\n\n Triangular Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_299TRIMA = {"TRIMA", (PyCFunction)__pyx_pw_5talib_4func_299TRIMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_298TRIMA}; -static PyObject *__pyx_pw_5talib_4func_299TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRIMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIMA") < 0)) __PYX_ERR(0, 10686, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10686, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRIMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10686, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10686, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_298TRIMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_298TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TRIMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10708 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10709 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10709, __pyx_L1_error) - - /* "talib/func.pyx":10708 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10710 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10711 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10711, __pyx_L1_error) - - /* "talib/func.pyx":10710 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10712 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10713 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10713, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10712 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10714 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10715 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10716 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10717 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10718 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10719 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10720 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10719 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10721 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10722 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10724 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10724, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10725 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10726 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TRIMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":10727 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10727, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10728 - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10729 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10730 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10731 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRIMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRIMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10732 - * outreal_data[i] = NaN - * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRIMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10733 - * retCode = lib.TA_TRIMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10686 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10737 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_301TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_300TRIX[] = " TRIX(real[, timeperiod=?])\n\n 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_301TRIX = {"TRIX", (PyCFunction)__pyx_pw_5talib_4func_301TRIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_300TRIX}; -static PyObject *__pyx_pw_5talib_4func_301TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRIX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIX") < 0)) __PYX_ERR(0, 10737, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10737, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10737, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10737, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_300TRIX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_300TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TRIX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10759 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10760 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10760, __pyx_L1_error) - - /* "talib/func.pyx":10759 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10761 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10762 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10762, __pyx_L1_error) - - /* "talib/func.pyx":10761 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10763 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10764 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10764, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10763 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10765 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10766 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10767 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10768 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10769 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10770 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10771 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10770 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10772 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10773 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10775 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10775, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10776 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10777 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TRIX_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":10778 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10778, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10779 - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10780 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10781 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIX", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10782 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRIX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRIX(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10783 - * outreal_data[i] = NaN - * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10784 - * retCode = lib.TA_TRIX( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TRIX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10737 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10788 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_303TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_302TSF[] = " TSF(real[, timeperiod=?])\n\n Time Series Forecast (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_303TSF = {"TSF", (PyCFunction)__pyx_pw_5talib_4func_303TSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_302TSF}; -static PyObject *__pyx_pw_5talib_4func_303TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TSF (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TSF") < 0)) __PYX_ERR(0, 10788, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10788, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TSF", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10788, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10788, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_302TSF(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_302TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TSF", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":10810 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10811 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10811, __pyx_L1_error) - - /* "talib/func.pyx":10810 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":10812 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10813 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10813, __pyx_L1_error) - - /* "talib/func.pyx":10812 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10814 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10815 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10815, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10814 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":10816 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":10817 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":10818 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10819 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10820 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":10821 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10822 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":10821 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10823 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10824 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10826 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10826, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":10827 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10828 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TSF_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":10829 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10829, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10830 - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10831 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10832 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TSF", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10833 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TSF", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TSF(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10834 - * outreal_data[i] = NaN - * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TSF", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TSF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10835 - * retCode = lib.TA_TSF( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TSF", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10788 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10839 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_305TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_304TYPPRICE[] = " TYPPRICE(high, low, close)\n\n Typical Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_305TYPPRICE = {"TYPPRICE", (PyCFunction)__pyx_pw_5talib_4func_305TYPPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_304TYPPRICE}; -static PyObject *__pyx_pw_5talib_4func_305TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TYPPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 1); __PYX_ERR(0, 10839, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 2); __PYX_ERR(0, 10839, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TYPPRICE") < 0)) __PYX_ERR(0, 10839, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10839, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 10839, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 10839, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 10839, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_304TYPPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_304TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("TYPPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":10861 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10862 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10862, __pyx_L1_error) - - /* "talib/func.pyx":10861 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":10863 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10864 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10864, __pyx_L1_error) - - /* "talib/func.pyx":10863 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10865 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10866 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10866, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10865 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":10867 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":10868 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10869 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10869, __pyx_L1_error) - - /* "talib/func.pyx":10868 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":10870 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10871 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10871, __pyx_L1_error) - - /* "talib/func.pyx":10870 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10872 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10873 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10873, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10872 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":10874 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":10875 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10876 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10876, __pyx_L1_error) - - /* "talib/func.pyx":10875 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":10877 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10878 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10878, __pyx_L1_error) - - /* "talib/func.pyx":10877 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10879 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10880 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10880, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10879 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":10881 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":10882 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":10883 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10884 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10884, __pyx_L1_error) - - /* "talib/func.pyx":10883 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":10885 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10886 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10886, __pyx_L1_error) - - /* "talib/func.pyx":10885 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10887 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10888 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10889 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":10890 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10891 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10890 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":10892 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":10893 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10894 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10893 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":10895 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":10896 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10897 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10896 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10898 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10899 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10901 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10901, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":10902 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10903 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_TYPPRICE_Lookback()); - - /* "talib/func.pyx":10904 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10904, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10905 - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10906 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10907 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TYPPRICE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10908 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TYPPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TYPPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10909 - * outreal_data[i] = NaN - * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TYPPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TYPPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10910 - * retCode = lib.TA_TYPPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_TYPPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10839 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_307ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_306ULTOSC[] = " ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?])\n\n Ultimate Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod1: 7\n timeperiod2: 14\n timeperiod3: 28\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_307ULTOSC = {"ULTOSC", (PyCFunction)__pyx_pw_5talib_4func_307ULTOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_306ULTOSC}; -static PyObject *__pyx_pw_5talib_4func_307ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod1; - int __pyx_v_timeperiod2; - int __pyx_v_timeperiod3; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ULTOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod1,&__pyx_n_s_timeperiod2,&__pyx_n_s_timeperiod3,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 1); __PYX_ERR(0, 10914, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 2); __PYX_ERR(0, 10914, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod1); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod2); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod3); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ULTOSC") < 0)) __PYX_ERR(0, 10914, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10914, __pyx_L3_error) - } else { - __pyx_v_timeperiod1 = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_timeperiod2 = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10914, __pyx_L3_error) - } else { - __pyx_v_timeperiod2 = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_timeperiod3 = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_timeperiod3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10914, __pyx_L3_error) - } else { - __pyx_v_timeperiod3 = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10914, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 10914, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 10914, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 10914, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_306ULTOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_306ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("ULTOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":10940 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10941 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10941, __pyx_L1_error) - - /* "talib/func.pyx":10940 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":10942 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10943 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10943, __pyx_L1_error) - - /* "talib/func.pyx":10942 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10944 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10945 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10945, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10944 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":10946 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":10947 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10948 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10948, __pyx_L1_error) - - /* "talib/func.pyx":10947 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":10949 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10950 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10950, __pyx_L1_error) - - /* "talib/func.pyx":10949 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10951 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10952 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10952, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10951 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":10953 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":10954 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10955 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10955, __pyx_L1_error) - - /* "talib/func.pyx":10954 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":10956 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10957 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10957, __pyx_L1_error) - - /* "talib/func.pyx":10956 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":10958 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10959 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10959, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10958 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":10960 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":10961 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":10962 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10963 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10963, __pyx_L1_error) - - /* "talib/func.pyx":10962 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":10964 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10965 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10965, __pyx_L1_error) - - /* "talib/func.pyx":10964 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":10966 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":10967 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10968 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":10969 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10970 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10969 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":10971 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":10972 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10973 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10972 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":10974 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":10975 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":10976 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":10975 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":10977 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":10978 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":10980 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 10980, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":10981 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":10982 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_ULTOSC_Lookback(__pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3)); - - /* "talib/func.pyx":10983 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 10983, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":10984 - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":10985 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":10986 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ULTOSC", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":10987 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ULTOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ULTOSC(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":10988 - * outreal_data[i] = NaN - * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ULTOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ULTOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":10989 - * retCode = lib.TA_ULTOSC( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_ULTOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":10993 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_309VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_308VAR[] = " VAR(real[, timeperiod=?, nbdev=?])\n\n Variance (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_309VAR = {"VAR", (PyCFunction)__pyx_pw_5talib_4func_309VAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_308VAR}; -static PyObject *__pyx_pw_5talib_4func_309VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdev; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("VAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "VAR") < 0)) __PYX_ERR(0, 10993, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10993, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10993, __pyx_L3_error) - } else { - __pyx_v_nbdev = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("VAR", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 10993, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 10993, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_308VAR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_308VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("VAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":11016 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11017 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11017, __pyx_L1_error) - - /* "talib/func.pyx":11016 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":11018 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11019 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11019, __pyx_L1_error) - - /* "talib/func.pyx":11018 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11020 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11021 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11021, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11020 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":11022 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":11023 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":11024 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":11025 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11026 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":11027 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11028 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":11027 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":11029 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":11030 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":11032 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11032, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":11033 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":11034 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_VAR_Lookback(__pyx_v_timeperiod, __pyx_v_nbdev)); - - /* "talib/func.pyx":11035 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11035, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11036 - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":11037 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11038 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_VAR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":11039 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_VAR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_VAR(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":11040 - * outreal_data[i] = NaN - * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_VAR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_VAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":11041 - * retCode = lib.TA_VAR( 0 , endidx , (real_data+begidx) , timeperiod , nbdev , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_VAR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":10993 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":11045 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_311WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_310WCLPRICE[] = " WCLPRICE(high, low, close)\n\n Weighted Close Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_311WCLPRICE = {"WCLPRICE", (PyCFunction)__pyx_pw_5talib_4func_311WCLPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_310WCLPRICE}; -static PyObject *__pyx_pw_5talib_4func_311WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WCLPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 1); __PYX_ERR(0, 11045, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 2); __PYX_ERR(0, 11045, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WCLPRICE") < 0)) __PYX_ERR(0, 11045, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11045, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 11045, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 11045, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 11045, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_310WCLPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_310WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("WCLPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":11067 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11068 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11068, __pyx_L1_error) - - /* "talib/func.pyx":11067 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":11069 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11070 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11070, __pyx_L1_error) - - /* "talib/func.pyx":11069 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11071 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11072 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11072, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11071 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":11073 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":11074 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11075 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11075, __pyx_L1_error) - - /* "talib/func.pyx":11074 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":11076 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11077 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11077, __pyx_L1_error) - - /* "talib/func.pyx":11076 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11078 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11079 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11079, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11078 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":11080 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":11081 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11082 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11082, __pyx_L1_error) - - /* "talib/func.pyx":11081 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":11083 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11084 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11084, __pyx_L1_error) - - /* "talib/func.pyx":11083 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11085 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11086 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11086, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11085 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":11087 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":11088 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":11089 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11090 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11090, __pyx_L1_error) - - /* "talib/func.pyx":11089 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":11091 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11092 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11092, __pyx_L1_error) - - /* "talib/func.pyx":11091 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":11093 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":11094 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11095 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":11096 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11097 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11096 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":11098 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":11099 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11100 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11099 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":11101 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":11102 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11103 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11102 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":11104 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":11105 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":11107 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11107, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":11108 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":11109 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_WCLPRICE_Lookback()); - - /* "talib/func.pyx":11110 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11110, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11111 - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":11112 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11113 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WCLPRICE", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":11114 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WCLPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WCLPRICE(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":11115 - * outreal_data[i] = NaN - * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WCLPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WCLPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":11116 - * retCode = lib.TA_WCLPRICE( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WCLPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":11045 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":11120 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_313WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_312WILLR[] = " WILLR(high, low, close[, timeperiod=?])\n\n Williams' %R (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_313WILLR = {"WILLR", (PyCFunction)__pyx_pw_5talib_4func_313WILLR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_312WILLR}; -static PyObject *__pyx_pw_5talib_4func_313WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WILLR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 1); __PYX_ERR(0, 11120, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 2); __PYX_ERR(0, 11120, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WILLR") < 0)) __PYX_ERR(0, 11120, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 11120, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11120, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 11120, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 11120, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 11120, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_312WILLR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_312WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("WILLR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/func.pyx":11144 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11145 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11145, __pyx_L1_error) - - /* "talib/func.pyx":11144 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/func.pyx":11146 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11147 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11147, __pyx_L1_error) - - /* "talib/func.pyx":11146 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11148 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11149 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11149, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11148 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/func.pyx":11150 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/func.pyx":11151 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11152 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11152, __pyx_L1_error) - - /* "talib/func.pyx":11151 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/func.pyx":11153 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11154 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11154, __pyx_L1_error) - - /* "talib/func.pyx":11153 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11155 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11156 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11156, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11155 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/func.pyx":11157 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/func.pyx":11158 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11159 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11159, __pyx_L1_error) - - /* "talib/func.pyx":11158 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/func.pyx":11160 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11161 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11161, __pyx_L1_error) - - /* "talib/func.pyx":11160 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11162 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11163 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11163, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11162 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/func.pyx":11164 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/func.pyx":11165 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/func.pyx":11166 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11167 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11167, __pyx_L1_error) - - /* "talib/func.pyx":11166 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/func.pyx":11168 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11169 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11169, __pyx_L1_error) - - /* "talib/func.pyx":11168 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * begidx = 0 - */ - } - - /* "talib/func.pyx":11170 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = high_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":11171 - * raise Exception("input lengths are different") - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = high_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11172 - * begidx = 0 - * for i from 0 <= i < length: - * val = high_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_high_data[__pyx_v_i]); - - /* "talib/func.pyx":11173 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11174 - * val = high_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = low_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11173 - * for i from 0 <= i < length: - * val = high_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = low_data[i] - */ - } - - /* "talib/func.pyx":11175 - * if val != val: - * continue - * val = low_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_low_data[__pyx_v_i]); - - /* "talib/func.pyx":11176 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11177 - * val = low_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * val = close_data[i] - * if val != val: - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11176 - * continue - * val = low_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * val = close_data[i] - */ - } - - /* "talib/func.pyx":11178 - * if val != val: - * continue - * val = close_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_close_data[__pyx_v_i]); - - /* "talib/func.pyx":11179 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11180 - * val = close_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L14_continue; - - /* "talib/func.pyx":11179 - * continue - * val = close_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":11181 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":11182 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L15_break; - __pyx_L14_continue:; - } - /*else*/ { - - /* "talib/func.pyx":11184 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11184, __pyx_L1_error) - } - __pyx_L15_break:; - - /* "talib/func.pyx":11185 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":11186 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_WILLR_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":11187 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11187, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11188 - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":11189 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11190 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WILLR", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":11191 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WILLR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WILLR(0, __pyx_v_endidx, ((double *)(__pyx_v_high_data + __pyx_v_begidx)), ((double *)(__pyx_v_low_data + __pyx_v_begidx)), ((double *)(__pyx_v_close_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":11192 - * outreal_data[i] = NaN - * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WILLR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WILLR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":11193 - * retCode = lib.TA_WILLR( 0 , endidx , (high_data+begidx) , (low_data+begidx) , (close_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WILLR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":11120 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/func.pyx":11197 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_4func_315WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_4func_314WMA[] = " WMA(real[, timeperiod=?])\n\n Weighted Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_4func_315WMA = {"WMA", (PyCFunction)__pyx_pw_5talib_4func_315WMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_4func_314WMA}; -static PyObject *__pyx_pw_5talib_4func_315WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WMA") < 0)) __PYX_ERR(0, 11197, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 11197, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11197, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.func.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 11197, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_4func_314WMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_4func_314WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - double __pyx_v_val; - int __pyx_v_begidx; - int __pyx_v_endidx; - int __pyx_v_lookback; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - PyArrayObject *__pyx_v_outreal = 0; - double *__pyx_v_outreal_data; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - int __pyx_t_4; - npy_intp __pyx_t_5; - __Pyx_RefNannySetupContext("WMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/func.pyx":11219 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11220 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11220, __pyx_L1_error) - - /* "talib/func.pyx":11219 - * np.ndarray outreal - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/func.pyx":11221 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11222 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11222, __pyx_L1_error) - - /* "talib/func.pyx":11221 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/func.pyx":11223 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11224 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11224, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11223 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/func.pyx":11225 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * begidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/func.pyx":11226 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/func.pyx":11227 - * real_data = real.data - * length = real.shape[0] - * begidx = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * val = real_data[i] - */ - __pyx_v_begidx = 0; - - /* "talib/func.pyx":11228 - * length = real.shape[0] - * begidx = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * val = real_data[i] - * if val != val: - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11229 - * begidx = 0 - * for i from 0 <= i < length: - * val = real_data[i] # <<<<<<<<<<<<<< - * if val != val: - * continue - */ - __pyx_v_val = (__pyx_v_real_data[__pyx_v_i]); - - /* "talib/func.pyx":11230 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - __pyx_t_1 = ((__pyx_v_val != __pyx_v_val) != 0); - if (__pyx_t_1) { - - /* "talib/func.pyx":11231 - * val = real_data[i] - * if val != val: - * continue # <<<<<<<<<<<<<< - * begidx = i - * break - */ - goto __pyx_L6_continue; - - /* "talib/func.pyx":11230 - * for i from 0 <= i < length: - * val = real_data[i] - * if val != val: # <<<<<<<<<<<<<< - * continue - * begidx = i - */ - } - - /* "talib/func.pyx":11232 - * if val != val: - * continue - * begidx = i # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_v_begidx = __pyx_v_i; - - /* "talib/func.pyx":11233 - * continue - * begidx = i - * break # <<<<<<<<<<<<<< - * else: - * raise Exception("inputs are all NaN") - */ - goto __pyx_L7_break; - __pyx_L6_continue:; - } - /*else*/ { - - /* "talib/func.pyx":11235 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 11235, __pyx_L1_error) - } - __pyx_L7_break:; - - /* "talib/func.pyx":11236 - * else: - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 # <<<<<<<<<<<<<< - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - */ - __pyx_v_endidx = ((__pyx_v_length - __pyx_v_begidx) - 1); - - /* "talib/func.pyx":11237 - * raise Exception("inputs are all NaN") - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) # <<<<<<<<<<<<<< - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - */ - __pyx_v_lookback = (__pyx_v_begidx + TA_WMA_Lookback(__pyx_v_timeperiod)); - - /* "talib/func.pyx":11238 - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) # <<<<<<<<<<<<<< - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - */ - __pyx_t_2 = PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 11238, __pyx_L1_error) - __pyx_v_outreal = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "talib/func.pyx":11239 - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data # <<<<<<<<<<<<<< - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - */ - __pyx_v_outreal_data = ((double *)__pyx_v_outreal->data); - - /* "talib/func.pyx":11240 - * outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): # <<<<<<<<<<<<<< - * outreal_data[i] = NaN - * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - */ - __pyx_t_3 = __pyx_v_length; - __pyx_t_4 = __pyx_v_lookback; - if (((__pyx_t_3 < __pyx_t_4) != 0)) { - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_4; - } - __pyx_t_3 = __pyx_t_5; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - - /* "talib/func.pyx":11241 - * outreal_data = outreal.data - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WMA", retCode) - */ - (__pyx_v_outreal_data[__pyx_v_i]) = __pyx_v_5talib_4func_NaN; - } - - /* "talib/func.pyx":11242 - * for i from 0 <= i < min(lookback, length): - * outreal_data[i] = NaN - * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WMA(0, __pyx_v_endidx, ((double *)(__pyx_v_real_data + __pyx_v_begidx)), __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), ((double *)(__pyx_v_outreal_data + __pyx_v_lookback))); - - /* "talib/func.pyx":11243 - * outreal_data[i] = NaN - * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/func.pyx":11244 - * retCode = lib.TA_WMA( 0 , endidx , (real_data+begidx) , timeperiod , &outbegidx , &outnbelement , (outreal_data+lookback) ) - * _ta_check_success("TA_WMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * __all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_outreal)); - __pyx_r = ((PyObject *)__pyx_v_outreal); - goto __pyx_L0; - - /* "talib/func.pyx":11197 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.func.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_outreal); - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1207, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1208, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * - */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1209, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__1210, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L7_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1211, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__1212, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) - */ - /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr - */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * - */ - Py_XDECREF(__pyx_v_arr->base); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "func", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_ACOS, __pyx_k_ACOS, sizeof(__pyx_k_ACOS), 0, 0, 1, 1}, - {&__pyx_n_s_AD, __pyx_k_AD, sizeof(__pyx_k_AD), 0, 0, 1, 1}, - {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1}, - {&__pyx_n_s_ADOSC, __pyx_k_ADOSC, sizeof(__pyx_k_ADOSC), 0, 0, 1, 1}, - {&__pyx_n_s_ADX, __pyx_k_ADX, sizeof(__pyx_k_ADX), 0, 0, 1, 1}, - {&__pyx_n_s_ADXR, __pyx_k_ADXR, sizeof(__pyx_k_ADXR), 0, 0, 1, 1}, - {&__pyx_n_s_APO, __pyx_k_APO, sizeof(__pyx_k_APO), 0, 0, 1, 1}, - {&__pyx_n_s_AROON, __pyx_k_AROON, sizeof(__pyx_k_AROON), 0, 0, 1, 1}, - {&__pyx_n_s_AROONOSC, __pyx_k_AROONOSC, sizeof(__pyx_k_AROONOSC), 0, 0, 1, 1}, - {&__pyx_n_s_ASIN, __pyx_k_ASIN, sizeof(__pyx_k_ASIN), 0, 0, 1, 1}, - {&__pyx_n_s_ATAN, __pyx_k_ATAN, sizeof(__pyx_k_ATAN), 0, 0, 1, 1}, - {&__pyx_n_s_ATR, __pyx_k_ATR, sizeof(__pyx_k_ATR), 0, 0, 1, 1}, - {&__pyx_n_s_AVGPRICE, __pyx_k_AVGPRICE, sizeof(__pyx_k_AVGPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_BBANDS, __pyx_k_BBANDS, sizeof(__pyx_k_BBANDS), 0, 0, 1, 1}, - {&__pyx_n_s_BETA, __pyx_k_BETA, sizeof(__pyx_k_BETA), 0, 0, 1, 1}, - {&__pyx_n_s_BOP, __pyx_k_BOP, sizeof(__pyx_k_BOP), 0, 0, 1, 1}, - {&__pyx_n_s_CCI, __pyx_k_CCI, sizeof(__pyx_k_CCI), 0, 0, 1, 1}, - {&__pyx_n_s_CDL2CROWS, __pyx_k_CDL2CROWS, sizeof(__pyx_k_CDL2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3BLACKCROWS, __pyx_k_CDL3BLACKCROWS, sizeof(__pyx_k_CDL3BLACKCROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3INSIDE, __pyx_k_CDL3INSIDE, sizeof(__pyx_k_CDL3INSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3LINESTRIKE, __pyx_k_CDL3LINESTRIKE, sizeof(__pyx_k_CDL3LINESTRIKE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3OUTSIDE, __pyx_k_CDL3OUTSIDE, sizeof(__pyx_k_CDL3OUTSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3STARSINSOUTH, __pyx_k_CDL3STARSINSOUTH, sizeof(__pyx_k_CDL3STARSINSOUTH), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3WHITESOLDIERS, __pyx_k_CDL3WHITESOLDIERS, sizeof(__pyx_k_CDL3WHITESOLDIERS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLABANDONEDBABY, __pyx_k_CDLABANDONEDBABY, sizeof(__pyx_k_CDLABANDONEDBABY), 0, 0, 1, 1}, - {&__pyx_n_s_CDLADVANCEBLOCK, __pyx_k_CDLADVANCEBLOCK, sizeof(__pyx_k_CDLADVANCEBLOCK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLBELTHOLD, __pyx_k_CDLBELTHOLD, sizeof(__pyx_k_CDLBELTHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLBREAKAWAY, __pyx_k_CDLBREAKAWAY, sizeof(__pyx_k_CDLBREAKAWAY), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_k_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCONCEALBABYSWALL, __pyx_k_CDLCONCEALBABYSWALL, sizeof(__pyx_k_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCOUNTERATTACK, __pyx_k_CDLCOUNTERATTACK, sizeof(__pyx_k_CDLCOUNTERATTACK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDARKCLOUDCOVER, __pyx_k_CDLDARKCLOUDCOVER, sizeof(__pyx_k_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDOJI, __pyx_k_CDLDOJI, sizeof(__pyx_k_CDLDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDOJISTAR, __pyx_k_CDLDOJISTAR, sizeof(__pyx_k_CDLDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDRAGONFLYDOJI, __pyx_k_CDLDRAGONFLYDOJI, sizeof(__pyx_k_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLENGULFING, __pyx_k_CDLENGULFING, sizeof(__pyx_k_CDLENGULFING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLEVENINGDOJISTAR, __pyx_k_CDLEVENINGDOJISTAR, sizeof(__pyx_k_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLEVENINGSTAR, __pyx_k_CDLEVENINGSTAR, sizeof(__pyx_k_CDLEVENINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_k_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLGRAVESTONEDOJI, __pyx_k_CDLGRAVESTONEDOJI, sizeof(__pyx_k_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHAMMER, __pyx_k_CDLHAMMER, sizeof(__pyx_k_CDLHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHANGINGMAN, __pyx_k_CDLHANGINGMAN, sizeof(__pyx_k_CDLHANGINGMAN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHARAMI, __pyx_k_CDLHARAMI, sizeof(__pyx_k_CDLHARAMI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHARAMICROSS, __pyx_k_CDLHARAMICROSS, sizeof(__pyx_k_CDLHARAMICROSS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIGHWAVE, __pyx_k_CDLHIGHWAVE, sizeof(__pyx_k_CDLHIGHWAVE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIKKAKE, __pyx_k_CDLHIKKAKE, sizeof(__pyx_k_CDLHIKKAKE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIKKAKEMOD, __pyx_k_CDLHIKKAKEMOD, sizeof(__pyx_k_CDLHIKKAKEMOD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHOMINGPIGEON, __pyx_k_CDLHOMINGPIGEON, sizeof(__pyx_k_CDLHOMINGPIGEON), 0, 0, 1, 1}, - {&__pyx_n_s_CDLIDENTICAL3CROWS, __pyx_k_CDLIDENTICAL3CROWS, sizeof(__pyx_k_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLINNECK, __pyx_k_CDLINNECK, sizeof(__pyx_k_CDLINNECK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLINVERTEDHAMMER, __pyx_k_CDLINVERTEDHAMMER, sizeof(__pyx_k_CDLINVERTEDHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLKICKING, __pyx_k_CDLKICKING, sizeof(__pyx_k_CDLKICKING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLKICKINGBYLENGTH, __pyx_k_CDLKICKINGBYLENGTH, sizeof(__pyx_k_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLADDERBOTTOM, __pyx_k_CDLLADDERBOTTOM, sizeof(__pyx_k_CDLLADDERBOTTOM), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_k_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLONGLINE, __pyx_k_CDLLONGLINE, sizeof(__pyx_k_CDLLONGLINE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMARUBOZU, __pyx_k_CDLMARUBOZU, sizeof(__pyx_k_CDLMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMATCHINGLOW, __pyx_k_CDLMATCHINGLOW, sizeof(__pyx_k_CDLMATCHINGLOW), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMATHOLD, __pyx_k_CDLMATHOLD, sizeof(__pyx_k_CDLMATHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMORNINGDOJISTAR, __pyx_k_CDLMORNINGDOJISTAR, sizeof(__pyx_k_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMORNINGSTAR, __pyx_k_CDLMORNINGSTAR, sizeof(__pyx_k_CDLMORNINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLONNECK, __pyx_k_CDLONNECK, sizeof(__pyx_k_CDLONNECK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLPIERCING, __pyx_k_CDLPIERCING, sizeof(__pyx_k_CDLPIERCING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLRICKSHAWMAN, __pyx_k_CDLRICKSHAWMAN, sizeof(__pyx_k_CDLRICKSHAWMAN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLRISEFALL3METHODS, __pyx_k_CDLRISEFALL3METHODS, sizeof(__pyx_k_CDLRISEFALL3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSEPARATINGLINES, __pyx_k_CDLSEPARATINGLINES, sizeof(__pyx_k_CDLSEPARATINGLINES), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSHOOTINGSTAR, __pyx_k_CDLSHOOTINGSTAR, sizeof(__pyx_k_CDLSHOOTINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSHORTLINE, __pyx_k_CDLSHORTLINE, sizeof(__pyx_k_CDLSHORTLINE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSPINNINGTOP, __pyx_k_CDLSPINNINGTOP, sizeof(__pyx_k_CDLSPINNINGTOP), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSTALLEDPATTERN, __pyx_k_CDLSTALLEDPATTERN, sizeof(__pyx_k_CDLSTALLEDPATTERN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSTICKSANDWICH, __pyx_k_CDLSTICKSANDWICH, sizeof(__pyx_k_CDLSTICKSANDWICH), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTAKURI, __pyx_k_CDLTAKURI, sizeof(__pyx_k_CDLTAKURI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTASUKIGAP, __pyx_k_CDLTASUKIGAP, sizeof(__pyx_k_CDLTASUKIGAP), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTHRUSTING, __pyx_k_CDLTHRUSTING, sizeof(__pyx_k_CDLTHRUSTING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTRISTAR, __pyx_k_CDLTRISTAR, sizeof(__pyx_k_CDLTRISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLUNIQUE3RIVER, __pyx_k_CDLUNIQUE3RIVER, sizeof(__pyx_k_CDLUNIQUE3RIVER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_k_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_k_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_CEIL, __pyx_k_CEIL, sizeof(__pyx_k_CEIL), 0, 0, 1, 1}, - {&__pyx_n_s_CMO, __pyx_k_CMO, sizeof(__pyx_k_CMO), 0, 0, 1, 1}, - {&__pyx_n_s_CORREL, __pyx_k_CORREL, sizeof(__pyx_k_CORREL), 0, 0, 1, 1}, - {&__pyx_n_s_COS, __pyx_k_COS, sizeof(__pyx_k_COS), 0, 0, 1, 1}, - {&__pyx_n_s_COSH, __pyx_k_COSH, sizeof(__pyx_k_COSH), 0, 0, 1, 1}, - {&__pyx_n_s_DEMA, __pyx_k_DEMA, sizeof(__pyx_k_DEMA), 0, 0, 1, 1}, - {&__pyx_n_s_DIV, __pyx_k_DIV, sizeof(__pyx_k_DIV), 0, 0, 1, 1}, - {&__pyx_n_s_DX, __pyx_k_DX, sizeof(__pyx_k_DX), 0, 0, 1, 1}, - {&__pyx_n_s_EMA, __pyx_k_EMA, sizeof(__pyx_k_EMA), 0, 0, 1, 1}, - {&__pyx_n_s_EXP, __pyx_k_EXP, sizeof(__pyx_k_EXP), 0, 0, 1, 1}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_n_s_FLOOR, __pyx_k_FLOOR, sizeof(__pyx_k_FLOOR), 0, 0, 1, 1}, - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_n_s_HT_DCPERIOD, __pyx_k_HT_DCPERIOD, sizeof(__pyx_k_HT_DCPERIOD), 0, 0, 1, 1}, - {&__pyx_n_s_HT_DCPHASE, __pyx_k_HT_DCPHASE, sizeof(__pyx_k_HT_DCPHASE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_PHASOR, __pyx_k_HT_PHASOR, sizeof(__pyx_k_HT_PHASOR), 0, 0, 1, 1}, - {&__pyx_n_s_HT_SINE, __pyx_k_HT_SINE, sizeof(__pyx_k_HT_SINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDLINE, __pyx_k_HT_TRENDLINE, sizeof(__pyx_k_HT_TRENDLINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDMODE, __pyx_k_HT_TRENDMODE, sizeof(__pyx_k_HT_TRENDMODE), 0, 0, 1, 1}, - {&__pyx_n_s_KAMA, __pyx_k_KAMA, sizeof(__pyx_k_KAMA), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG, __pyx_k_LINEARREG, sizeof(__pyx_k_LINEARREG), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_ANGLE, __pyx_k_LINEARREG_ANGLE, sizeof(__pyx_k_LINEARREG_ANGLE), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_INTERCEPT, __pyx_k_LINEARREG_INTERCEPT, sizeof(__pyx_k_LINEARREG_INTERCEPT), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_SLOPE, __pyx_k_LINEARREG_SLOPE, sizeof(__pyx_k_LINEARREG_SLOPE), 0, 0, 1, 1}, - {&__pyx_n_s_LN, __pyx_k_LN, sizeof(__pyx_k_LN), 0, 0, 1, 1}, - {&__pyx_n_s_LOG10, __pyx_k_LOG10, sizeof(__pyx_k_LOG10), 0, 0, 1, 1}, - {&__pyx_n_s_MA, __pyx_k_MA, sizeof(__pyx_k_MA), 0, 0, 1, 1}, - {&__pyx_n_s_MACD, __pyx_k_MACD, sizeof(__pyx_k_MACD), 0, 0, 1, 1}, - {&__pyx_n_s_MACDEXT, __pyx_k_MACDEXT, sizeof(__pyx_k_MACDEXT), 0, 0, 1, 1}, - {&__pyx_n_s_MACDFIX, __pyx_k_MACDFIX, sizeof(__pyx_k_MACDFIX), 0, 0, 1, 1}, - {&__pyx_n_s_MAMA, __pyx_k_MAMA, sizeof(__pyx_k_MAMA), 0, 0, 1, 1}, - {&__pyx_n_s_MAVP, __pyx_k_MAVP, sizeof(__pyx_k_MAVP), 0, 0, 1, 1}, - {&__pyx_n_s_MAX, __pyx_k_MAX, sizeof(__pyx_k_MAX), 0, 0, 1, 1}, - {&__pyx_n_s_MAXINDEX, __pyx_k_MAXINDEX, sizeof(__pyx_k_MAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MEDPRICE, __pyx_k_MEDPRICE, sizeof(__pyx_k_MEDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_MFI, __pyx_k_MFI, sizeof(__pyx_k_MFI), 0, 0, 1, 1}, - {&__pyx_n_s_MIDPOINT, __pyx_k_MIDPOINT, sizeof(__pyx_k_MIDPOINT), 0, 0, 1, 1}, - {&__pyx_n_s_MIDPRICE, __pyx_k_MIDPRICE, sizeof(__pyx_k_MIDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_MIN, __pyx_k_MIN, sizeof(__pyx_k_MIN), 0, 0, 1, 1}, - {&__pyx_n_s_MININDEX, __pyx_k_MININDEX, sizeof(__pyx_k_MININDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MINMAX, __pyx_k_MINMAX, sizeof(__pyx_k_MINMAX), 0, 0, 1, 1}, - {&__pyx_n_s_MINMAXINDEX, __pyx_k_MINMAXINDEX, sizeof(__pyx_k_MINMAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DI, __pyx_k_MINUS_DI, sizeof(__pyx_k_MINUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DM, __pyx_k_MINUS_DM, sizeof(__pyx_k_MINUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_MOM, __pyx_k_MOM, sizeof(__pyx_k_MOM), 0, 0, 1, 1}, - {&__pyx_n_s_MULT, __pyx_k_MULT, sizeof(__pyx_k_MULT), 0, 0, 1, 1}, - {&__pyx_n_s_NATR, __pyx_k_NATR, sizeof(__pyx_k_NATR), 0, 0, 1, 1}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_OBV, __pyx_k_OBV, sizeof(__pyx_k_OBV), 0, 0, 1, 1}, - {&__pyx_n_s_PLUS_DI, __pyx_k_PLUS_DI, sizeof(__pyx_k_PLUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_PLUS_DM, __pyx_k_PLUS_DM, sizeof(__pyx_k_PLUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_PPO, __pyx_k_PPO, sizeof(__pyx_k_PPO), 0, 0, 1, 1}, - {&__pyx_n_s_ROC, __pyx_k_ROC, sizeof(__pyx_k_ROC), 0, 0, 1, 1}, - {&__pyx_n_s_ROCP, __pyx_k_ROCP, sizeof(__pyx_k_ROCP), 0, 0, 1, 1}, - {&__pyx_n_s_ROCR, __pyx_k_ROCR, sizeof(__pyx_k_ROCR), 0, 0, 1, 1}, - {&__pyx_n_s_ROCR100, __pyx_k_ROCR100, sizeof(__pyx_k_ROCR100), 0, 0, 1, 1}, - {&__pyx_n_s_RSI, __pyx_k_RSI, sizeof(__pyx_k_RSI), 0, 0, 1, 1}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_SAR, __pyx_k_SAR, sizeof(__pyx_k_SAR), 0, 0, 1, 1}, - {&__pyx_n_s_SAREXT, __pyx_k_SAREXT, sizeof(__pyx_k_SAREXT), 0, 0, 1, 1}, - {&__pyx_n_s_SIN, __pyx_k_SIN, sizeof(__pyx_k_SIN), 0, 0, 1, 1}, - {&__pyx_n_s_SINH, __pyx_k_SINH, sizeof(__pyx_k_SINH), 0, 0, 1, 1}, - {&__pyx_n_s_SMA, __pyx_k_SMA, sizeof(__pyx_k_SMA), 0, 0, 1, 1}, - {&__pyx_n_s_SQRT, __pyx_k_SQRT, sizeof(__pyx_k_SQRT), 0, 0, 1, 1}, - {&__pyx_n_s_STDDEV, __pyx_k_STDDEV, sizeof(__pyx_k_STDDEV), 0, 0, 1, 1}, - {&__pyx_n_s_STOCH, __pyx_k_STOCH, sizeof(__pyx_k_STOCH), 0, 0, 1, 1}, - {&__pyx_n_s_STOCHF, __pyx_k_STOCHF, sizeof(__pyx_k_STOCHF), 0, 0, 1, 1}, - {&__pyx_n_s_STOCHRSI, __pyx_k_STOCHRSI, sizeof(__pyx_k_STOCHRSI), 0, 0, 1, 1}, - {&__pyx_n_s_SUB, __pyx_k_SUB, sizeof(__pyx_k_SUB), 0, 0, 1, 1}, - {&__pyx_n_s_SUM, __pyx_k_SUM, sizeof(__pyx_k_SUM), 0, 0, 1, 1}, - {&__pyx_n_s_T3, __pyx_k_T3, sizeof(__pyx_k_T3), 0, 0, 1, 1}, - {&__pyx_n_s_TAN, __pyx_k_TAN, sizeof(__pyx_k_TAN), 0, 0, 1, 1}, - {&__pyx_n_s_TANH, __pyx_k_TANH, sizeof(__pyx_k_TANH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ACOS, __pyx_k_TA_ACOS, sizeof(__pyx_k_TA_ACOS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AD, __pyx_k_TA_AD, sizeof(__pyx_k_TA_AD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADD, __pyx_k_TA_ADD, sizeof(__pyx_k_TA_ADD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADOSC, __pyx_k_TA_ADOSC, sizeof(__pyx_k_TA_ADOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADX, __pyx_k_TA_ADX, sizeof(__pyx_k_TA_ADX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADXR, __pyx_k_TA_ADXR, sizeof(__pyx_k_TA_ADXR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_APO, __pyx_k_TA_APO, sizeof(__pyx_k_TA_APO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AROON, __pyx_k_TA_AROON, sizeof(__pyx_k_TA_AROON), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AROONOSC, __pyx_k_TA_AROONOSC, sizeof(__pyx_k_TA_AROONOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ASIN, __pyx_k_TA_ASIN, sizeof(__pyx_k_TA_ASIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ATAN, __pyx_k_TA_ATAN, sizeof(__pyx_k_TA_ATAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ATR, __pyx_k_TA_ATR, sizeof(__pyx_k_TA_ATR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AVGPRICE, __pyx_k_TA_AVGPRICE, sizeof(__pyx_k_TA_AVGPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BBANDS, __pyx_k_TA_BBANDS, sizeof(__pyx_k_TA_BBANDS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BETA, __pyx_k_TA_BETA, sizeof(__pyx_k_TA_BETA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BOP, __pyx_k_TA_BOP, sizeof(__pyx_k_TA_BOP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CCI, __pyx_k_TA_CCI, sizeof(__pyx_k_TA_CCI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL2CROWS, __pyx_k_TA_CDL2CROWS, sizeof(__pyx_k_TA_CDL2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_k_TA_CDL3BLACKCROWS, sizeof(__pyx_k_TA_CDL3BLACKCROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3INSIDE, __pyx_k_TA_CDL3INSIDE, sizeof(__pyx_k_TA_CDL3INSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_k_TA_CDL3LINESTRIKE, sizeof(__pyx_k_TA_CDL3LINESTRIKE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3OUTSIDE, __pyx_k_TA_CDL3OUTSIDE, sizeof(__pyx_k_TA_CDL3OUTSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_k_TA_CDL3STARSINSOUTH, sizeof(__pyx_k_TA_CDL3STARSINSOUTH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_k_TA_CDL3WHITESOLDIERS, sizeof(__pyx_k_TA_CDL3WHITESOLDIERS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_k_TA_CDLABANDONEDBABY, sizeof(__pyx_k_TA_CDLABANDONEDBABY), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_k_TA_CDLADVANCEBLOCK, sizeof(__pyx_k_TA_CDLADVANCEBLOCK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLBELTHOLD, __pyx_k_TA_CDLBELTHOLD, sizeof(__pyx_k_TA_CDLBELTHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLBREAKAWAY, __pyx_k_TA_CDLBREAKAWAY, sizeof(__pyx_k_TA_CDLBREAKAWAY), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_k_TA_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_TA_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_k_TA_CDLCONCEALBABYSWALL, sizeof(__pyx_k_TA_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_k_TA_CDLCOUNTERATTACK, sizeof(__pyx_k_TA_CDLCOUNTERATTACK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_k_TA_CDLDARKCLOUDCOVER, sizeof(__pyx_k_TA_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDOJI, __pyx_k_TA_CDLDOJI, sizeof(__pyx_k_TA_CDLDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDOJISTAR, __pyx_k_TA_CDLDOJISTAR, sizeof(__pyx_k_TA_CDLDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_k_TA_CDLDRAGONFLYDOJI, sizeof(__pyx_k_TA_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLENGULFING, __pyx_k_TA_CDLENGULFING, sizeof(__pyx_k_TA_CDLENGULFING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_k_TA_CDLEVENINGDOJISTAR, sizeof(__pyx_k_TA_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_k_TA_CDLEVENINGSTAR, sizeof(__pyx_k_TA_CDLEVENINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_k_TA_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_TA_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_k_TA_CDLGRAVESTONEDOJI, sizeof(__pyx_k_TA_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHAMMER, __pyx_k_TA_CDLHAMMER, sizeof(__pyx_k_TA_CDLHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHANGINGMAN, __pyx_k_TA_CDLHANGINGMAN, sizeof(__pyx_k_TA_CDLHANGINGMAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHARAMI, __pyx_k_TA_CDLHARAMI, sizeof(__pyx_k_TA_CDLHARAMI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHARAMICROSS, __pyx_k_TA_CDLHARAMICROSS, sizeof(__pyx_k_TA_CDLHARAMICROSS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIGHWAVE, __pyx_k_TA_CDLHIGHWAVE, sizeof(__pyx_k_TA_CDLHIGHWAVE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIKKAKE, __pyx_k_TA_CDLHIKKAKE, sizeof(__pyx_k_TA_CDLHIKKAKE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_k_TA_CDLHIKKAKEMOD, sizeof(__pyx_k_TA_CDLHIKKAKEMOD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_k_TA_CDLHOMINGPIGEON, sizeof(__pyx_k_TA_CDLHOMINGPIGEON), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_k_TA_CDLIDENTICAL3CROWS, sizeof(__pyx_k_TA_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLINNECK, __pyx_k_TA_CDLINNECK, sizeof(__pyx_k_TA_CDLINNECK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_k_TA_CDLINVERTEDHAMMER, sizeof(__pyx_k_TA_CDLINVERTEDHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLKICKING, __pyx_k_TA_CDLKICKING, sizeof(__pyx_k_TA_CDLKICKING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_k_TA_CDLKICKINGBYLENGTH, sizeof(__pyx_k_TA_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_k_TA_CDLLADDERBOTTOM, sizeof(__pyx_k_TA_CDLLADDERBOTTOM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_k_TA_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_TA_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLONGLINE, __pyx_k_TA_CDLLONGLINE, sizeof(__pyx_k_TA_CDLLONGLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMARUBOZU, __pyx_k_TA_CDLMARUBOZU, sizeof(__pyx_k_TA_CDLMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_k_TA_CDLMATCHINGLOW, sizeof(__pyx_k_TA_CDLMATCHINGLOW), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMATHOLD, __pyx_k_TA_CDLMATHOLD, sizeof(__pyx_k_TA_CDLMATHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_k_TA_CDLMORNINGDOJISTAR, sizeof(__pyx_k_TA_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_k_TA_CDLMORNINGSTAR, sizeof(__pyx_k_TA_CDLMORNINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLONNECK, __pyx_k_TA_CDLONNECK, sizeof(__pyx_k_TA_CDLONNECK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLPIERCING, __pyx_k_TA_CDLPIERCING, sizeof(__pyx_k_TA_CDLPIERCING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_k_TA_CDLRICKSHAWMAN, sizeof(__pyx_k_TA_CDLRICKSHAWMAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_k_TA_CDLRISEFALL3METHODS, sizeof(__pyx_k_TA_CDLRISEFALL3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_k_TA_CDLSEPARATINGLINES, sizeof(__pyx_k_TA_CDLSEPARATINGLINES), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_k_TA_CDLSHOOTINGSTAR, sizeof(__pyx_k_TA_CDLSHOOTINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSHORTLINE, __pyx_k_TA_CDLSHORTLINE, sizeof(__pyx_k_TA_CDLSHORTLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_k_TA_CDLSPINNINGTOP, sizeof(__pyx_k_TA_CDLSPINNINGTOP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_k_TA_CDLSTALLEDPATTERN, sizeof(__pyx_k_TA_CDLSTALLEDPATTERN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_k_TA_CDLSTICKSANDWICH, sizeof(__pyx_k_TA_CDLSTICKSANDWICH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTAKURI, __pyx_k_TA_CDLTAKURI, sizeof(__pyx_k_TA_CDLTAKURI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTASUKIGAP, __pyx_k_TA_CDLTASUKIGAP, sizeof(__pyx_k_TA_CDLTASUKIGAP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTHRUSTING, __pyx_k_TA_CDLTHRUSTING, sizeof(__pyx_k_TA_CDLTHRUSTING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTRISTAR, __pyx_k_TA_CDLTRISTAR, sizeof(__pyx_k_TA_CDLTRISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_k_TA_CDLUNIQUE3RIVER, sizeof(__pyx_k_TA_CDLUNIQUE3RIVER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_k_TA_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_TA_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_k_TA_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_TA_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CEIL, __pyx_k_TA_CEIL, sizeof(__pyx_k_TA_CEIL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CMO, __pyx_k_TA_CMO, sizeof(__pyx_k_TA_CMO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CORREL, __pyx_k_TA_CORREL, sizeof(__pyx_k_TA_CORREL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_COS, __pyx_k_TA_COS, sizeof(__pyx_k_TA_COS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_COSH, __pyx_k_TA_COSH, sizeof(__pyx_k_TA_COSH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DEMA, __pyx_k_TA_DEMA, sizeof(__pyx_k_TA_DEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DIV, __pyx_k_TA_DIV, sizeof(__pyx_k_TA_DIV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DX, __pyx_k_TA_DX, sizeof(__pyx_k_TA_DX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_EMA, __pyx_k_TA_EMA, sizeof(__pyx_k_TA_EMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_EXP, __pyx_k_TA_EXP, sizeof(__pyx_k_TA_EXP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_FLOOR, __pyx_k_TA_FLOOR, sizeof(__pyx_k_TA_FLOOR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_DCPERIOD, __pyx_k_TA_HT_DCPERIOD, sizeof(__pyx_k_TA_HT_DCPERIOD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_DCPHASE, __pyx_k_TA_HT_DCPHASE, sizeof(__pyx_k_TA_HT_DCPHASE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_PHASOR, __pyx_k_TA_HT_PHASOR, sizeof(__pyx_k_TA_HT_PHASOR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_SINE, __pyx_k_TA_HT_SINE, sizeof(__pyx_k_TA_HT_SINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_TRENDLINE, __pyx_k_TA_HT_TRENDLINE, sizeof(__pyx_k_TA_HT_TRENDLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_TRENDMODE, __pyx_k_TA_HT_TRENDMODE, sizeof(__pyx_k_TA_HT_TRENDMODE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_KAMA, __pyx_k_TA_KAMA, sizeof(__pyx_k_TA_KAMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG, __pyx_k_TA_LINEARREG, sizeof(__pyx_k_TA_LINEARREG), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_k_TA_LINEARREG_ANGLE, sizeof(__pyx_k_TA_LINEARREG_ANGLE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_k_TA_LINEARREG_INTERCEPT, sizeof(__pyx_k_TA_LINEARREG_INTERCEPT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_k_TA_LINEARREG_SLOPE, sizeof(__pyx_k_TA_LINEARREG_SLOPE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LN, __pyx_k_TA_LN, sizeof(__pyx_k_TA_LN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LOG10, __pyx_k_TA_LOG10, sizeof(__pyx_k_TA_LOG10), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MA, __pyx_k_TA_MA, sizeof(__pyx_k_TA_MA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACD, __pyx_k_TA_MACD, sizeof(__pyx_k_TA_MACD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACDEXT, __pyx_k_TA_MACDEXT, sizeof(__pyx_k_TA_MACDEXT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACDFIX, __pyx_k_TA_MACDFIX, sizeof(__pyx_k_TA_MACDFIX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAMA, __pyx_k_TA_MAMA, sizeof(__pyx_k_TA_MAMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAVP, __pyx_k_TA_MAVP, sizeof(__pyx_k_TA_MAVP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAX, __pyx_k_TA_MAX, sizeof(__pyx_k_TA_MAX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAXINDEX, __pyx_k_TA_MAXINDEX, sizeof(__pyx_k_TA_MAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MEDPRICE, __pyx_k_TA_MEDPRICE, sizeof(__pyx_k_TA_MEDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MFI, __pyx_k_TA_MFI, sizeof(__pyx_k_TA_MFI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIDPOINT, __pyx_k_TA_MIDPOINT, sizeof(__pyx_k_TA_MIDPOINT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIDPRICE, __pyx_k_TA_MIDPRICE, sizeof(__pyx_k_TA_MIDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIN, __pyx_k_TA_MIN, sizeof(__pyx_k_TA_MIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MININDEX, __pyx_k_TA_MININDEX, sizeof(__pyx_k_TA_MININDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINMAX, __pyx_k_TA_MINMAX, sizeof(__pyx_k_TA_MINMAX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINMAXINDEX, __pyx_k_TA_MINMAXINDEX, sizeof(__pyx_k_TA_MINMAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINUS_DI, __pyx_k_TA_MINUS_DI, sizeof(__pyx_k_TA_MINUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINUS_DM, __pyx_k_TA_MINUS_DM, sizeof(__pyx_k_TA_MINUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MOM, __pyx_k_TA_MOM, sizeof(__pyx_k_TA_MOM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MULT, __pyx_k_TA_MULT, sizeof(__pyx_k_TA_MULT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_NATR, __pyx_k_TA_NATR, sizeof(__pyx_k_TA_NATR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_OBV, __pyx_k_TA_OBV, sizeof(__pyx_k_TA_OBV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PLUS_DI, __pyx_k_TA_PLUS_DI, sizeof(__pyx_k_TA_PLUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PLUS_DM, __pyx_k_TA_PLUS_DM, sizeof(__pyx_k_TA_PLUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PPO, __pyx_k_TA_PPO, sizeof(__pyx_k_TA_PPO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROC, __pyx_k_TA_ROC, sizeof(__pyx_k_TA_ROC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCP, __pyx_k_TA_ROCP, sizeof(__pyx_k_TA_ROCP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCR, __pyx_k_TA_ROCR, sizeof(__pyx_k_TA_ROCR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCR100, __pyx_k_TA_ROCR100, sizeof(__pyx_k_TA_ROCR100), 0, 0, 1, 1}, - {&__pyx_n_s_TA_RSI, __pyx_k_TA_RSI, sizeof(__pyx_k_TA_RSI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SAR, __pyx_k_TA_SAR, sizeof(__pyx_k_TA_SAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SAREXT, __pyx_k_TA_SAREXT, sizeof(__pyx_k_TA_SAREXT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SIN, __pyx_k_TA_SIN, sizeof(__pyx_k_TA_SIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SINH, __pyx_k_TA_SINH, sizeof(__pyx_k_TA_SINH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SMA, __pyx_k_TA_SMA, sizeof(__pyx_k_TA_SMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SQRT, __pyx_k_TA_SQRT, sizeof(__pyx_k_TA_SQRT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STDDEV, __pyx_k_TA_STDDEV, sizeof(__pyx_k_TA_STDDEV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCH, __pyx_k_TA_STOCH, sizeof(__pyx_k_TA_STOCH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCHF, __pyx_k_TA_STOCHF, sizeof(__pyx_k_TA_STOCHF), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCHRSI, __pyx_k_TA_STOCHRSI, sizeof(__pyx_k_TA_STOCHRSI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SUB, __pyx_k_TA_SUB, sizeof(__pyx_k_TA_SUB), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SUM, __pyx_k_TA_SUM, sizeof(__pyx_k_TA_SUM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_T3, __pyx_k_TA_T3, sizeof(__pyx_k_TA_T3), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TAN, __pyx_k_TA_TAN, sizeof(__pyx_k_TA_TAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TANH, __pyx_k_TA_TANH, sizeof(__pyx_k_TA_TANH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TEMA, __pyx_k_TA_TEMA, sizeof(__pyx_k_TA_TEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRANGE, __pyx_k_TA_TRANGE, sizeof(__pyx_k_TA_TRANGE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRIMA, __pyx_k_TA_TRIMA, sizeof(__pyx_k_TA_TRIMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRIX, __pyx_k_TA_TRIX, sizeof(__pyx_k_TA_TRIX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TSF, __pyx_k_TA_TSF, sizeof(__pyx_k_TA_TSF), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TYPPRICE, __pyx_k_TA_TYPPRICE, sizeof(__pyx_k_TA_TYPPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ULTOSC, __pyx_k_TA_ULTOSC, sizeof(__pyx_k_TA_ULTOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_VAR, __pyx_k_TA_VAR, sizeof(__pyx_k_TA_VAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WCLPRICE, __pyx_k_TA_WCLPRICE, sizeof(__pyx_k_TA_WCLPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WILLR, __pyx_k_TA_WILLR, sizeof(__pyx_k_TA_WILLR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WMA, __pyx_k_TA_WMA, sizeof(__pyx_k_TA_WMA), 0, 0, 1, 1}, - {&__pyx_n_s_TEMA, __pyx_k_TEMA, sizeof(__pyx_k_TEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TRANGE, __pyx_k_TRANGE, sizeof(__pyx_k_TRANGE), 0, 0, 1, 1}, - {&__pyx_n_s_TRIMA, __pyx_k_TRIMA, sizeof(__pyx_k_TRIMA), 0, 0, 1, 1}, - {&__pyx_n_s_TRIX, __pyx_k_TRIX, sizeof(__pyx_k_TRIX), 0, 0, 1, 1}, - {&__pyx_n_s_TSF, __pyx_k_TSF, sizeof(__pyx_k_TSF), 0, 0, 1, 1}, - {&__pyx_n_s_TYPPRICE, __pyx_k_TYPPRICE, sizeof(__pyx_k_TYPPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_ULTOSC, __pyx_k_ULTOSC, sizeof(__pyx_k_ULTOSC), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_k_Users_jbenedik_Dev_ta_lib_talib, sizeof(__pyx_k_Users_jbenedik_Dev_ta_lib_talib), 0, 0, 1, 0}, - {&__pyx_n_s_VAR, __pyx_k_VAR, sizeof(__pyx_k_VAR), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_WCLPRICE, __pyx_k_WCLPRICE, sizeof(__pyx_k_WCLPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_WILLR, __pyx_k_WILLR, sizeof(__pyx_k_WILLR), 0, 0, 1, 1}, - {&__pyx_n_s_WMA, __pyx_k_WMA, sizeof(__pyx_k_WMA), 0, 0, 1, 1}, - {&__pyx_n_s_acceleration, __pyx_k_acceleration, sizeof(__pyx_k_acceleration), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationinitlong, __pyx_k_accelerationinitlong, sizeof(__pyx_k_accelerationinitlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationinitshort, __pyx_k_accelerationinitshort, sizeof(__pyx_k_accelerationinitshort), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationlong, __pyx_k_accelerationlong, sizeof(__pyx_k_accelerationlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationmaxlong, __pyx_k_accelerationmaxlong, sizeof(__pyx_k_accelerationmaxlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationmaxshort, __pyx_k_accelerationmaxshort, sizeof(__pyx_k_accelerationmaxshort), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationshort, __pyx_k_accelerationshort, sizeof(__pyx_k_accelerationshort), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_begidx, __pyx_k_begidx, sizeof(__pyx_k_begidx), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_close_data, __pyx_k_close_data, sizeof(__pyx_k_close_data), 0, 0, 1, 1}, - {&__pyx_kp_s_close_has_wrong_dimensions, __pyx_k_close_has_wrong_dimensions, sizeof(__pyx_k_close_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_close_is_not_double, __pyx_k_close_is_not_double, sizeof(__pyx_k_close_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_endidx, __pyx_k_endidx, sizeof(__pyx_k_endidx), 0, 0, 1, 1}, - {&__pyx_n_s_fastd_matype, __pyx_k_fastd_matype, sizeof(__pyx_k_fastd_matype), 0, 0, 1, 1}, - {&__pyx_n_s_fastd_period, __pyx_k_fastd_period, sizeof(__pyx_k_fastd_period), 0, 0, 1, 1}, - {&__pyx_n_s_fastk_period, __pyx_k_fastk_period, sizeof(__pyx_k_fastk_period), 0, 0, 1, 1}, - {&__pyx_n_s_fastlimit, __pyx_k_fastlimit, sizeof(__pyx_k_fastlimit), 0, 0, 1, 1}, - {&__pyx_n_s_fastmatype, __pyx_k_fastmatype, sizeof(__pyx_k_fastmatype), 0, 0, 1, 1}, - {&__pyx_n_s_fastperiod, __pyx_k_fastperiod, sizeof(__pyx_k_fastperiod), 0, 0, 1, 1}, - {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1}, - {&__pyx_n_s_high_data, __pyx_k_high_data, sizeof(__pyx_k_high_data), 0, 0, 1, 1}, - {&__pyx_kp_s_high_has_wrong_dimensions, __pyx_k_high_has_wrong_dimensions, sizeof(__pyx_k_high_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_high_is_not_double, __pyx_k_high_is_not_double, sizeof(__pyx_k_high_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_kp_s_input_lengths_are_different, __pyx_k_input_lengths_are_different, sizeof(__pyx_k_input_lengths_are_different), 0, 0, 1, 0}, - {&__pyx_kp_s_inputs_are_all_NaN, __pyx_k_inputs_are_all_NaN, sizeof(__pyx_k_inputs_are_all_NaN), 0, 0, 1, 0}, - {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, - {&__pyx_n_s_lookback, __pyx_k_lookback, sizeof(__pyx_k_lookback), 0, 0, 1, 1}, - {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1}, - {&__pyx_n_s_low_data, __pyx_k_low_data, sizeof(__pyx_k_low_data), 0, 0, 1, 1}, - {&__pyx_kp_s_low_has_wrong_dimensions, __pyx_k_low_has_wrong_dimensions, sizeof(__pyx_k_low_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_low_is_not_double, __pyx_k_low_is_not_double, sizeof(__pyx_k_low_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_matype, __pyx_k_matype, sizeof(__pyx_k_matype), 0, 0, 1, 1}, - {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, - {&__pyx_n_s_maxperiod, __pyx_k_maxperiod, sizeof(__pyx_k_maxperiod), 0, 0, 1, 1}, - {&__pyx_n_s_minperiod, __pyx_k_minperiod, sizeof(__pyx_k_minperiod), 0, 0, 1, 1}, - {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, - {&__pyx_n_s_nbdev, __pyx_k_nbdev, sizeof(__pyx_k_nbdev), 0, 0, 1, 1}, - {&__pyx_n_s_nbdevdn, __pyx_k_nbdevdn, sizeof(__pyx_k_nbdevdn), 0, 0, 1, 1}, - {&__pyx_n_s_nbdevup, __pyx_k_nbdevup, sizeof(__pyx_k_nbdevup), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_offsetonreverse, __pyx_k_offsetonreverse, sizeof(__pyx_k_offsetonreverse), 0, 0, 1, 1}, - {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, - {&__pyx_n_s_open_data, __pyx_k_open_data, sizeof(__pyx_k_open_data), 0, 0, 1, 1}, - {&__pyx_kp_s_open_has_wrong_dimensions, __pyx_k_open_has_wrong_dimensions, sizeof(__pyx_k_open_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_open_is_not_double, __pyx_k_open_is_not_double, sizeof(__pyx_k_open_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_outaroondown, __pyx_k_outaroondown, sizeof(__pyx_k_outaroondown), 0, 0, 1, 1}, - {&__pyx_n_s_outaroondown_data, __pyx_k_outaroondown_data, sizeof(__pyx_k_outaroondown_data), 0, 0, 1, 1}, - {&__pyx_n_s_outaroonup, __pyx_k_outaroonup, sizeof(__pyx_k_outaroonup), 0, 0, 1, 1}, - {&__pyx_n_s_outaroonup_data, __pyx_k_outaroonup_data, sizeof(__pyx_k_outaroonup_data), 0, 0, 1, 1}, - {&__pyx_n_s_outbegidx, __pyx_k_outbegidx, sizeof(__pyx_k_outbegidx), 0, 0, 1, 1}, - {&__pyx_n_s_outfama, __pyx_k_outfama, sizeof(__pyx_k_outfama), 0, 0, 1, 1}, - {&__pyx_n_s_outfama_data, __pyx_k_outfama_data, sizeof(__pyx_k_outfama_data), 0, 0, 1, 1}, - {&__pyx_n_s_outfastd, __pyx_k_outfastd, sizeof(__pyx_k_outfastd), 0, 0, 1, 1}, - {&__pyx_n_s_outfastd_data, __pyx_k_outfastd_data, sizeof(__pyx_k_outfastd_data), 0, 0, 1, 1}, - {&__pyx_n_s_outfastk, __pyx_k_outfastk, sizeof(__pyx_k_outfastk), 0, 0, 1, 1}, - {&__pyx_n_s_outfastk_data, __pyx_k_outfastk_data, sizeof(__pyx_k_outfastk_data), 0, 0, 1, 1}, - {&__pyx_n_s_outinphase, __pyx_k_outinphase, sizeof(__pyx_k_outinphase), 0, 0, 1, 1}, - {&__pyx_n_s_outinphase_data, __pyx_k_outinphase_data, sizeof(__pyx_k_outinphase_data), 0, 0, 1, 1}, - {&__pyx_n_s_outinteger, __pyx_k_outinteger, sizeof(__pyx_k_outinteger), 0, 0, 1, 1}, - {&__pyx_n_s_outinteger_data, __pyx_k_outinteger_data, sizeof(__pyx_k_outinteger_data), 0, 0, 1, 1}, - {&__pyx_n_s_outleadsine, __pyx_k_outleadsine, sizeof(__pyx_k_outleadsine), 0, 0, 1, 1}, - {&__pyx_n_s_outleadsine_data, __pyx_k_outleadsine_data, sizeof(__pyx_k_outleadsine_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmacd, __pyx_k_outmacd, sizeof(__pyx_k_outmacd), 0, 0, 1, 1}, - {&__pyx_n_s_outmacd_data, __pyx_k_outmacd_data, sizeof(__pyx_k_outmacd_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdhist, __pyx_k_outmacdhist, sizeof(__pyx_k_outmacdhist), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdhist_data, __pyx_k_outmacdhist_data, sizeof(__pyx_k_outmacdhist_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdsignal, __pyx_k_outmacdsignal, sizeof(__pyx_k_outmacdsignal), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdsignal_data, __pyx_k_outmacdsignal_data, sizeof(__pyx_k_outmacdsignal_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmama, __pyx_k_outmama, sizeof(__pyx_k_outmama), 0, 0, 1, 1}, - {&__pyx_n_s_outmama_data, __pyx_k_outmama_data, sizeof(__pyx_k_outmama_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmax, __pyx_k_outmax, sizeof(__pyx_k_outmax), 0, 0, 1, 1}, - {&__pyx_n_s_outmax_data, __pyx_k_outmax_data, sizeof(__pyx_k_outmax_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmaxidx, __pyx_k_outmaxidx, sizeof(__pyx_k_outmaxidx), 0, 0, 1, 1}, - {&__pyx_n_s_outmaxidx_data, __pyx_k_outmaxidx_data, sizeof(__pyx_k_outmaxidx_data), 0, 0, 1, 1}, - {&__pyx_n_s_outmin, __pyx_k_outmin, sizeof(__pyx_k_outmin), 0, 0, 1, 1}, - {&__pyx_n_s_outmin_data, __pyx_k_outmin_data, sizeof(__pyx_k_outmin_data), 0, 0, 1, 1}, - {&__pyx_n_s_outminidx, __pyx_k_outminidx, sizeof(__pyx_k_outminidx), 0, 0, 1, 1}, - {&__pyx_n_s_outminidx_data, __pyx_k_outminidx_data, sizeof(__pyx_k_outminidx_data), 0, 0, 1, 1}, - {&__pyx_n_s_outnbelement, __pyx_k_outnbelement, sizeof(__pyx_k_outnbelement), 0, 0, 1, 1}, - {&__pyx_n_s_outquadrature, __pyx_k_outquadrature, sizeof(__pyx_k_outquadrature), 0, 0, 1, 1}, - {&__pyx_n_s_outquadrature_data, __pyx_k_outquadrature_data, sizeof(__pyx_k_outquadrature_data), 0, 0, 1, 1}, - {&__pyx_n_s_outreal, __pyx_k_outreal, sizeof(__pyx_k_outreal), 0, 0, 1, 1}, - {&__pyx_n_s_outreal_data, __pyx_k_outreal_data, sizeof(__pyx_k_outreal_data), 0, 0, 1, 1}, - {&__pyx_n_s_outreallowerband, __pyx_k_outreallowerband, sizeof(__pyx_k_outreallowerband), 0, 0, 1, 1}, - {&__pyx_n_s_outreallowerband_data, __pyx_k_outreallowerband_data, sizeof(__pyx_k_outreallowerband_data), 0, 0, 1, 1}, - {&__pyx_n_s_outrealmiddleband, __pyx_k_outrealmiddleband, sizeof(__pyx_k_outrealmiddleband), 0, 0, 1, 1}, - {&__pyx_n_s_outrealmiddleband_data, __pyx_k_outrealmiddleband_data, sizeof(__pyx_k_outrealmiddleband_data), 0, 0, 1, 1}, - {&__pyx_n_s_outrealupperband, __pyx_k_outrealupperband, sizeof(__pyx_k_outrealupperband), 0, 0, 1, 1}, - {&__pyx_n_s_outrealupperband_data, __pyx_k_outrealupperband_data, sizeof(__pyx_k_outrealupperband_data), 0, 0, 1, 1}, - {&__pyx_n_s_outsine, __pyx_k_outsine, sizeof(__pyx_k_outsine), 0, 0, 1, 1}, - {&__pyx_n_s_outsine_data, __pyx_k_outsine_data, sizeof(__pyx_k_outsine_data), 0, 0, 1, 1}, - {&__pyx_n_s_outslowd, __pyx_k_outslowd, sizeof(__pyx_k_outslowd), 0, 0, 1, 1}, - {&__pyx_n_s_outslowd_data, __pyx_k_outslowd_data, sizeof(__pyx_k_outslowd_data), 0, 0, 1, 1}, - {&__pyx_n_s_outslowk, __pyx_k_outslowk, sizeof(__pyx_k_outslowk), 0, 0, 1, 1}, - {&__pyx_n_s_outslowk_data, __pyx_k_outslowk_data, sizeof(__pyx_k_outslowk_data), 0, 0, 1, 1}, - {&__pyx_n_s_penetration, __pyx_k_penetration, sizeof(__pyx_k_penetration), 0, 0, 1, 1}, - {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, - {&__pyx_n_s_periods_data, __pyx_k_periods_data, sizeof(__pyx_k_periods_data), 0, 0, 1, 1}, - {&__pyx_kp_s_periods_has_wrong_dimensions, __pyx_k_periods_has_wrong_dimensions, sizeof(__pyx_k_periods_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_periods_is_not_double, __pyx_k_periods_is_not_double, sizeof(__pyx_k_periods_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, - {&__pyx_n_s_real0, __pyx_k_real0, sizeof(__pyx_k_real0), 0, 0, 1, 1}, - {&__pyx_n_s_real0_data, __pyx_k_real0_data, sizeof(__pyx_k_real0_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real0_has_wrong_dimensions, __pyx_k_real0_has_wrong_dimensions, sizeof(__pyx_k_real0_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real0_is_not_double, __pyx_k_real0_is_not_double, sizeof(__pyx_k_real0_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_real1, __pyx_k_real1, sizeof(__pyx_k_real1), 0, 0, 1, 1}, - {&__pyx_n_s_real1_data, __pyx_k_real1_data, sizeof(__pyx_k_real1_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real1_has_wrong_dimensions, __pyx_k_real1_has_wrong_dimensions, sizeof(__pyx_k_real1_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real1_is_not_double, __pyx_k_real1_is_not_double, sizeof(__pyx_k_real1_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_real_data, __pyx_k_real_data, sizeof(__pyx_k_real_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real_has_wrong_dimensions, __pyx_k_real_has_wrong_dimensions, sizeof(__pyx_k_real_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real_is_not_double, __pyx_k_real_is_not_double, sizeof(__pyx_k_real_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_retCode, __pyx_k_retCode, sizeof(__pyx_k_retCode), 0, 0, 1, 1}, - {&__pyx_n_s_signalmatype, __pyx_k_signalmatype, sizeof(__pyx_k_signalmatype), 0, 0, 1, 1}, - {&__pyx_n_s_signalperiod, __pyx_k_signalperiod, sizeof(__pyx_k_signalperiod), 0, 0, 1, 1}, - {&__pyx_n_s_slowd_matype, __pyx_k_slowd_matype, sizeof(__pyx_k_slowd_matype), 0, 0, 1, 1}, - {&__pyx_n_s_slowd_period, __pyx_k_slowd_period, sizeof(__pyx_k_slowd_period), 0, 0, 1, 1}, - {&__pyx_n_s_slowk_matype, __pyx_k_slowk_matype, sizeof(__pyx_k_slowk_matype), 0, 0, 1, 1}, - {&__pyx_n_s_slowk_period, __pyx_k_slowk_period, sizeof(__pyx_k_slowk_period), 0, 0, 1, 1}, - {&__pyx_n_s_slowlimit, __pyx_k_slowlimit, sizeof(__pyx_k_slowlimit), 0, 0, 1, 1}, - {&__pyx_n_s_slowmatype, __pyx_k_slowmatype, sizeof(__pyx_k_slowmatype), 0, 0, 1, 1}, - {&__pyx_n_s_slowperiod, __pyx_k_slowperiod, sizeof(__pyx_k_slowperiod), 0, 0, 1, 1}, - {&__pyx_n_s_startvalue, __pyx_k_startvalue, sizeof(__pyx_k_startvalue), 0, 0, 1, 1}, - {&__pyx_n_s_talib_func, __pyx_k_talib_func, sizeof(__pyx_k_talib_func), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod, __pyx_k_timeperiod, sizeof(__pyx_k_timeperiod), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod1, __pyx_k_timeperiod1, sizeof(__pyx_k_timeperiod1), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod2, __pyx_k_timeperiod2, sizeof(__pyx_k_timeperiod2), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod3, __pyx_k_timeperiod3, sizeof(__pyx_k_timeperiod3), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, - {&__pyx_n_s_vfactor, __pyx_k_vfactor, sizeof(__pyx_k_vfactor), 0, 0, 1, 1}, - {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, - {&__pyx_n_s_volume_data, __pyx_k_volume_data, sizeof(__pyx_k_volume_data), 0, 0, 1, 1}, - {&__pyx_kp_s_volume_has_wrong_dimensions, __pyx_k_volume_has_wrong_dimensions, sizeof(__pyx_k_volume_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_volume_is_not_double, __pyx_k_volume_is_not_double, sizeof(__pyx_k_volume_is_not_double), 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "talib/func.pyx":45 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "talib/func.pyx":47 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "talib/func.pyx":60 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ACOS_Lookback( ) - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "talib/func.pyx":97 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "talib/func.pyx":99 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "talib/func.pyx":104 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - - /* "talib/func.pyx":106 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "talib/func.pyx":111 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - - /* "talib/func.pyx":113 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "talib/func.pyx":118 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "talib/func.pyx":120 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "talib/func.pyx":126 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "talib/func.pyx":128 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - - /* "talib/func.pyx":130 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "talib/func.pyx":148 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AD_Lookback( ) - */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "talib/func.pyx":184 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "talib/func.pyx":186 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "talib/func.pyx":191 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "talib/func.pyx":193 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "talib/func.pyx":199 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - - /* "talib/func.pyx":211 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADD_Lookback( ) - */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - - /* "talib/func.pyx":251 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - - /* "talib/func.pyx":253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "talib/func.pyx":258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - - /* "talib/func.pyx":260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - - /* "talib/func.pyx":265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "talib/func.pyx":267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "talib/func.pyx":272 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "talib/func.pyx":274 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - - /* "talib/func.pyx":280 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - - /* "talib/func.pyx":282 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - - /* "talib/func.pyx":284 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - - /* "talib/func.pyx":302 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADOSC_Lookback( fastperiod , slowperiod ) - */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - - /* "talib/func.pyx":340 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - - /* "talib/func.pyx":342 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - - /* "talib/func.pyx":347 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - - /* "talib/func.pyx":349 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - - /* "talib/func.pyx":354 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - - /* "talib/func.pyx":356 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - - /* "talib/func.pyx":362 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - - /* "talib/func.pyx":364 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "talib/func.pyx":379 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADX_Lookback( timeperiod ) - */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - - /* "talib/func.pyx":417 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - - /* "talib/func.pyx":419 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - - /* "talib/func.pyx":424 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - - /* "talib/func.pyx":426 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - - /* "talib/func.pyx":431 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - - /* "talib/func.pyx":433 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - - /* "talib/func.pyx":439 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - - /* "talib/func.pyx":441 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - - /* "talib/func.pyx":456 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ADXR_Lookback( timeperiod ) - */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - - /* "talib/func.pyx":494 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - - /* "talib/func.pyx":496 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - - /* "talib/func.pyx":509 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_APO_Lookback( fastperiod , slowperiod , matype ) - */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - - /* "talib/func.pyx":549 - * double* outaroonup_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - - /* "talib/func.pyx":551 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - - /* "talib/func.pyx":556 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - - /* "talib/func.pyx":558 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - - /* "talib/func.pyx":564 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - - /* "talib/func.pyx":576 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROON_Lookback( timeperiod ) - */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - - /* "talib/func.pyx":617 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - - /* "talib/func.pyx":619 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - - /* "talib/func.pyx":624 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - - /* "talib/func.pyx":626 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - - /* "talib/func.pyx":632 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - - /* "talib/func.pyx":644 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AROONOSC_Lookback( timeperiod ) - */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - - /* "talib/func.pyx":678 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - - /* "talib/func.pyx":680 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - - /* "talib/func.pyx":693 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ASIN_Lookback( ) - */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - - /* "talib/func.pyx":727 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - - /* "talib/func.pyx":729 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - - /* "talib/func.pyx":742 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATAN_Lookback( ) - */ - __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - - /* "talib/func.pyx":780 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - - /* "talib/func.pyx":782 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - - /* "talib/func.pyx":787 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - - /* "talib/func.pyx":789 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - - /* "talib/func.pyx":794 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - - /* "talib/func.pyx":796 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - - /* "talib/func.pyx":802 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - - /* "talib/func.pyx":804 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - - /* "talib/func.pyx":819 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ATR_Lookback( timeperiod ) - */ - __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - - /* "talib/func.pyx":856 - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); - - /* "talib/func.pyx":858 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - - /* "talib/func.pyx":863 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); - - /* "talib/func.pyx":865 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - - /* "talib/func.pyx":870 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); - - /* "talib/func.pyx":872 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - - /* "talib/func.pyx":877 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - - /* "talib/func.pyx":879 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__89); - __Pyx_GIVEREF(__pyx_tuple__89); - - /* "talib/func.pyx":885 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); - - /* "talib/func.pyx":887 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); - - /* "talib/func.pyx":889 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - - /* "talib/func.pyx":907 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_AVGPRICE_Lookback( ) - */ - __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); - - /* "talib/func.pyx":952 - * double* outreallowerband_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - - /* "talib/func.pyx":954 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__95); - __Pyx_GIVEREF(__pyx_tuple__95); - - /* "talib/func.pyx":967 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BBANDS_Lookback( timeperiod , nbdevup , nbdevdn , matype ) - */ - __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - - /* "talib/func.pyx":1013 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__97); - __Pyx_GIVEREF(__pyx_tuple__97); - - /* "talib/func.pyx":1015 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - - /* "talib/func.pyx":1020 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__99); - __Pyx_GIVEREF(__pyx_tuple__99); - - /* "talib/func.pyx":1022 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - - /* "talib/func.pyx":1028 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__101); - __Pyx_GIVEREF(__pyx_tuple__101); - - /* "talib/func.pyx":1040 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BETA_Lookback( timeperiod ) - */ - __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - - /* "talib/func.pyx":1077 - * double* outreal_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__103); - __Pyx_GIVEREF(__pyx_tuple__103); - - /* "talib/func.pyx":1079 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - - /* "talib/func.pyx":1084 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__105); - __Pyx_GIVEREF(__pyx_tuple__105); - - /* "talib/func.pyx":1086 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - - /* "talib/func.pyx":1091 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 1091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__107); - __Pyx_GIVEREF(__pyx_tuple__107); - - /* "talib/func.pyx":1093 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - - /* "talib/func.pyx":1098 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 1098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__109); - __Pyx_GIVEREF(__pyx_tuple__109); - - /* "talib/func.pyx":1100 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - - /* "talib/func.pyx":1106 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__111); - __Pyx_GIVEREF(__pyx_tuple__111); - - /* "talib/func.pyx":1108 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - - /* "talib/func.pyx":1110 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 1110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__113); - __Pyx_GIVEREF(__pyx_tuple__113); - - /* "talib/func.pyx":1128 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_BOP_Lookback( ) - */ - __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - - /* "talib/func.pyx":1166 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__115); - __Pyx_GIVEREF(__pyx_tuple__115); - - /* "talib/func.pyx":1168 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - - /* "talib/func.pyx":1173 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__117); - __Pyx_GIVEREF(__pyx_tuple__117); - - /* "talib/func.pyx":1175 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - - /* "talib/func.pyx":1180 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__119); - __Pyx_GIVEREF(__pyx_tuple__119); - - /* "talib/func.pyx":1182 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - - /* "talib/func.pyx":1188 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__121); - __Pyx_GIVEREF(__pyx_tuple__121); - - /* "talib/func.pyx":1190 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - - /* "talib/func.pyx":1205 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CCI_Lookback( timeperiod ) - */ - __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__123); - __Pyx_GIVEREF(__pyx_tuple__123); - - /* "talib/func.pyx":1242 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - - /* "talib/func.pyx":1244 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - - /* "talib/func.pyx":1249 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__126); - __Pyx_GIVEREF(__pyx_tuple__126); - - /* "talib/func.pyx":1251 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__127); - __Pyx_GIVEREF(__pyx_tuple__127); - - /* "talib/func.pyx":1256 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__128); - __Pyx_GIVEREF(__pyx_tuple__128); - - /* "talib/func.pyx":1258 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - - /* "talib/func.pyx":1263 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__130); - __Pyx_GIVEREF(__pyx_tuple__130); - - /* "talib/func.pyx":1265 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__131); - __Pyx_GIVEREF(__pyx_tuple__131); - - /* "talib/func.pyx":1271 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__132); - __Pyx_GIVEREF(__pyx_tuple__132); - - /* "talib/func.pyx":1273 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__133); - __Pyx_GIVEREF(__pyx_tuple__133); - - /* "talib/func.pyx":1275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__134); - __Pyx_GIVEREF(__pyx_tuple__134); - - /* "talib/func.pyx":1293 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL2CROWS_Lookback( ) - */ - __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__135); - __Pyx_GIVEREF(__pyx_tuple__135); - - /* "talib/func.pyx":1330 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__136); - __Pyx_GIVEREF(__pyx_tuple__136); - - /* "talib/func.pyx":1332 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__137); - __Pyx_GIVEREF(__pyx_tuple__137); - - /* "talib/func.pyx":1337 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__138); - __Pyx_GIVEREF(__pyx_tuple__138); - - /* "talib/func.pyx":1339 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 1339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__139); - __Pyx_GIVEREF(__pyx_tuple__139); - - /* "talib/func.pyx":1344 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 1344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__140); - __Pyx_GIVEREF(__pyx_tuple__140); - - /* "talib/func.pyx":1346 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__141); - __Pyx_GIVEREF(__pyx_tuple__141); - - /* "talib/func.pyx":1351 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__142); - __Pyx_GIVEREF(__pyx_tuple__142); - - /* "talib/func.pyx":1353 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__143); - __Pyx_GIVEREF(__pyx_tuple__143); - - /* "talib/func.pyx":1359 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__144); - __Pyx_GIVEREF(__pyx_tuple__144); - - /* "talib/func.pyx":1361 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__145); - __Pyx_GIVEREF(__pyx_tuple__145); - - /* "talib/func.pyx":1363 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__146); - __Pyx_GIVEREF(__pyx_tuple__146); - - /* "talib/func.pyx":1381 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3BLACKCROWS_Lookback( ) - */ - __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__147); - __Pyx_GIVEREF(__pyx_tuple__147); - - /* "talib/func.pyx":1418 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__148); - __Pyx_GIVEREF(__pyx_tuple__148); - - /* "talib/func.pyx":1420 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__149 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__149); - __Pyx_GIVEREF(__pyx_tuple__149); - - /* "talib/func.pyx":1425 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 1425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__150); - __Pyx_GIVEREF(__pyx_tuple__150); - - /* "talib/func.pyx":1427 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__151); - __Pyx_GIVEREF(__pyx_tuple__151); - - /* "talib/func.pyx":1432 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 1432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__152); - __Pyx_GIVEREF(__pyx_tuple__152); - - /* "talib/func.pyx":1434 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__153); - __Pyx_GIVEREF(__pyx_tuple__153); - - /* "talib/func.pyx":1439 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__154); - __Pyx_GIVEREF(__pyx_tuple__154); - - /* "talib/func.pyx":1441 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__155); - __Pyx_GIVEREF(__pyx_tuple__155); - - /* "talib/func.pyx":1447 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__156); - __Pyx_GIVEREF(__pyx_tuple__156); - - /* "talib/func.pyx":1449 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__157); - __Pyx_GIVEREF(__pyx_tuple__157); - - /* "talib/func.pyx":1451 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 1451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__158); - __Pyx_GIVEREF(__pyx_tuple__158); - - /* "talib/func.pyx":1469 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3INSIDE_Lookback( ) - */ - __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__159); - __Pyx_GIVEREF(__pyx_tuple__159); - - /* "talib/func.pyx":1506 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__160 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__160); - __Pyx_GIVEREF(__pyx_tuple__160); - - /* "talib/func.pyx":1508 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__161); - __Pyx_GIVEREF(__pyx_tuple__161); - - /* "talib/func.pyx":1513 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__162); - __Pyx_GIVEREF(__pyx_tuple__162); - - /* "talib/func.pyx":1515 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__163); - __Pyx_GIVEREF(__pyx_tuple__163); - - /* "talib/func.pyx":1520 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__164); - __Pyx_GIVEREF(__pyx_tuple__164); - - /* "talib/func.pyx":1522 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__165); - __Pyx_GIVEREF(__pyx_tuple__165); - - /* "talib/func.pyx":1527 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__166); - __Pyx_GIVEREF(__pyx_tuple__166); - - /* "talib/func.pyx":1529 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 1529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__167); - __Pyx_GIVEREF(__pyx_tuple__167); - - /* "talib/func.pyx":1535 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__168); - __Pyx_GIVEREF(__pyx_tuple__168); - - /* "talib/func.pyx":1537 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__169 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__169); - __Pyx_GIVEREF(__pyx_tuple__169); - - /* "talib/func.pyx":1539 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__170); - __Pyx_GIVEREF(__pyx_tuple__170); - - /* "talib/func.pyx":1557 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3LINESTRIKE_Lookback( ) - */ - __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 1557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__171); - __Pyx_GIVEREF(__pyx_tuple__171); - - /* "talib/func.pyx":1594 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 1594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__172); - __Pyx_GIVEREF(__pyx_tuple__172); - - /* "talib/func.pyx":1596 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__173); - __Pyx_GIVEREF(__pyx_tuple__173); - - /* "talib/func.pyx":1601 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 1601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__174); - __Pyx_GIVEREF(__pyx_tuple__174); - - /* "talib/func.pyx":1603 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__175); - __Pyx_GIVEREF(__pyx_tuple__175); - - /* "talib/func.pyx":1608 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 1608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__176); - __Pyx_GIVEREF(__pyx_tuple__176); - - /* "talib/func.pyx":1610 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__177); - __Pyx_GIVEREF(__pyx_tuple__177); - - /* "talib/func.pyx":1615 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__178); - __Pyx_GIVEREF(__pyx_tuple__178); - - /* "talib/func.pyx":1617 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__179); - __Pyx_GIVEREF(__pyx_tuple__179); - - /* "talib/func.pyx":1623 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 1623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__180); - __Pyx_GIVEREF(__pyx_tuple__180); - - /* "talib/func.pyx":1625 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__181 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__181); - __Pyx_GIVEREF(__pyx_tuple__181); - - /* "talib/func.pyx":1627 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 1627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__182); - __Pyx_GIVEREF(__pyx_tuple__182); - - /* "talib/func.pyx":1645 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3OUTSIDE_Lookback( ) - */ - __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__183); - __Pyx_GIVEREF(__pyx_tuple__183); - - /* "talib/func.pyx":1682 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 1682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__184); - __Pyx_GIVEREF(__pyx_tuple__184); - - /* "talib/func.pyx":1684 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 1684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__185); - __Pyx_GIVEREF(__pyx_tuple__185); - - /* "talib/func.pyx":1689 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 1689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__186); - __Pyx_GIVEREF(__pyx_tuple__186); - - /* "talib/func.pyx":1691 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 1691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__187); - __Pyx_GIVEREF(__pyx_tuple__187); - - /* "talib/func.pyx":1696 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 1696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__188); - __Pyx_GIVEREF(__pyx_tuple__188); - - /* "talib/func.pyx":1698 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 1698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__189); - __Pyx_GIVEREF(__pyx_tuple__189); - - /* "talib/func.pyx":1703 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__190 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 1703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__190); - __Pyx_GIVEREF(__pyx_tuple__190); - - /* "talib/func.pyx":1705 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__191); - __Pyx_GIVEREF(__pyx_tuple__191); - - /* "talib/func.pyx":1711 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__192); - __Pyx_GIVEREF(__pyx_tuple__192); - - /* "talib/func.pyx":1713 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__193); - __Pyx_GIVEREF(__pyx_tuple__193); - - /* "talib/func.pyx":1715 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 1715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__194); - __Pyx_GIVEREF(__pyx_tuple__194); - - /* "talib/func.pyx":1733 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3STARSINSOUTH_Lookback( ) - */ - __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 1733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__195); - __Pyx_GIVEREF(__pyx_tuple__195); - - /* "talib/func.pyx":1770 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 1770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__196); - __Pyx_GIVEREF(__pyx_tuple__196); - - /* "talib/func.pyx":1772 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__197); - __Pyx_GIVEREF(__pyx_tuple__197); - - /* "talib/func.pyx":1777 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 1777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__198); - __Pyx_GIVEREF(__pyx_tuple__198); - - /* "talib/func.pyx":1779 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__199); - __Pyx_GIVEREF(__pyx_tuple__199); - - /* "talib/func.pyx":1784 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 1784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__200); - __Pyx_GIVEREF(__pyx_tuple__200); - - /* "talib/func.pyx":1786 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__201); - __Pyx_GIVEREF(__pyx_tuple__201); - - /* "talib/func.pyx":1791 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 1791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__202); - __Pyx_GIVEREF(__pyx_tuple__202); - - /* "talib/func.pyx":1793 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 1793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__203); - __Pyx_GIVEREF(__pyx_tuple__203); - - /* "talib/func.pyx":1799 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__204); - __Pyx_GIVEREF(__pyx_tuple__204); - - /* "talib/func.pyx":1801 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 1801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__205); - __Pyx_GIVEREF(__pyx_tuple__205); - - /* "talib/func.pyx":1803 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 1803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__206); - __Pyx_GIVEREF(__pyx_tuple__206); - - /* "talib/func.pyx":1821 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDL3WHITESOLDIERS_Lookback( ) - */ - __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__207); - __Pyx_GIVEREF(__pyx_tuple__207); - - /* "talib/func.pyx":1860 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 1860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__208); - __Pyx_GIVEREF(__pyx_tuple__208); - - /* "talib/func.pyx":1862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 1862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__209); - __Pyx_GIVEREF(__pyx_tuple__209); - - /* "talib/func.pyx":1867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 1867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__210); - __Pyx_GIVEREF(__pyx_tuple__210); - - /* "talib/func.pyx":1869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 1869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__211); - __Pyx_GIVEREF(__pyx_tuple__211); - - /* "talib/func.pyx":1874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__212); - __Pyx_GIVEREF(__pyx_tuple__212); - - /* "talib/func.pyx":1876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__213); - __Pyx_GIVEREF(__pyx_tuple__213); - - /* "talib/func.pyx":1881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__214); - __Pyx_GIVEREF(__pyx_tuple__214); - - /* "talib/func.pyx":1883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 1883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__215); - __Pyx_GIVEREF(__pyx_tuple__215); - - /* "talib/func.pyx":1889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__216); - __Pyx_GIVEREF(__pyx_tuple__216); - - /* "talib/func.pyx":1891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 1891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__217); - __Pyx_GIVEREF(__pyx_tuple__217); - - /* "talib/func.pyx":1893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__218); - __Pyx_GIVEREF(__pyx_tuple__218); - - /* "talib/func.pyx":1911 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLABANDONEDBABY_Lookback( penetration ) - */ - __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 1911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__219); - __Pyx_GIVEREF(__pyx_tuple__219); - - /* "talib/func.pyx":1948 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__220); - __Pyx_GIVEREF(__pyx_tuple__220); - - /* "talib/func.pyx":1950 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 1950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__221); - __Pyx_GIVEREF(__pyx_tuple__221); - - /* "talib/func.pyx":1955 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__222); - __Pyx_GIVEREF(__pyx_tuple__222); - - /* "talib/func.pyx":1957 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 1957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__223); - __Pyx_GIVEREF(__pyx_tuple__223); - - /* "talib/func.pyx":1962 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__224); - __Pyx_GIVEREF(__pyx_tuple__224); - - /* "talib/func.pyx":1964 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 1964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__225); - __Pyx_GIVEREF(__pyx_tuple__225); - - /* "talib/func.pyx":1969 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__226); - __Pyx_GIVEREF(__pyx_tuple__226); - - /* "talib/func.pyx":1971 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__227); - __Pyx_GIVEREF(__pyx_tuple__227); - - /* "talib/func.pyx":1977 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__228); - __Pyx_GIVEREF(__pyx_tuple__228); - - /* "talib/func.pyx":1979 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__229 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__229); - __Pyx_GIVEREF(__pyx_tuple__229); - - /* "talib/func.pyx":1981 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__230 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__230); - __Pyx_GIVEREF(__pyx_tuple__230); - - /* "talib/func.pyx":1999 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLADVANCEBLOCK_Lookback( ) - */ - __pyx_tuple__231 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__231); - __Pyx_GIVEREF(__pyx_tuple__231); - - /* "talib/func.pyx":2036 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 2036, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__232); - __Pyx_GIVEREF(__pyx_tuple__232); - - /* "talib/func.pyx":2038 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 2038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__233); - __Pyx_GIVEREF(__pyx_tuple__233); - - /* "talib/func.pyx":2043 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__234 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 2043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__234); - __Pyx_GIVEREF(__pyx_tuple__234); - - /* "talib/func.pyx":2045 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__235 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 2045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__235); - __Pyx_GIVEREF(__pyx_tuple__235); - - /* "talib/func.pyx":2050 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__236 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 2050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__236); - __Pyx_GIVEREF(__pyx_tuple__236); - - /* "talib/func.pyx":2052 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__237 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 2052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__237); - __Pyx_GIVEREF(__pyx_tuple__237); - - /* "talib/func.pyx":2057 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__238 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 2057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__238); - __Pyx_GIVEREF(__pyx_tuple__238); - - /* "talib/func.pyx":2059 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__239 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 2059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__239); - __Pyx_GIVEREF(__pyx_tuple__239); - - /* "talib/func.pyx":2065 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__240 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__240); - __Pyx_GIVEREF(__pyx_tuple__240); - - /* "talib/func.pyx":2067 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__241 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__241); - __Pyx_GIVEREF(__pyx_tuple__241); - - /* "talib/func.pyx":2069 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__242 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 2069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__242); - __Pyx_GIVEREF(__pyx_tuple__242); - - /* "talib/func.pyx":2087 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBELTHOLD_Lookback( ) - */ - __pyx_tuple__243 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 2087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__243); - __Pyx_GIVEREF(__pyx_tuple__243); - - /* "talib/func.pyx":2124 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__244 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 2124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__244); - __Pyx_GIVEREF(__pyx_tuple__244); - - /* "talib/func.pyx":2126 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__245 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 2126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__245); - __Pyx_GIVEREF(__pyx_tuple__245); - - /* "talib/func.pyx":2131 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__246 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 2131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__246); - __Pyx_GIVEREF(__pyx_tuple__246); - - /* "talib/func.pyx":2133 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__247 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 2133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__247); - __Pyx_GIVEREF(__pyx_tuple__247); - - /* "talib/func.pyx":2138 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__248 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 2138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__248); - __Pyx_GIVEREF(__pyx_tuple__248); - - /* "talib/func.pyx":2140 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__249 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 2140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__249); - __Pyx_GIVEREF(__pyx_tuple__249); - - /* "talib/func.pyx":2145 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__250 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 2145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__250); - __Pyx_GIVEREF(__pyx_tuple__250); - - /* "talib/func.pyx":2147 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__251 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__251); - __Pyx_GIVEREF(__pyx_tuple__251); - - /* "talib/func.pyx":2153 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__252 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 2153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__252); - __Pyx_GIVEREF(__pyx_tuple__252); - - /* "talib/func.pyx":2155 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__253 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 2155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__253); - __Pyx_GIVEREF(__pyx_tuple__253); - - /* "talib/func.pyx":2157 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 2157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__254); - __Pyx_GIVEREF(__pyx_tuple__254); - - /* "talib/func.pyx":2175 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLBREAKAWAY_Lookback( ) - */ - __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 2175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__255); - __Pyx_GIVEREF(__pyx_tuple__255); - - /* "talib/func.pyx":2212 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 2212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__256); - __Pyx_GIVEREF(__pyx_tuple__256); - - /* "talib/func.pyx":2214 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 2214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__257); - __Pyx_GIVEREF(__pyx_tuple__257); - - /* "talib/func.pyx":2219 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__258); - __Pyx_GIVEREF(__pyx_tuple__258); - - /* "talib/func.pyx":2221 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 2221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__259); - __Pyx_GIVEREF(__pyx_tuple__259); - - /* "talib/func.pyx":2226 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 2226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__260); - __Pyx_GIVEREF(__pyx_tuple__260); - - /* "talib/func.pyx":2228 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 2228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__261); - __Pyx_GIVEREF(__pyx_tuple__261); - - /* "talib/func.pyx":2233 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 2233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__262); - __Pyx_GIVEREF(__pyx_tuple__262); - - /* "talib/func.pyx":2235 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 2235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__263); - __Pyx_GIVEREF(__pyx_tuple__263); - - /* "talib/func.pyx":2241 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 2241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__264); - __Pyx_GIVEREF(__pyx_tuple__264); - - /* "talib/func.pyx":2243 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__265 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 2243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__265); - __Pyx_GIVEREF(__pyx_tuple__265); - - /* "talib/func.pyx":2245 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__266 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 2245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__266); - __Pyx_GIVEREF(__pyx_tuple__266); - - /* "talib/func.pyx":2263 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCLOSINGMARUBOZU_Lookback( ) - */ - __pyx_tuple__267 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 2263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__267); - __Pyx_GIVEREF(__pyx_tuple__267); - - /* "talib/func.pyx":2300 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__268 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 2300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__268); - __Pyx_GIVEREF(__pyx_tuple__268); - - /* "talib/func.pyx":2302 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__269 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 2302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__269); - __Pyx_GIVEREF(__pyx_tuple__269); - - /* "talib/func.pyx":2307 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__270 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 2307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__270); - __Pyx_GIVEREF(__pyx_tuple__270); - - /* "talib/func.pyx":2309 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__271 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 2309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__271); - __Pyx_GIVEREF(__pyx_tuple__271); - - /* "talib/func.pyx":2314 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__272 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 2314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__272); - __Pyx_GIVEREF(__pyx_tuple__272); - - /* "talib/func.pyx":2316 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__273 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 2316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__273); - __Pyx_GIVEREF(__pyx_tuple__273); - - /* "talib/func.pyx":2321 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__274 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 2321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__274); - __Pyx_GIVEREF(__pyx_tuple__274); - - /* "talib/func.pyx":2323 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__275 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 2323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__275); - __Pyx_GIVEREF(__pyx_tuple__275); - - /* "talib/func.pyx":2329 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__276 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 2329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__276); - __Pyx_GIVEREF(__pyx_tuple__276); - - /* "talib/func.pyx":2331 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__277 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 2331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__277); - __Pyx_GIVEREF(__pyx_tuple__277); - - /* "talib/func.pyx":2333 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__278 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 2333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__278); - __Pyx_GIVEREF(__pyx_tuple__278); - - /* "talib/func.pyx":2351 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCONCEALBABYSWALL_Lookback( ) - */ - __pyx_tuple__279 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__279); - __Pyx_GIVEREF(__pyx_tuple__279); - - /* "talib/func.pyx":2388 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__280 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 2388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__280); - __Pyx_GIVEREF(__pyx_tuple__280); - - /* "talib/func.pyx":2390 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__281 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__281); - __Pyx_GIVEREF(__pyx_tuple__281); - - /* "talib/func.pyx":2395 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__282 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 2395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__282); - __Pyx_GIVEREF(__pyx_tuple__282); - - /* "talib/func.pyx":2397 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__283 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 2397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__283); - __Pyx_GIVEREF(__pyx_tuple__283); - - /* "talib/func.pyx":2402 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__284 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 2402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__284); - __Pyx_GIVEREF(__pyx_tuple__284); - - /* "talib/func.pyx":2404 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__285 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 2404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__285); - __Pyx_GIVEREF(__pyx_tuple__285); - - /* "talib/func.pyx":2409 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__286 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__286); - __Pyx_GIVEREF(__pyx_tuple__286); - - /* "talib/func.pyx":2411 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__287 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 2411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__287); - __Pyx_GIVEREF(__pyx_tuple__287); - - /* "talib/func.pyx":2417 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__288 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 2417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__288); - __Pyx_GIVEREF(__pyx_tuple__288); - - /* "talib/func.pyx":2419 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__289 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 2419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__289); - __Pyx_GIVEREF(__pyx_tuple__289); - - /* "talib/func.pyx":2421 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__290 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 2421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__290); - __Pyx_GIVEREF(__pyx_tuple__290); - - /* "talib/func.pyx":2439 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLCOUNTERATTACK_Lookback( ) - */ - __pyx_tuple__291 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__291); - __Pyx_GIVEREF(__pyx_tuple__291); - - /* "talib/func.pyx":2478 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__292 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__292); - __Pyx_GIVEREF(__pyx_tuple__292); - - /* "talib/func.pyx":2480 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__293 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__293); - __Pyx_GIVEREF(__pyx_tuple__293); - - /* "talib/func.pyx":2485 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__294 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 2485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__294); - __Pyx_GIVEREF(__pyx_tuple__294); - - /* "talib/func.pyx":2487 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__295 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 2487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__295); - __Pyx_GIVEREF(__pyx_tuple__295); - - /* "talib/func.pyx":2492 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__296 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__296); - __Pyx_GIVEREF(__pyx_tuple__296); - - /* "talib/func.pyx":2494 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__297 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 2494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__297); - __Pyx_GIVEREF(__pyx_tuple__297); - - /* "talib/func.pyx":2499 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__298 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__298); - __Pyx_GIVEREF(__pyx_tuple__298); - - /* "talib/func.pyx":2501 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__299 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 2501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__299); - __Pyx_GIVEREF(__pyx_tuple__299); - - /* "talib/func.pyx":2507 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__300 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__300); - __Pyx_GIVEREF(__pyx_tuple__300); - - /* "talib/func.pyx":2509 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__301 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__301); - __Pyx_GIVEREF(__pyx_tuple__301); - - /* "talib/func.pyx":2511 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__302 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__302); - __Pyx_GIVEREF(__pyx_tuple__302); - - /* "talib/func.pyx":2529 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDARKCLOUDCOVER_Lookback( penetration ) - */ - __pyx_tuple__303 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 2529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__303); - __Pyx_GIVEREF(__pyx_tuple__303); - - /* "talib/func.pyx":2566 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__304 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__304); - __Pyx_GIVEREF(__pyx_tuple__304); - - /* "talib/func.pyx":2568 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__305 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__305); - __Pyx_GIVEREF(__pyx_tuple__305); - - /* "talib/func.pyx":2573 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__306 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 2573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__306); - __Pyx_GIVEREF(__pyx_tuple__306); - - /* "talib/func.pyx":2575 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__307 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__307); - __Pyx_GIVEREF(__pyx_tuple__307); - - /* "talib/func.pyx":2580 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__308 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 2580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__308); - __Pyx_GIVEREF(__pyx_tuple__308); - - /* "talib/func.pyx":2582 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__309 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__309); - __Pyx_GIVEREF(__pyx_tuple__309); - - /* "talib/func.pyx":2587 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__310 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 2587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__310); - __Pyx_GIVEREF(__pyx_tuple__310); - - /* "talib/func.pyx":2589 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__311 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 2589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__311); - __Pyx_GIVEREF(__pyx_tuple__311); - - /* "talib/func.pyx":2595 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__312 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__312); - __Pyx_GIVEREF(__pyx_tuple__312); - - /* "talib/func.pyx":2597 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__313 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 2597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__313); - __Pyx_GIVEREF(__pyx_tuple__313); - - /* "talib/func.pyx":2599 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__314 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__314); - __Pyx_GIVEREF(__pyx_tuple__314); - - /* "talib/func.pyx":2617 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJI_Lookback( ) - */ - __pyx_tuple__315 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__315); - __Pyx_GIVEREF(__pyx_tuple__315); - - /* "talib/func.pyx":2654 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__316 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__316); - __Pyx_GIVEREF(__pyx_tuple__316); - - /* "talib/func.pyx":2656 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__317 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__317); - __Pyx_GIVEREF(__pyx_tuple__317); - - /* "talib/func.pyx":2661 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__318 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__318); - __Pyx_GIVEREF(__pyx_tuple__318); - - /* "talib/func.pyx":2663 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__319 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__319); - __Pyx_GIVEREF(__pyx_tuple__319); - - /* "talib/func.pyx":2668 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__320 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 2668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__320); - __Pyx_GIVEREF(__pyx_tuple__320); - - /* "talib/func.pyx":2670 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__321 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 2670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__321); - __Pyx_GIVEREF(__pyx_tuple__321); - - /* "talib/func.pyx":2675 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__322 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 2675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__322); - __Pyx_GIVEREF(__pyx_tuple__322); - - /* "talib/func.pyx":2677 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__323 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__323); - __Pyx_GIVEREF(__pyx_tuple__323); - - /* "talib/func.pyx":2683 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__324 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 2683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__324); - __Pyx_GIVEREF(__pyx_tuple__324); - - /* "talib/func.pyx":2685 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__325 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 2685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__325); - __Pyx_GIVEREF(__pyx_tuple__325); - - /* "talib/func.pyx":2687 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__326 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__326); - __Pyx_GIVEREF(__pyx_tuple__326); - - /* "talib/func.pyx":2705 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDOJISTAR_Lookback( ) - */ - __pyx_tuple__327 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__327); - __Pyx_GIVEREF(__pyx_tuple__327); - - /* "talib/func.pyx":2742 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__328 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__328); - __Pyx_GIVEREF(__pyx_tuple__328); - - /* "talib/func.pyx":2744 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__329 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 2744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__329); - __Pyx_GIVEREF(__pyx_tuple__329); - - /* "talib/func.pyx":2749 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__330 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__330); - __Pyx_GIVEREF(__pyx_tuple__330); - - /* "talib/func.pyx":2751 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__331 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 2751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__331); - __Pyx_GIVEREF(__pyx_tuple__331); - - /* "talib/func.pyx":2756 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__332 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__332); - __Pyx_GIVEREF(__pyx_tuple__332); - - /* "talib/func.pyx":2758 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__333 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 2758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__333); - __Pyx_GIVEREF(__pyx_tuple__333); - - /* "talib/func.pyx":2763 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__334 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__334); - __Pyx_GIVEREF(__pyx_tuple__334); - - /* "talib/func.pyx":2765 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__335 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 2765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__335); - __Pyx_GIVEREF(__pyx_tuple__335); - - /* "talib/func.pyx":2771 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__336 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 2771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__336); - __Pyx_GIVEREF(__pyx_tuple__336); - - /* "talib/func.pyx":2773 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__337 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__337); - __Pyx_GIVEREF(__pyx_tuple__337); - - /* "talib/func.pyx":2775 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__338 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__338); - __Pyx_GIVEREF(__pyx_tuple__338); - - /* "talib/func.pyx":2793 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLDRAGONFLYDOJI_Lookback( ) - */ - __pyx_tuple__339 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 2793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__339); - __Pyx_GIVEREF(__pyx_tuple__339); - - /* "talib/func.pyx":2830 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__340 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 2830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__340); - __Pyx_GIVEREF(__pyx_tuple__340); - - /* "talib/func.pyx":2832 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__341 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 2832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__341); - __Pyx_GIVEREF(__pyx_tuple__341); - - /* "talib/func.pyx":2837 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__342 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__342); - __Pyx_GIVEREF(__pyx_tuple__342); - - /* "talib/func.pyx":2839 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__343 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__343); - __Pyx_GIVEREF(__pyx_tuple__343); - - /* "talib/func.pyx":2844 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__344 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__344); - __Pyx_GIVEREF(__pyx_tuple__344); - - /* "talib/func.pyx":2846 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__345 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 2846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__345); - __Pyx_GIVEREF(__pyx_tuple__345); - - /* "talib/func.pyx":2851 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__346 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 2851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__346); - __Pyx_GIVEREF(__pyx_tuple__346); - - /* "talib/func.pyx":2853 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__347 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 2853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__347); - __Pyx_GIVEREF(__pyx_tuple__347); - - /* "talib/func.pyx":2859 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__348 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(0, 2859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__348); - __Pyx_GIVEREF(__pyx_tuple__348); - - /* "talib/func.pyx":2861 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__349 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__349); - __Pyx_GIVEREF(__pyx_tuple__349); - - /* "talib/func.pyx":2863 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__350 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__350); - __Pyx_GIVEREF(__pyx_tuple__350); - - /* "talib/func.pyx":2881 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLENGULFING_Lookback( ) - */ - __pyx_tuple__351 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__351); - __Pyx_GIVEREF(__pyx_tuple__351); - - /* "talib/func.pyx":2920 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__352 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 2920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__352); - __Pyx_GIVEREF(__pyx_tuple__352); - - /* "talib/func.pyx":2922 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__353 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 2922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__353); - __Pyx_GIVEREF(__pyx_tuple__353); - - /* "talib/func.pyx":2927 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__354 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 2927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__354); - __Pyx_GIVEREF(__pyx_tuple__354); - - /* "talib/func.pyx":2929 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__355 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 2929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__355); - __Pyx_GIVEREF(__pyx_tuple__355); - - /* "talib/func.pyx":2934 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__356 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 2934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__356); - __Pyx_GIVEREF(__pyx_tuple__356); - - /* "talib/func.pyx":2936 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__357 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 2936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__357); - __Pyx_GIVEREF(__pyx_tuple__357); - - /* "talib/func.pyx":2941 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__358 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 2941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__358); - __Pyx_GIVEREF(__pyx_tuple__358); - - /* "talib/func.pyx":2943 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__359 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 2943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__359); - __Pyx_GIVEREF(__pyx_tuple__359); - - /* "talib/func.pyx":2949 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__360 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__360); - __Pyx_GIVEREF(__pyx_tuple__360); - - /* "talib/func.pyx":2951 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__361 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 2951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__361); - __Pyx_GIVEREF(__pyx_tuple__361); - - /* "talib/func.pyx":2953 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__362 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__362); - __Pyx_GIVEREF(__pyx_tuple__362); - - /* "talib/func.pyx":2971 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGDOJISTAR_Lookback( penetration ) - */ - __pyx_tuple__363 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 2971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__363); - __Pyx_GIVEREF(__pyx_tuple__363); - - /* "talib/func.pyx":3010 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__364 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(0, 3010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__364); - __Pyx_GIVEREF(__pyx_tuple__364); - - /* "talib/func.pyx":3012 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__365 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 3012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__365); - __Pyx_GIVEREF(__pyx_tuple__365); - - /* "talib/func.pyx":3017 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__366 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(0, 3017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__366); - __Pyx_GIVEREF(__pyx_tuple__366); - - /* "talib/func.pyx":3019 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__367 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 3019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__367); - __Pyx_GIVEREF(__pyx_tuple__367); - - /* "talib/func.pyx":3024 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__368 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(0, 3024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__368); - __Pyx_GIVEREF(__pyx_tuple__368); - - /* "talib/func.pyx":3026 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__369 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 3026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__369); - __Pyx_GIVEREF(__pyx_tuple__369); - - /* "talib/func.pyx":3031 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__370 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__370); - __Pyx_GIVEREF(__pyx_tuple__370); - - /* "talib/func.pyx":3033 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__371 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__371); - __Pyx_GIVEREF(__pyx_tuple__371); - - /* "talib/func.pyx":3039 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__372 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(0, 3039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__372); - __Pyx_GIVEREF(__pyx_tuple__372); - - /* "talib/func.pyx":3041 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__373 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__373); - __Pyx_GIVEREF(__pyx_tuple__373); - - /* "talib/func.pyx":3043 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__374 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(0, 3043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__374); - __Pyx_GIVEREF(__pyx_tuple__374); - - /* "talib/func.pyx":3061 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLEVENINGSTAR_Lookback( penetration ) - */ - __pyx_tuple__375 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 3061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__375); - __Pyx_GIVEREF(__pyx_tuple__375); - - /* "talib/func.pyx":3098 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__376 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 3098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__376); - __Pyx_GIVEREF(__pyx_tuple__376); - - /* "talib/func.pyx":3100 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__377 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 3100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__377); - __Pyx_GIVEREF(__pyx_tuple__377); - - /* "talib/func.pyx":3105 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__378 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 3105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__378); - __Pyx_GIVEREF(__pyx_tuple__378); - - /* "talib/func.pyx":3107 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__379 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__379); - __Pyx_GIVEREF(__pyx_tuple__379); - - /* "talib/func.pyx":3112 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__380 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 3112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__380); - __Pyx_GIVEREF(__pyx_tuple__380); - - /* "talib/func.pyx":3114 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__381 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 3114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__381); - __Pyx_GIVEREF(__pyx_tuple__381); - - /* "talib/func.pyx":3119 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__382 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(0, 3119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__382); - __Pyx_GIVEREF(__pyx_tuple__382); - - /* "talib/func.pyx":3121 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__383 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 3121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__383); - __Pyx_GIVEREF(__pyx_tuple__383); - - /* "talib/func.pyx":3127 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__384 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__384); - __Pyx_GIVEREF(__pyx_tuple__384); - - /* "talib/func.pyx":3129 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__385 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 3129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__385); - __Pyx_GIVEREF(__pyx_tuple__385); - - /* "talib/func.pyx":3131 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__386 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(0, 3131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__386); - __Pyx_GIVEREF(__pyx_tuple__386); - - /* "talib/func.pyx":3149 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGAPSIDESIDEWHITE_Lookback( ) - */ - __pyx_tuple__387 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 3149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__387); - __Pyx_GIVEREF(__pyx_tuple__387); - - /* "talib/func.pyx":3186 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__388 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__388); - __Pyx_GIVEREF(__pyx_tuple__388); - - /* "talib/func.pyx":3188 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__389 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 3188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__389); - __Pyx_GIVEREF(__pyx_tuple__389); - - /* "talib/func.pyx":3193 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__390 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(0, 3193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__390); - __Pyx_GIVEREF(__pyx_tuple__390); - - /* "talib/func.pyx":3195 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__391 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 3195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__391); - __Pyx_GIVEREF(__pyx_tuple__391); - - /* "talib/func.pyx":3200 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__392 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(0, 3200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__392); - __Pyx_GIVEREF(__pyx_tuple__392); - - /* "talib/func.pyx":3202 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__393 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(0, 3202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__393); - __Pyx_GIVEREF(__pyx_tuple__393); - - /* "talib/func.pyx":3207 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__394 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(0, 3207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__394); - __Pyx_GIVEREF(__pyx_tuple__394); - - /* "talib/func.pyx":3209 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__395 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 3209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__395); - __Pyx_GIVEREF(__pyx_tuple__395); - - /* "talib/func.pyx":3215 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__396 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(0, 3215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__396); - __Pyx_GIVEREF(__pyx_tuple__396); - - /* "talib/func.pyx":3217 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__397 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(0, 3217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__397); - __Pyx_GIVEREF(__pyx_tuple__397); - - /* "talib/func.pyx":3219 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__398 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(0, 3219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__398); - __Pyx_GIVEREF(__pyx_tuple__398); - - /* "talib/func.pyx":3237 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLGRAVESTONEDOJI_Lookback( ) - */ - __pyx_tuple__399 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(0, 3237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__399); - __Pyx_GIVEREF(__pyx_tuple__399); - - /* "talib/func.pyx":3274 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__400 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(0, 3274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__400); - __Pyx_GIVEREF(__pyx_tuple__400); - - /* "talib/func.pyx":3276 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__401 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(0, 3276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__401); - __Pyx_GIVEREF(__pyx_tuple__401); - - /* "talib/func.pyx":3281 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__402 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(0, 3281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__402); - __Pyx_GIVEREF(__pyx_tuple__402); - - /* "talib/func.pyx":3283 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__403 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(0, 3283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__403); - __Pyx_GIVEREF(__pyx_tuple__403); - - /* "talib/func.pyx":3288 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__404 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(0, 3288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__404); - __Pyx_GIVEREF(__pyx_tuple__404); - - /* "talib/func.pyx":3290 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__405 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(0, 3290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__405); - __Pyx_GIVEREF(__pyx_tuple__405); - - /* "talib/func.pyx":3295 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__406 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(0, 3295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__406); - __Pyx_GIVEREF(__pyx_tuple__406); - - /* "talib/func.pyx":3297 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__407 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(0, 3297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__407); - __Pyx_GIVEREF(__pyx_tuple__407); - - /* "talib/func.pyx":3303 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__408 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(0, 3303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__408); - __Pyx_GIVEREF(__pyx_tuple__408); - - /* "talib/func.pyx":3305 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__409 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(0, 3305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__409); - __Pyx_GIVEREF(__pyx_tuple__409); - - /* "talib/func.pyx":3307 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__410 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(0, 3307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__410); - __Pyx_GIVEREF(__pyx_tuple__410); - - /* "talib/func.pyx":3325 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHAMMER_Lookback( ) - */ - __pyx_tuple__411 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(0, 3325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__411); - __Pyx_GIVEREF(__pyx_tuple__411); - - /* "talib/func.pyx":3362 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__412 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(0, 3362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__412); - __Pyx_GIVEREF(__pyx_tuple__412); - - /* "talib/func.pyx":3364 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__413 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(0, 3364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__413); - __Pyx_GIVEREF(__pyx_tuple__413); - - /* "talib/func.pyx":3369 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__414 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(0, 3369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__414); - __Pyx_GIVEREF(__pyx_tuple__414); - - /* "talib/func.pyx":3371 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__415 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(0, 3371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__415); - __Pyx_GIVEREF(__pyx_tuple__415); - - /* "talib/func.pyx":3376 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__416 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(0, 3376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__416); - __Pyx_GIVEREF(__pyx_tuple__416); - - /* "talib/func.pyx":3378 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__417 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(0, 3378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__417); - __Pyx_GIVEREF(__pyx_tuple__417); - - /* "talib/func.pyx":3383 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__418 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(0, 3383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__418); - __Pyx_GIVEREF(__pyx_tuple__418); - - /* "talib/func.pyx":3385 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__419 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(0, 3385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__419); - __Pyx_GIVEREF(__pyx_tuple__419); - - /* "talib/func.pyx":3391 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__420 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(0, 3391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__420); - __Pyx_GIVEREF(__pyx_tuple__420); - - /* "talib/func.pyx":3393 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__421 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(0, 3393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__421); - __Pyx_GIVEREF(__pyx_tuple__421); - - /* "talib/func.pyx":3395 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__422 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(0, 3395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__422); - __Pyx_GIVEREF(__pyx_tuple__422); - - /* "talib/func.pyx":3413 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHANGINGMAN_Lookback( ) - */ - __pyx_tuple__423 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(0, 3413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__423); - __Pyx_GIVEREF(__pyx_tuple__423); - - /* "talib/func.pyx":3450 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__424 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(0, 3450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__424); - __Pyx_GIVEREF(__pyx_tuple__424); - - /* "talib/func.pyx":3452 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__425 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(0, 3452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__425); - __Pyx_GIVEREF(__pyx_tuple__425); - - /* "talib/func.pyx":3457 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__426 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(0, 3457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__426); - __Pyx_GIVEREF(__pyx_tuple__426); - - /* "talib/func.pyx":3459 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__427 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(0, 3459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__427); - __Pyx_GIVEREF(__pyx_tuple__427); - - /* "talib/func.pyx":3464 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__428 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(0, 3464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__428); - __Pyx_GIVEREF(__pyx_tuple__428); - - /* "talib/func.pyx":3466 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__429 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(0, 3466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__429); - __Pyx_GIVEREF(__pyx_tuple__429); - - /* "talib/func.pyx":3471 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__430 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(0, 3471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__430); - __Pyx_GIVEREF(__pyx_tuple__430); - - /* "talib/func.pyx":3473 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__431 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(0, 3473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__431); - __Pyx_GIVEREF(__pyx_tuple__431); - - /* "talib/func.pyx":3479 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__432 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(0, 3479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__432); - __Pyx_GIVEREF(__pyx_tuple__432); - - /* "talib/func.pyx":3481 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__433 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(0, 3481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__433); - __Pyx_GIVEREF(__pyx_tuple__433); - - /* "talib/func.pyx":3483 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__434 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(0, 3483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__434); - __Pyx_GIVEREF(__pyx_tuple__434); - - /* "talib/func.pyx":3501 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMI_Lookback( ) - */ - __pyx_tuple__435 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(0, 3501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__435); - __Pyx_GIVEREF(__pyx_tuple__435); - - /* "talib/func.pyx":3538 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__436 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(0, 3538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__436); - __Pyx_GIVEREF(__pyx_tuple__436); - - /* "talib/func.pyx":3540 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__437 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(0, 3540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__437); - __Pyx_GIVEREF(__pyx_tuple__437); - - /* "talib/func.pyx":3545 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__438 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(0, 3545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__438); - __Pyx_GIVEREF(__pyx_tuple__438); - - /* "talib/func.pyx":3547 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__439 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(0, 3547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__439); - __Pyx_GIVEREF(__pyx_tuple__439); - - /* "talib/func.pyx":3552 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__440 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(0, 3552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__440); - __Pyx_GIVEREF(__pyx_tuple__440); - - /* "talib/func.pyx":3554 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__441 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(0, 3554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__441); - __Pyx_GIVEREF(__pyx_tuple__441); - - /* "talib/func.pyx":3559 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__442 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(0, 3559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__442); - __Pyx_GIVEREF(__pyx_tuple__442); - - /* "talib/func.pyx":3561 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__443 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(0, 3561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__443); - __Pyx_GIVEREF(__pyx_tuple__443); - - /* "talib/func.pyx":3567 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__444 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(0, 3567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__444); - __Pyx_GIVEREF(__pyx_tuple__444); - - /* "talib/func.pyx":3569 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__445 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(0, 3569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__445); - __Pyx_GIVEREF(__pyx_tuple__445); - - /* "talib/func.pyx":3571 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__446 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(0, 3571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__446); - __Pyx_GIVEREF(__pyx_tuple__446); - - /* "talib/func.pyx":3589 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHARAMICROSS_Lookback( ) - */ - __pyx_tuple__447 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(0, 3589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__447); - __Pyx_GIVEREF(__pyx_tuple__447); - - /* "talib/func.pyx":3626 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__448 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(0, 3626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__448); - __Pyx_GIVEREF(__pyx_tuple__448); - - /* "talib/func.pyx":3628 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__449 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(0, 3628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__449); - __Pyx_GIVEREF(__pyx_tuple__449); - - /* "talib/func.pyx":3633 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__450 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(0, 3633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__450); - __Pyx_GIVEREF(__pyx_tuple__450); - - /* "talib/func.pyx":3635 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__451 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(0, 3635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__451); - __Pyx_GIVEREF(__pyx_tuple__451); - - /* "talib/func.pyx":3640 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__452 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(0, 3640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__452); - __Pyx_GIVEREF(__pyx_tuple__452); - - /* "talib/func.pyx":3642 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__453 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(0, 3642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__453); - __Pyx_GIVEREF(__pyx_tuple__453); - - /* "talib/func.pyx":3647 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__454 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(0, 3647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__454); - __Pyx_GIVEREF(__pyx_tuple__454); - - /* "talib/func.pyx":3649 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__455 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(0, 3649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__455); - __Pyx_GIVEREF(__pyx_tuple__455); - - /* "talib/func.pyx":3655 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__456 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(0, 3655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__456); - __Pyx_GIVEREF(__pyx_tuple__456); - - /* "talib/func.pyx":3657 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__457 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(0, 3657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__457); - __Pyx_GIVEREF(__pyx_tuple__457); - - /* "talib/func.pyx":3659 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__458 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(0, 3659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__458); - __Pyx_GIVEREF(__pyx_tuple__458); - - /* "talib/func.pyx":3677 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIGHWAVE_Lookback( ) - */ - __pyx_tuple__459 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(0, 3677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__459); - __Pyx_GIVEREF(__pyx_tuple__459); - - /* "talib/func.pyx":3714 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__460 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(0, 3714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__460); - __Pyx_GIVEREF(__pyx_tuple__460); - - /* "talib/func.pyx":3716 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__461 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(0, 3716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__461); - __Pyx_GIVEREF(__pyx_tuple__461); - - /* "talib/func.pyx":3721 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__462 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(0, 3721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__462); - __Pyx_GIVEREF(__pyx_tuple__462); - - /* "talib/func.pyx":3723 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__463 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(0, 3723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__463); - __Pyx_GIVEREF(__pyx_tuple__463); - - /* "talib/func.pyx":3728 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__464 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(0, 3728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__464); - __Pyx_GIVEREF(__pyx_tuple__464); - - /* "talib/func.pyx":3730 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__465 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(0, 3730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__465); - __Pyx_GIVEREF(__pyx_tuple__465); - - /* "talib/func.pyx":3735 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__466 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(0, 3735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__466); - __Pyx_GIVEREF(__pyx_tuple__466); - - /* "talib/func.pyx":3737 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__467 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(0, 3737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__467); - __Pyx_GIVEREF(__pyx_tuple__467); - - /* "talib/func.pyx":3743 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__468 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(0, 3743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__468); - __Pyx_GIVEREF(__pyx_tuple__468); - - /* "talib/func.pyx":3745 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__469 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(0, 3745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__469); - __Pyx_GIVEREF(__pyx_tuple__469); - - /* "talib/func.pyx":3747 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__470 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(0, 3747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__470); - __Pyx_GIVEREF(__pyx_tuple__470); - - /* "talib/func.pyx":3765 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKE_Lookback( ) - */ - __pyx_tuple__471 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(0, 3765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__471); - __Pyx_GIVEREF(__pyx_tuple__471); - - /* "talib/func.pyx":3802 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__472 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(0, 3802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__472); - __Pyx_GIVEREF(__pyx_tuple__472); - - /* "talib/func.pyx":3804 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__473 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(0, 3804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__473); - __Pyx_GIVEREF(__pyx_tuple__473); - - /* "talib/func.pyx":3809 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__474 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(0, 3809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__474); - __Pyx_GIVEREF(__pyx_tuple__474); - - /* "talib/func.pyx":3811 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__475 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(0, 3811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__475); - __Pyx_GIVEREF(__pyx_tuple__475); - - /* "talib/func.pyx":3816 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__476 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(0, 3816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__476); - __Pyx_GIVEREF(__pyx_tuple__476); - - /* "talib/func.pyx":3818 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__477 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(0, 3818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__477); - __Pyx_GIVEREF(__pyx_tuple__477); - - /* "talib/func.pyx":3823 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__478 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(0, 3823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__478); - __Pyx_GIVEREF(__pyx_tuple__478); - - /* "talib/func.pyx":3825 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__479 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(0, 3825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__479); - __Pyx_GIVEREF(__pyx_tuple__479); - - /* "talib/func.pyx":3831 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__480 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(0, 3831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__480); - __Pyx_GIVEREF(__pyx_tuple__480); - - /* "talib/func.pyx":3833 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__481 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(0, 3833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__481); - __Pyx_GIVEREF(__pyx_tuple__481); - - /* "talib/func.pyx":3835 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__482 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(0, 3835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__482); - __Pyx_GIVEREF(__pyx_tuple__482); - - /* "talib/func.pyx":3853 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHIKKAKEMOD_Lookback( ) - */ - __pyx_tuple__483 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(0, 3853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__483); - __Pyx_GIVEREF(__pyx_tuple__483); - - /* "talib/func.pyx":3890 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__484 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(0, 3890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__484); - __Pyx_GIVEREF(__pyx_tuple__484); - - /* "talib/func.pyx":3892 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__485 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(0, 3892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__485); - __Pyx_GIVEREF(__pyx_tuple__485); - - /* "talib/func.pyx":3897 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__486 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(0, 3897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__486); - __Pyx_GIVEREF(__pyx_tuple__486); - - /* "talib/func.pyx":3899 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__487 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(0, 3899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__487); - __Pyx_GIVEREF(__pyx_tuple__487); - - /* "talib/func.pyx":3904 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__488 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(0, 3904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__488); - __Pyx_GIVEREF(__pyx_tuple__488); - - /* "talib/func.pyx":3906 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__489 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(0, 3906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__489); - __Pyx_GIVEREF(__pyx_tuple__489); - - /* "talib/func.pyx":3911 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__490 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(0, 3911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__490); - __Pyx_GIVEREF(__pyx_tuple__490); - - /* "talib/func.pyx":3913 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__491 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(0, 3913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__491); - __Pyx_GIVEREF(__pyx_tuple__491); - - /* "talib/func.pyx":3919 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__492 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(0, 3919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__492); - __Pyx_GIVEREF(__pyx_tuple__492); - - /* "talib/func.pyx":3921 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__493 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(0, 3921, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__493); - __Pyx_GIVEREF(__pyx_tuple__493); - - /* "talib/func.pyx":3923 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__494 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(0, 3923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__494); - __Pyx_GIVEREF(__pyx_tuple__494); - - /* "talib/func.pyx":3941 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLHOMINGPIGEON_Lookback( ) - */ - __pyx_tuple__495 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(0, 3941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__495); - __Pyx_GIVEREF(__pyx_tuple__495); - - /* "talib/func.pyx":3978 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__496 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(0, 3978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__496); - __Pyx_GIVEREF(__pyx_tuple__496); - - /* "talib/func.pyx":3980 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__497 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(0, 3980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__497); - __Pyx_GIVEREF(__pyx_tuple__497); - - /* "talib/func.pyx":3985 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__498 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(0, 3985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__498); - __Pyx_GIVEREF(__pyx_tuple__498); - - /* "talib/func.pyx":3987 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__499 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(0, 3987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__499); - __Pyx_GIVEREF(__pyx_tuple__499); - - /* "talib/func.pyx":3992 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__500 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(0, 3992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__500); - __Pyx_GIVEREF(__pyx_tuple__500); - - /* "talib/func.pyx":3994 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__501 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(0, 3994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__501); - __Pyx_GIVEREF(__pyx_tuple__501); - - /* "talib/func.pyx":3999 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__502 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(0, 3999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__502); - __Pyx_GIVEREF(__pyx_tuple__502); - - /* "talib/func.pyx":4001 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__503 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(0, 4001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__503); - __Pyx_GIVEREF(__pyx_tuple__503); - - /* "talib/func.pyx":4007 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__504 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(0, 4007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__504); - __Pyx_GIVEREF(__pyx_tuple__504); - - /* "talib/func.pyx":4009 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__505 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(0, 4009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__505); - __Pyx_GIVEREF(__pyx_tuple__505); - - /* "talib/func.pyx":4011 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__506 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(0, 4011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__506); - __Pyx_GIVEREF(__pyx_tuple__506); - - /* "talib/func.pyx":4029 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLIDENTICAL3CROWS_Lookback( ) - */ - __pyx_tuple__507 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(0, 4029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__507); - __Pyx_GIVEREF(__pyx_tuple__507); - - /* "talib/func.pyx":4066 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__508 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(0, 4066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__508); - __Pyx_GIVEREF(__pyx_tuple__508); - - /* "talib/func.pyx":4068 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__509 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(0, 4068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__509); - __Pyx_GIVEREF(__pyx_tuple__509); - - /* "talib/func.pyx":4073 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__510 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(0, 4073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__510); - __Pyx_GIVEREF(__pyx_tuple__510); - - /* "talib/func.pyx":4075 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__511 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(0, 4075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__511); - __Pyx_GIVEREF(__pyx_tuple__511); - - /* "talib/func.pyx":4080 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__512 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(0, 4080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__512); - __Pyx_GIVEREF(__pyx_tuple__512); - - /* "talib/func.pyx":4082 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__513 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(0, 4082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__513); - __Pyx_GIVEREF(__pyx_tuple__513); - - /* "talib/func.pyx":4087 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__514 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(0, 4087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__514); - __Pyx_GIVEREF(__pyx_tuple__514); - - /* "talib/func.pyx":4089 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__515 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__515)) __PYX_ERR(0, 4089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__515); - __Pyx_GIVEREF(__pyx_tuple__515); - - /* "talib/func.pyx":4095 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__516 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(0, 4095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__516); - __Pyx_GIVEREF(__pyx_tuple__516); - - /* "talib/func.pyx":4097 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__517 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(0, 4097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__517); - __Pyx_GIVEREF(__pyx_tuple__517); - - /* "talib/func.pyx":4099 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__518 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(0, 4099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__518); - __Pyx_GIVEREF(__pyx_tuple__518); - - /* "talib/func.pyx":4117 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINNECK_Lookback( ) - */ - __pyx_tuple__519 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(0, 4117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__519); - __Pyx_GIVEREF(__pyx_tuple__519); - - /* "talib/func.pyx":4154 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__520 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(0, 4154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__520); - __Pyx_GIVEREF(__pyx_tuple__520); - - /* "talib/func.pyx":4156 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__521 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(0, 4156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__521); - __Pyx_GIVEREF(__pyx_tuple__521); - - /* "talib/func.pyx":4161 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__522 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(0, 4161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__522); - __Pyx_GIVEREF(__pyx_tuple__522); - - /* "talib/func.pyx":4163 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__523 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__523)) __PYX_ERR(0, 4163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__523); - __Pyx_GIVEREF(__pyx_tuple__523); - - /* "talib/func.pyx":4168 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__524 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(0, 4168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__524); - __Pyx_GIVEREF(__pyx_tuple__524); - - /* "talib/func.pyx":4170 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__525 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__525)) __PYX_ERR(0, 4170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__525); - __Pyx_GIVEREF(__pyx_tuple__525); - - /* "talib/func.pyx":4175 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__526 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(0, 4175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__526); - __Pyx_GIVEREF(__pyx_tuple__526); - - /* "talib/func.pyx":4177 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__527 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(0, 4177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__527); - __Pyx_GIVEREF(__pyx_tuple__527); - - /* "talib/func.pyx":4183 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__528 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(0, 4183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__528); - __Pyx_GIVEREF(__pyx_tuple__528); - - /* "talib/func.pyx":4185 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__529 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(0, 4185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__529); - __Pyx_GIVEREF(__pyx_tuple__529); - - /* "talib/func.pyx":4187 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__530 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(0, 4187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__530); - __Pyx_GIVEREF(__pyx_tuple__530); - - /* "talib/func.pyx":4205 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLINVERTEDHAMMER_Lookback( ) - */ - __pyx_tuple__531 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(0, 4205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__531); - __Pyx_GIVEREF(__pyx_tuple__531); - - /* "talib/func.pyx":4242 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__532 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(0, 4242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__532); - __Pyx_GIVEREF(__pyx_tuple__532); - - /* "talib/func.pyx":4244 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__533 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__533)) __PYX_ERR(0, 4244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__533); - __Pyx_GIVEREF(__pyx_tuple__533); - - /* "talib/func.pyx":4249 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__534 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(0, 4249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__534); - __Pyx_GIVEREF(__pyx_tuple__534); - - /* "talib/func.pyx":4251 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__535 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(0, 4251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__535); - __Pyx_GIVEREF(__pyx_tuple__535); - - /* "talib/func.pyx":4256 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__536 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(0, 4256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__536); - __Pyx_GIVEREF(__pyx_tuple__536); - - /* "talib/func.pyx":4258 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__537 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(0, 4258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__537); - __Pyx_GIVEREF(__pyx_tuple__537); - - /* "talib/func.pyx":4263 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__538 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(0, 4263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__538); - __Pyx_GIVEREF(__pyx_tuple__538); - - /* "talib/func.pyx":4265 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__539 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(0, 4265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__539); - __Pyx_GIVEREF(__pyx_tuple__539); - - /* "talib/func.pyx":4271 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__540 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(0, 4271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__540); - __Pyx_GIVEREF(__pyx_tuple__540); - - /* "talib/func.pyx":4273 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__541 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(0, 4273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__541); - __Pyx_GIVEREF(__pyx_tuple__541); - - /* "talib/func.pyx":4275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__542 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(0, 4275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__542); - __Pyx_GIVEREF(__pyx_tuple__542); - - /* "talib/func.pyx":4293 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKING_Lookback( ) - */ - __pyx_tuple__543 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(0, 4293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__543); - __Pyx_GIVEREF(__pyx_tuple__543); - - /* "talib/func.pyx":4330 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__544 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(0, 4330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__544); - __Pyx_GIVEREF(__pyx_tuple__544); - - /* "talib/func.pyx":4332 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__545 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(0, 4332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__545); - __Pyx_GIVEREF(__pyx_tuple__545); - - /* "talib/func.pyx":4337 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__546 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(0, 4337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__546); - __Pyx_GIVEREF(__pyx_tuple__546); - - /* "talib/func.pyx":4339 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__547 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(0, 4339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__547); - __Pyx_GIVEREF(__pyx_tuple__547); - - /* "talib/func.pyx":4344 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__548 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(0, 4344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__548); - __Pyx_GIVEREF(__pyx_tuple__548); - - /* "talib/func.pyx":4346 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__549 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(0, 4346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__549); - __Pyx_GIVEREF(__pyx_tuple__549); - - /* "talib/func.pyx":4351 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__550 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(0, 4351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__550); - __Pyx_GIVEREF(__pyx_tuple__550); - - /* "talib/func.pyx":4353 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__551 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(0, 4353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__551); - __Pyx_GIVEREF(__pyx_tuple__551); - - /* "talib/func.pyx":4359 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__552 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(0, 4359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__552); - __Pyx_GIVEREF(__pyx_tuple__552); - - /* "talib/func.pyx":4361 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__553 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(0, 4361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__553); - __Pyx_GIVEREF(__pyx_tuple__553); - - /* "talib/func.pyx":4363 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__554 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(0, 4363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__554); - __Pyx_GIVEREF(__pyx_tuple__554); - - /* "talib/func.pyx":4381 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLKICKINGBYLENGTH_Lookback( ) - */ - __pyx_tuple__555 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__555)) __PYX_ERR(0, 4381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__555); - __Pyx_GIVEREF(__pyx_tuple__555); - - /* "talib/func.pyx":4418 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__556 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(0, 4418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__556); - __Pyx_GIVEREF(__pyx_tuple__556); - - /* "talib/func.pyx":4420 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__557 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__557)) __PYX_ERR(0, 4420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__557); - __Pyx_GIVEREF(__pyx_tuple__557); - - /* "talib/func.pyx":4425 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__558 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(0, 4425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__558); - __Pyx_GIVEREF(__pyx_tuple__558); - - /* "talib/func.pyx":4427 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__559 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__559)) __PYX_ERR(0, 4427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__559); - __Pyx_GIVEREF(__pyx_tuple__559); - - /* "talib/func.pyx":4432 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__560 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(0, 4432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__560); - __Pyx_GIVEREF(__pyx_tuple__560); - - /* "talib/func.pyx":4434 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__561 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__561)) __PYX_ERR(0, 4434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__561); - __Pyx_GIVEREF(__pyx_tuple__561); - - /* "talib/func.pyx":4439 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__562 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__562)) __PYX_ERR(0, 4439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__562); - __Pyx_GIVEREF(__pyx_tuple__562); - - /* "talib/func.pyx":4441 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__563 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(0, 4441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__563); - __Pyx_GIVEREF(__pyx_tuple__563); - - /* "talib/func.pyx":4447 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__564 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(0, 4447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__564); - __Pyx_GIVEREF(__pyx_tuple__564); - - /* "talib/func.pyx":4449 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__565 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__565)) __PYX_ERR(0, 4449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__565); - __Pyx_GIVEREF(__pyx_tuple__565); - - /* "talib/func.pyx":4451 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__566 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(0, 4451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__566); - __Pyx_GIVEREF(__pyx_tuple__566); - - /* "talib/func.pyx":4469 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLADDERBOTTOM_Lookback( ) - */ - __pyx_tuple__567 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(0, 4469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__567); - __Pyx_GIVEREF(__pyx_tuple__567); - - /* "talib/func.pyx":4506 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__568 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(0, 4506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__568); - __Pyx_GIVEREF(__pyx_tuple__568); - - /* "talib/func.pyx":4508 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__569 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(0, 4508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__569); - __Pyx_GIVEREF(__pyx_tuple__569); - - /* "talib/func.pyx":4513 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__570 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__570)) __PYX_ERR(0, 4513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__570); - __Pyx_GIVEREF(__pyx_tuple__570); - - /* "talib/func.pyx":4515 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__571 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(0, 4515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__571); - __Pyx_GIVEREF(__pyx_tuple__571); - - /* "talib/func.pyx":4520 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__572 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__572)) __PYX_ERR(0, 4520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__572); - __Pyx_GIVEREF(__pyx_tuple__572); - - /* "talib/func.pyx":4522 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__573 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__573)) __PYX_ERR(0, 4522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__573); - __Pyx_GIVEREF(__pyx_tuple__573); - - /* "talib/func.pyx":4527 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__574 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__574)) __PYX_ERR(0, 4527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__574); - __Pyx_GIVEREF(__pyx_tuple__574); - - /* "talib/func.pyx":4529 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__575 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(0, 4529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__575); - __Pyx_GIVEREF(__pyx_tuple__575); - - /* "talib/func.pyx":4535 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__576 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__576)) __PYX_ERR(0, 4535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__576); - __Pyx_GIVEREF(__pyx_tuple__576); - - /* "talib/func.pyx":4537 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__577 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(0, 4537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__577); - __Pyx_GIVEREF(__pyx_tuple__577); - - /* "talib/func.pyx":4539 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__578 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__578)) __PYX_ERR(0, 4539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__578); - __Pyx_GIVEREF(__pyx_tuple__578); - - /* "talib/func.pyx":4557 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLEGGEDDOJI_Lookback( ) - */ - __pyx_tuple__579 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(0, 4557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__579); - __Pyx_GIVEREF(__pyx_tuple__579); - - /* "talib/func.pyx":4594 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__580 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__580)) __PYX_ERR(0, 4594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__580); - __Pyx_GIVEREF(__pyx_tuple__580); - - /* "talib/func.pyx":4596 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__581 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(0, 4596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__581); - __Pyx_GIVEREF(__pyx_tuple__581); - - /* "talib/func.pyx":4601 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__582 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__582)) __PYX_ERR(0, 4601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__582); - __Pyx_GIVEREF(__pyx_tuple__582); - - /* "talib/func.pyx":4603 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__583 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(0, 4603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__583); - __Pyx_GIVEREF(__pyx_tuple__583); - - /* "talib/func.pyx":4608 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__584 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__584)) __PYX_ERR(0, 4608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__584); - __Pyx_GIVEREF(__pyx_tuple__584); - - /* "talib/func.pyx":4610 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__585 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(0, 4610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__585); - __Pyx_GIVEREF(__pyx_tuple__585); - - /* "talib/func.pyx":4615 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__586 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__586)) __PYX_ERR(0, 4615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__586); - __Pyx_GIVEREF(__pyx_tuple__586); - - /* "talib/func.pyx":4617 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__587 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(0, 4617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__587); - __Pyx_GIVEREF(__pyx_tuple__587); - - /* "talib/func.pyx":4623 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__588 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__588)) __PYX_ERR(0, 4623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__588); - __Pyx_GIVEREF(__pyx_tuple__588); - - /* "talib/func.pyx":4625 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__589 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__589)) __PYX_ERR(0, 4625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__589); - __Pyx_GIVEREF(__pyx_tuple__589); - - /* "talib/func.pyx":4627 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__590 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__590)) __PYX_ERR(0, 4627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__590); - __Pyx_GIVEREF(__pyx_tuple__590); - - /* "talib/func.pyx":4645 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLLONGLINE_Lookback( ) - */ - __pyx_tuple__591 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__591)) __PYX_ERR(0, 4645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__591); - __Pyx_GIVEREF(__pyx_tuple__591); - - /* "talib/func.pyx":4682 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__592 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__592)) __PYX_ERR(0, 4682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__592); - __Pyx_GIVEREF(__pyx_tuple__592); - - /* "talib/func.pyx":4684 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__593 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__593)) __PYX_ERR(0, 4684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__593); - __Pyx_GIVEREF(__pyx_tuple__593); - - /* "talib/func.pyx":4689 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__594 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__594)) __PYX_ERR(0, 4689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__594); - __Pyx_GIVEREF(__pyx_tuple__594); - - /* "talib/func.pyx":4691 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__595 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(0, 4691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__595); - __Pyx_GIVEREF(__pyx_tuple__595); - - /* "talib/func.pyx":4696 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__596 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__596)) __PYX_ERR(0, 4696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__596); - __Pyx_GIVEREF(__pyx_tuple__596); - - /* "talib/func.pyx":4698 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__597 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__597)) __PYX_ERR(0, 4698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__597); - __Pyx_GIVEREF(__pyx_tuple__597); - - /* "talib/func.pyx":4703 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__598 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(0, 4703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__598); - __Pyx_GIVEREF(__pyx_tuple__598); - - /* "talib/func.pyx":4705 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__599 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__599)) __PYX_ERR(0, 4705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__599); - __Pyx_GIVEREF(__pyx_tuple__599); - - /* "talib/func.pyx":4711 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__600 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(0, 4711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__600); - __Pyx_GIVEREF(__pyx_tuple__600); - - /* "talib/func.pyx":4713 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__601 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__601)) __PYX_ERR(0, 4713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__601); - __Pyx_GIVEREF(__pyx_tuple__601); - - /* "talib/func.pyx":4715 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__602 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(0, 4715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__602); - __Pyx_GIVEREF(__pyx_tuple__602); - - /* "talib/func.pyx":4733 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMARUBOZU_Lookback( ) - */ - __pyx_tuple__603 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__603)) __PYX_ERR(0, 4733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__603); - __Pyx_GIVEREF(__pyx_tuple__603); - - /* "talib/func.pyx":4770 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__604 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__604)) __PYX_ERR(0, 4770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__604); - __Pyx_GIVEREF(__pyx_tuple__604); - - /* "talib/func.pyx":4772 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__605 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__605)) __PYX_ERR(0, 4772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__605); - __Pyx_GIVEREF(__pyx_tuple__605); - - /* "talib/func.pyx":4777 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__606 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(0, 4777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__606); - __Pyx_GIVEREF(__pyx_tuple__606); - - /* "talib/func.pyx":4779 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__607 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__607)) __PYX_ERR(0, 4779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__607); - __Pyx_GIVEREF(__pyx_tuple__607); - - /* "talib/func.pyx":4784 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__608 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(0, 4784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__608); - __Pyx_GIVEREF(__pyx_tuple__608); - - /* "talib/func.pyx":4786 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__609 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__609)) __PYX_ERR(0, 4786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__609); - __Pyx_GIVEREF(__pyx_tuple__609); - - /* "talib/func.pyx":4791 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__610 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(0, 4791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__610); - __Pyx_GIVEREF(__pyx_tuple__610); - - /* "talib/func.pyx":4793 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__611 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__611)) __PYX_ERR(0, 4793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__611); - __Pyx_GIVEREF(__pyx_tuple__611); - - /* "talib/func.pyx":4799 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__612 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(0, 4799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__612); - __Pyx_GIVEREF(__pyx_tuple__612); - - /* "talib/func.pyx":4801 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__613 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__613)) __PYX_ERR(0, 4801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__613); - __Pyx_GIVEREF(__pyx_tuple__613); - - /* "talib/func.pyx":4803 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__614 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(0, 4803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__614); - __Pyx_GIVEREF(__pyx_tuple__614); - - /* "talib/func.pyx":4821 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATCHINGLOW_Lookback( ) - */ - __pyx_tuple__615 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__615)) __PYX_ERR(0, 4821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__615); - __Pyx_GIVEREF(__pyx_tuple__615); - - /* "talib/func.pyx":4860 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__616 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(0, 4860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__616); - __Pyx_GIVEREF(__pyx_tuple__616); - - /* "talib/func.pyx":4862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__617 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__617)) __PYX_ERR(0, 4862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__617); - __Pyx_GIVEREF(__pyx_tuple__617); - - /* "talib/func.pyx":4867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__618 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__618)) __PYX_ERR(0, 4867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__618); - __Pyx_GIVEREF(__pyx_tuple__618); - - /* "talib/func.pyx":4869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__619 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__619)) __PYX_ERR(0, 4869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__619); - __Pyx_GIVEREF(__pyx_tuple__619); - - /* "talib/func.pyx":4874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__620 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__620)) __PYX_ERR(0, 4874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__620); - __Pyx_GIVEREF(__pyx_tuple__620); - - /* "talib/func.pyx":4876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__621 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__621)) __PYX_ERR(0, 4876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__621); - __Pyx_GIVEREF(__pyx_tuple__621); - - /* "talib/func.pyx":4881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__622 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(0, 4881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__622); - __Pyx_GIVEREF(__pyx_tuple__622); - - /* "talib/func.pyx":4883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__623 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__623)) __PYX_ERR(0, 4883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__623); - __Pyx_GIVEREF(__pyx_tuple__623); - - /* "talib/func.pyx":4889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__624 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(0, 4889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__624); - __Pyx_GIVEREF(__pyx_tuple__624); - - /* "talib/func.pyx":4891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__625 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(0, 4891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__625); - __Pyx_GIVEREF(__pyx_tuple__625); - - /* "talib/func.pyx":4893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__626 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__626)) __PYX_ERR(0, 4893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__626); - __Pyx_GIVEREF(__pyx_tuple__626); - - /* "talib/func.pyx":4911 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMATHOLD_Lookback( penetration ) - */ - __pyx_tuple__627 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(0, 4911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__627); - __Pyx_GIVEREF(__pyx_tuple__627); - - /* "talib/func.pyx":4950 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__628 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__628)) __PYX_ERR(0, 4950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__628); - __Pyx_GIVEREF(__pyx_tuple__628); - - /* "talib/func.pyx":4952 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__629 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(0, 4952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__629); - __Pyx_GIVEREF(__pyx_tuple__629); - - /* "talib/func.pyx":4957 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__630 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(0, 4957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__630); - __Pyx_GIVEREF(__pyx_tuple__630); - - /* "talib/func.pyx":4959 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__631 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(0, 4959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__631); - __Pyx_GIVEREF(__pyx_tuple__631); - - /* "talib/func.pyx":4964 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__632 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(0, 4964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__632); - __Pyx_GIVEREF(__pyx_tuple__632); - - /* "talib/func.pyx":4966 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__633 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(0, 4966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__633); - __Pyx_GIVEREF(__pyx_tuple__633); - - /* "talib/func.pyx":4971 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__634 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(0, 4971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__634); - __Pyx_GIVEREF(__pyx_tuple__634); - - /* "talib/func.pyx":4973 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__635 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(0, 4973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__635); - __Pyx_GIVEREF(__pyx_tuple__635); - - /* "talib/func.pyx":4979 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__636 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(0, 4979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__636); - __Pyx_GIVEREF(__pyx_tuple__636); - - /* "talib/func.pyx":4981 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__637 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(0, 4981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__637); - __Pyx_GIVEREF(__pyx_tuple__637); - - /* "talib/func.pyx":4983 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__638 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(0, 4983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__638); - __Pyx_GIVEREF(__pyx_tuple__638); - - /* "talib/func.pyx":5001 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGDOJISTAR_Lookback( penetration ) - */ - __pyx_tuple__639 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(0, 5001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__639); - __Pyx_GIVEREF(__pyx_tuple__639); - - /* "talib/func.pyx":5040 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__640 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__640)) __PYX_ERR(0, 5040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__640); - __Pyx_GIVEREF(__pyx_tuple__640); - - /* "talib/func.pyx":5042 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__641 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(0, 5042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__641); - __Pyx_GIVEREF(__pyx_tuple__641); - - /* "talib/func.pyx":5047 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__642 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(0, 5047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__642); - __Pyx_GIVEREF(__pyx_tuple__642); - - /* "talib/func.pyx":5049 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__643 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__643)) __PYX_ERR(0, 5049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__643); - __Pyx_GIVEREF(__pyx_tuple__643); - - /* "talib/func.pyx":5054 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__644 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(0, 5054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__644); - __Pyx_GIVEREF(__pyx_tuple__644); - - /* "talib/func.pyx":5056 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__645 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__645)) __PYX_ERR(0, 5056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__645); - __Pyx_GIVEREF(__pyx_tuple__645); - - /* "talib/func.pyx":5061 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__646 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__646)) __PYX_ERR(0, 5061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__646); - __Pyx_GIVEREF(__pyx_tuple__646); - - /* "talib/func.pyx":5063 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__647 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(0, 5063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__647); - __Pyx_GIVEREF(__pyx_tuple__647); - - /* "talib/func.pyx":5069 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__648 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__648)) __PYX_ERR(0, 5069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__648); - __Pyx_GIVEREF(__pyx_tuple__648); - - /* "talib/func.pyx":5071 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__649 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(0, 5071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__649); - __Pyx_GIVEREF(__pyx_tuple__649); - - /* "talib/func.pyx":5073 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__650 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__650)) __PYX_ERR(0, 5073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__650); - __Pyx_GIVEREF(__pyx_tuple__650); - - /* "talib/func.pyx":5091 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLMORNINGSTAR_Lookback( penetration ) - */ - __pyx_tuple__651 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(0, 5091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__651); - __Pyx_GIVEREF(__pyx_tuple__651); - - /* "talib/func.pyx":5128 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__652 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__652)) __PYX_ERR(0, 5128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__652); - __Pyx_GIVEREF(__pyx_tuple__652); - - /* "talib/func.pyx":5130 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__653 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(0, 5130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__653); - __Pyx_GIVEREF(__pyx_tuple__653); - - /* "talib/func.pyx":5135 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__654 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__654)) __PYX_ERR(0, 5135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__654); - __Pyx_GIVEREF(__pyx_tuple__654); - - /* "talib/func.pyx":5137 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__655 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(0, 5137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__655); - __Pyx_GIVEREF(__pyx_tuple__655); - - /* "talib/func.pyx":5142 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__656 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__656)) __PYX_ERR(0, 5142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__656); - __Pyx_GIVEREF(__pyx_tuple__656); - - /* "talib/func.pyx":5144 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__657 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(0, 5144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__657); - __Pyx_GIVEREF(__pyx_tuple__657); - - /* "talib/func.pyx":5149 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__658 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__658)) __PYX_ERR(0, 5149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__658); - __Pyx_GIVEREF(__pyx_tuple__658); - - /* "talib/func.pyx":5151 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__659 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(0, 5151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__659); - __Pyx_GIVEREF(__pyx_tuple__659); - - /* "talib/func.pyx":5157 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__660 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__660)) __PYX_ERR(0, 5157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__660); - __Pyx_GIVEREF(__pyx_tuple__660); - - /* "talib/func.pyx":5159 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__661 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(0, 5159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__661); - __Pyx_GIVEREF(__pyx_tuple__661); - - /* "talib/func.pyx":5161 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__662 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__662)) __PYX_ERR(0, 5161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__662); - __Pyx_GIVEREF(__pyx_tuple__662); - - /* "talib/func.pyx":5179 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLONNECK_Lookback( ) - */ - __pyx_tuple__663 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(0, 5179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__663); - __Pyx_GIVEREF(__pyx_tuple__663); - - /* "talib/func.pyx":5216 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__664 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__664)) __PYX_ERR(0, 5216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__664); - __Pyx_GIVEREF(__pyx_tuple__664); - - /* "talib/func.pyx":5218 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__665 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(0, 5218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__665); - __Pyx_GIVEREF(__pyx_tuple__665); - - /* "talib/func.pyx":5223 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__666 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__666)) __PYX_ERR(0, 5223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__666); - __Pyx_GIVEREF(__pyx_tuple__666); - - /* "talib/func.pyx":5225 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__667 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(0, 5225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__667); - __Pyx_GIVEREF(__pyx_tuple__667); - - /* "talib/func.pyx":5230 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__668 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__668)) __PYX_ERR(0, 5230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__668); - __Pyx_GIVEREF(__pyx_tuple__668); - - /* "talib/func.pyx":5232 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__669 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(0, 5232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__669); - __Pyx_GIVEREF(__pyx_tuple__669); - - /* "talib/func.pyx":5237 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__670 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__670)) __PYX_ERR(0, 5237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__670); - __Pyx_GIVEREF(__pyx_tuple__670); - - /* "talib/func.pyx":5239 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__671 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(0, 5239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__671); - __Pyx_GIVEREF(__pyx_tuple__671); - - /* "talib/func.pyx":5245 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__672 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__672)) __PYX_ERR(0, 5245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__672); - __Pyx_GIVEREF(__pyx_tuple__672); - - /* "talib/func.pyx":5247 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__673 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(0, 5247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__673); - __Pyx_GIVEREF(__pyx_tuple__673); - - /* "talib/func.pyx":5249 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__674 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__674)) __PYX_ERR(0, 5249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__674); - __Pyx_GIVEREF(__pyx_tuple__674); - - /* "talib/func.pyx":5267 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLPIERCING_Lookback( ) - */ - __pyx_tuple__675 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(0, 5267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__675); - __Pyx_GIVEREF(__pyx_tuple__675); - - /* "talib/func.pyx":5304 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__676 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__676)) __PYX_ERR(0, 5304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__676); - __Pyx_GIVEREF(__pyx_tuple__676); - - /* "talib/func.pyx":5306 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__677 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(0, 5306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__677); - __Pyx_GIVEREF(__pyx_tuple__677); - - /* "talib/func.pyx":5311 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__678 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__678)) __PYX_ERR(0, 5311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__678); - __Pyx_GIVEREF(__pyx_tuple__678); - - /* "talib/func.pyx":5313 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__679 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__679)) __PYX_ERR(0, 5313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__679); - __Pyx_GIVEREF(__pyx_tuple__679); - - /* "talib/func.pyx":5318 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__680 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__680)) __PYX_ERR(0, 5318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__680); - __Pyx_GIVEREF(__pyx_tuple__680); - - /* "talib/func.pyx":5320 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__681 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__681)) __PYX_ERR(0, 5320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__681); - __Pyx_GIVEREF(__pyx_tuple__681); - - /* "talib/func.pyx":5325 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__682 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__682)) __PYX_ERR(0, 5325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__682); - __Pyx_GIVEREF(__pyx_tuple__682); - - /* "talib/func.pyx":5327 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__683 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__683)) __PYX_ERR(0, 5327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__683); - __Pyx_GIVEREF(__pyx_tuple__683); - - /* "talib/func.pyx":5333 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__684 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__684)) __PYX_ERR(0, 5333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__684); - __Pyx_GIVEREF(__pyx_tuple__684); - - /* "talib/func.pyx":5335 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__685 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__685)) __PYX_ERR(0, 5335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__685); - __Pyx_GIVEREF(__pyx_tuple__685); - - /* "talib/func.pyx":5337 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__686 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(0, 5337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__686); - __Pyx_GIVEREF(__pyx_tuple__686); - - /* "talib/func.pyx":5355 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRICKSHAWMAN_Lookback( ) - */ - __pyx_tuple__687 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__687)) __PYX_ERR(0, 5355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__687); - __Pyx_GIVEREF(__pyx_tuple__687); - - /* "talib/func.pyx":5392 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__688 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__688)) __PYX_ERR(0, 5392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__688); - __Pyx_GIVEREF(__pyx_tuple__688); - - /* "talib/func.pyx":5394 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__689 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__689)) __PYX_ERR(0, 5394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__689); - __Pyx_GIVEREF(__pyx_tuple__689); - - /* "talib/func.pyx":5399 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__690 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__690)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__690); - __Pyx_GIVEREF(__pyx_tuple__690); - - /* "talib/func.pyx":5401 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__691 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__691)) __PYX_ERR(0, 5401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__691); - __Pyx_GIVEREF(__pyx_tuple__691); - - /* "talib/func.pyx":5406 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__692 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__692)) __PYX_ERR(0, 5406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__692); - __Pyx_GIVEREF(__pyx_tuple__692); - - /* "talib/func.pyx":5408 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__693 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__693)) __PYX_ERR(0, 5408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__693); - __Pyx_GIVEREF(__pyx_tuple__693); - - /* "talib/func.pyx":5413 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__694 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__694)) __PYX_ERR(0, 5413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__694); - __Pyx_GIVEREF(__pyx_tuple__694); - - /* "talib/func.pyx":5415 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__695 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__695)) __PYX_ERR(0, 5415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__695); - __Pyx_GIVEREF(__pyx_tuple__695); - - /* "talib/func.pyx":5421 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__696 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__696)) __PYX_ERR(0, 5421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__696); - __Pyx_GIVEREF(__pyx_tuple__696); - - /* "talib/func.pyx":5423 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__697 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__697)) __PYX_ERR(0, 5423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__697); - __Pyx_GIVEREF(__pyx_tuple__697); - - /* "talib/func.pyx":5425 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__698 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__698)) __PYX_ERR(0, 5425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__698); - __Pyx_GIVEREF(__pyx_tuple__698); - - /* "talib/func.pyx":5443 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLRISEFALL3METHODS_Lookback( ) - */ - __pyx_tuple__699 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__699)) __PYX_ERR(0, 5443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__699); - __Pyx_GIVEREF(__pyx_tuple__699); - - /* "talib/func.pyx":5480 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__700 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__700)) __PYX_ERR(0, 5480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__700); - __Pyx_GIVEREF(__pyx_tuple__700); - - /* "talib/func.pyx":5482 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__701 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__701)) __PYX_ERR(0, 5482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__701); - __Pyx_GIVEREF(__pyx_tuple__701); - - /* "talib/func.pyx":5487 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__702 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__702)) __PYX_ERR(0, 5487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__702); - __Pyx_GIVEREF(__pyx_tuple__702); - - /* "talib/func.pyx":5489 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__703 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__703)) __PYX_ERR(0, 5489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__703); - __Pyx_GIVEREF(__pyx_tuple__703); - - /* "talib/func.pyx":5494 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__704 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__704)) __PYX_ERR(0, 5494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__704); - __Pyx_GIVEREF(__pyx_tuple__704); - - /* "talib/func.pyx":5496 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__705 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__705)) __PYX_ERR(0, 5496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__705); - __Pyx_GIVEREF(__pyx_tuple__705); - - /* "talib/func.pyx":5501 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__706 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__706)) __PYX_ERR(0, 5501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__706); - __Pyx_GIVEREF(__pyx_tuple__706); - - /* "talib/func.pyx":5503 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__707 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__707)) __PYX_ERR(0, 5503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__707); - __Pyx_GIVEREF(__pyx_tuple__707); - - /* "talib/func.pyx":5509 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__708 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__708)) __PYX_ERR(0, 5509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__708); - __Pyx_GIVEREF(__pyx_tuple__708); - - /* "talib/func.pyx":5511 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__709 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__709)) __PYX_ERR(0, 5511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__709); - __Pyx_GIVEREF(__pyx_tuple__709); - - /* "talib/func.pyx":5513 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__710 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__710)) __PYX_ERR(0, 5513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__710); - __Pyx_GIVEREF(__pyx_tuple__710); - - /* "talib/func.pyx":5531 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSEPARATINGLINES_Lookback( ) - */ - __pyx_tuple__711 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__711)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__711); - __Pyx_GIVEREF(__pyx_tuple__711); - - /* "talib/func.pyx":5568 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__712 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__712)) __PYX_ERR(0, 5568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__712); - __Pyx_GIVEREF(__pyx_tuple__712); - - /* "talib/func.pyx":5570 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__713 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__713)) __PYX_ERR(0, 5570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__713); - __Pyx_GIVEREF(__pyx_tuple__713); - - /* "talib/func.pyx":5575 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__714 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__714)) __PYX_ERR(0, 5575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__714); - __Pyx_GIVEREF(__pyx_tuple__714); - - /* "talib/func.pyx":5577 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__715 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__715)) __PYX_ERR(0, 5577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__715); - __Pyx_GIVEREF(__pyx_tuple__715); - - /* "talib/func.pyx":5582 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__716)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__716); - __Pyx_GIVEREF(__pyx_tuple__716); - - /* "talib/func.pyx":5584 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__717)) __PYX_ERR(0, 5584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__717); - __Pyx_GIVEREF(__pyx_tuple__717); - - /* "talib/func.pyx":5589 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__718)) __PYX_ERR(0, 5589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__718); - __Pyx_GIVEREF(__pyx_tuple__718); - - /* "talib/func.pyx":5591 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__719)) __PYX_ERR(0, 5591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__719); - __Pyx_GIVEREF(__pyx_tuple__719); - - /* "talib/func.pyx":5597 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__720)) __PYX_ERR(0, 5597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__720); - __Pyx_GIVEREF(__pyx_tuple__720); - - /* "talib/func.pyx":5599 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__721 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__721)) __PYX_ERR(0, 5599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__721); - __Pyx_GIVEREF(__pyx_tuple__721); - - /* "talib/func.pyx":5601 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__722 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__722)) __PYX_ERR(0, 5601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__722); - __Pyx_GIVEREF(__pyx_tuple__722); - - /* "talib/func.pyx":5619 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHOOTINGSTAR_Lookback( ) - */ - __pyx_tuple__723 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__723)) __PYX_ERR(0, 5619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__723); - __Pyx_GIVEREF(__pyx_tuple__723); - - /* "talib/func.pyx":5656 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__724 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__724)) __PYX_ERR(0, 5656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__724); - __Pyx_GIVEREF(__pyx_tuple__724); - - /* "talib/func.pyx":5658 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__725 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__725)) __PYX_ERR(0, 5658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__725); - __Pyx_GIVEREF(__pyx_tuple__725); - - /* "talib/func.pyx":5663 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__726 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__726)) __PYX_ERR(0, 5663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__726); - __Pyx_GIVEREF(__pyx_tuple__726); - - /* "talib/func.pyx":5665 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__727 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__727)) __PYX_ERR(0, 5665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__727); - __Pyx_GIVEREF(__pyx_tuple__727); - - /* "talib/func.pyx":5670 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__728 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__728)) __PYX_ERR(0, 5670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__728); - __Pyx_GIVEREF(__pyx_tuple__728); - - /* "talib/func.pyx":5672 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__729 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__729)) __PYX_ERR(0, 5672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__729); - __Pyx_GIVEREF(__pyx_tuple__729); - - /* "talib/func.pyx":5677 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__730 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__730)) __PYX_ERR(0, 5677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__730); - __Pyx_GIVEREF(__pyx_tuple__730); - - /* "talib/func.pyx":5679 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__731 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__731)) __PYX_ERR(0, 5679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__731); - __Pyx_GIVEREF(__pyx_tuple__731); - - /* "talib/func.pyx":5685 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__732 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__732)) __PYX_ERR(0, 5685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__732); - __Pyx_GIVEREF(__pyx_tuple__732); - - /* "talib/func.pyx":5687 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__733 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__733)) __PYX_ERR(0, 5687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__733); - __Pyx_GIVEREF(__pyx_tuple__733); - - /* "talib/func.pyx":5689 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__734 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__734)) __PYX_ERR(0, 5689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__734); - __Pyx_GIVEREF(__pyx_tuple__734); - - /* "talib/func.pyx":5707 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSHORTLINE_Lookback( ) - */ - __pyx_tuple__735 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__735)) __PYX_ERR(0, 5707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__735); - __Pyx_GIVEREF(__pyx_tuple__735); - - /* "talib/func.pyx":5744 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__736 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__736)) __PYX_ERR(0, 5744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__736); - __Pyx_GIVEREF(__pyx_tuple__736); - - /* "talib/func.pyx":5746 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__737 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__737)) __PYX_ERR(0, 5746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__737); - __Pyx_GIVEREF(__pyx_tuple__737); - - /* "talib/func.pyx":5751 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__738 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__738)) __PYX_ERR(0, 5751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__738); - __Pyx_GIVEREF(__pyx_tuple__738); - - /* "talib/func.pyx":5753 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__739 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__739)) __PYX_ERR(0, 5753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__739); - __Pyx_GIVEREF(__pyx_tuple__739); - - /* "talib/func.pyx":5758 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__740 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__740)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__740); - __Pyx_GIVEREF(__pyx_tuple__740); - - /* "talib/func.pyx":5760 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__741 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__741)) __PYX_ERR(0, 5760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__741); - __Pyx_GIVEREF(__pyx_tuple__741); - - /* "talib/func.pyx":5765 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__742 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__742)) __PYX_ERR(0, 5765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__742); - __Pyx_GIVEREF(__pyx_tuple__742); - - /* "talib/func.pyx":5767 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__743 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__743)) __PYX_ERR(0, 5767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__743); - __Pyx_GIVEREF(__pyx_tuple__743); - - /* "talib/func.pyx":5773 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__744 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__744)) __PYX_ERR(0, 5773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__744); - __Pyx_GIVEREF(__pyx_tuple__744); - - /* "talib/func.pyx":5775 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__745 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__745)) __PYX_ERR(0, 5775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__745); - __Pyx_GIVEREF(__pyx_tuple__745); - - /* "talib/func.pyx":5777 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__746 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__746)) __PYX_ERR(0, 5777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__746); - __Pyx_GIVEREF(__pyx_tuple__746); - - /* "talib/func.pyx":5795 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSPINNINGTOP_Lookback( ) - */ - __pyx_tuple__747 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__747)) __PYX_ERR(0, 5795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__747); - __Pyx_GIVEREF(__pyx_tuple__747); - - /* "talib/func.pyx":5832 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__748 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__748)) __PYX_ERR(0, 5832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__748); - __Pyx_GIVEREF(__pyx_tuple__748); - - /* "talib/func.pyx":5834 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__749 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__749)) __PYX_ERR(0, 5834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__749); - __Pyx_GIVEREF(__pyx_tuple__749); - - /* "talib/func.pyx":5839 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__750 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__750)) __PYX_ERR(0, 5839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__750); - __Pyx_GIVEREF(__pyx_tuple__750); - - /* "talib/func.pyx":5841 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__751 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__751)) __PYX_ERR(0, 5841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__751); - __Pyx_GIVEREF(__pyx_tuple__751); - - /* "talib/func.pyx":5846 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__752 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__752)) __PYX_ERR(0, 5846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__752); - __Pyx_GIVEREF(__pyx_tuple__752); - - /* "talib/func.pyx":5848 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__753 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__753)) __PYX_ERR(0, 5848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__753); - __Pyx_GIVEREF(__pyx_tuple__753); - - /* "talib/func.pyx":5853 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__754 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__754)) __PYX_ERR(0, 5853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__754); - __Pyx_GIVEREF(__pyx_tuple__754); - - /* "talib/func.pyx":5855 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__755 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__755)) __PYX_ERR(0, 5855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__755); - __Pyx_GIVEREF(__pyx_tuple__755); - - /* "talib/func.pyx":5861 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__756 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__756)) __PYX_ERR(0, 5861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__756); - __Pyx_GIVEREF(__pyx_tuple__756); - - /* "talib/func.pyx":5863 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__757 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__757)) __PYX_ERR(0, 5863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__757); - __Pyx_GIVEREF(__pyx_tuple__757); - - /* "talib/func.pyx":5865 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__758 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__758)) __PYX_ERR(0, 5865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__758); - __Pyx_GIVEREF(__pyx_tuple__758); - - /* "talib/func.pyx":5883 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTALLEDPATTERN_Lookback( ) - */ - __pyx_tuple__759 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__759)) __PYX_ERR(0, 5883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__759); - __Pyx_GIVEREF(__pyx_tuple__759); - - /* "talib/func.pyx":5920 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__760 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__760)) __PYX_ERR(0, 5920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__760); - __Pyx_GIVEREF(__pyx_tuple__760); - - /* "talib/func.pyx":5922 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__761 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__761)) __PYX_ERR(0, 5922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__761); - __Pyx_GIVEREF(__pyx_tuple__761); - - /* "talib/func.pyx":5927 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__762 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__762)) __PYX_ERR(0, 5927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__762); - __Pyx_GIVEREF(__pyx_tuple__762); - - /* "talib/func.pyx":5929 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__763 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__763)) __PYX_ERR(0, 5929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__763); - __Pyx_GIVEREF(__pyx_tuple__763); - - /* "talib/func.pyx":5934 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__764 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__764)) __PYX_ERR(0, 5934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__764); - __Pyx_GIVEREF(__pyx_tuple__764); - - /* "talib/func.pyx":5936 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__765 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__765)) __PYX_ERR(0, 5936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__765); - __Pyx_GIVEREF(__pyx_tuple__765); - - /* "talib/func.pyx":5941 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__766 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__766)) __PYX_ERR(0, 5941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__766); - __Pyx_GIVEREF(__pyx_tuple__766); - - /* "talib/func.pyx":5943 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__767 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__767)) __PYX_ERR(0, 5943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__767); - __Pyx_GIVEREF(__pyx_tuple__767); - - /* "talib/func.pyx":5949 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__768 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__768)) __PYX_ERR(0, 5949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__768); - __Pyx_GIVEREF(__pyx_tuple__768); - - /* "talib/func.pyx":5951 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__769 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__769)) __PYX_ERR(0, 5951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__769); - __Pyx_GIVEREF(__pyx_tuple__769); - - /* "talib/func.pyx":5953 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__770 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__770)) __PYX_ERR(0, 5953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__770); - __Pyx_GIVEREF(__pyx_tuple__770); - - /* "talib/func.pyx":5971 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLSTICKSANDWICH_Lookback( ) - */ - __pyx_tuple__771 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__771)) __PYX_ERR(0, 5971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__771); - __Pyx_GIVEREF(__pyx_tuple__771); - - /* "talib/func.pyx":6008 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__772 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__772)) __PYX_ERR(0, 6008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__772); - __Pyx_GIVEREF(__pyx_tuple__772); - - /* "talib/func.pyx":6010 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__773 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__773)) __PYX_ERR(0, 6010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__773); - __Pyx_GIVEREF(__pyx_tuple__773); - - /* "talib/func.pyx":6015 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__774 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__774)) __PYX_ERR(0, 6015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__774); - __Pyx_GIVEREF(__pyx_tuple__774); - - /* "talib/func.pyx":6017 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__775 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__775)) __PYX_ERR(0, 6017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__775); - __Pyx_GIVEREF(__pyx_tuple__775); - - /* "talib/func.pyx":6022 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__776 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__776)) __PYX_ERR(0, 6022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__776); - __Pyx_GIVEREF(__pyx_tuple__776); - - /* "talib/func.pyx":6024 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__777 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__777)) __PYX_ERR(0, 6024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__777); - __Pyx_GIVEREF(__pyx_tuple__777); - - /* "talib/func.pyx":6029 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__778 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__778)) __PYX_ERR(0, 6029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__778); - __Pyx_GIVEREF(__pyx_tuple__778); - - /* "talib/func.pyx":6031 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__779 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__779)) __PYX_ERR(0, 6031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__779); - __Pyx_GIVEREF(__pyx_tuple__779); - - /* "talib/func.pyx":6037 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__780 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__780)) __PYX_ERR(0, 6037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__780); - __Pyx_GIVEREF(__pyx_tuple__780); - - /* "talib/func.pyx":6039 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__781 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__781)) __PYX_ERR(0, 6039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__781); - __Pyx_GIVEREF(__pyx_tuple__781); - - /* "talib/func.pyx":6041 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__782 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__782)) __PYX_ERR(0, 6041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__782); - __Pyx_GIVEREF(__pyx_tuple__782); - - /* "talib/func.pyx":6059 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTAKURI_Lookback( ) - */ - __pyx_tuple__783 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__783)) __PYX_ERR(0, 6059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__783); - __Pyx_GIVEREF(__pyx_tuple__783); - - /* "talib/func.pyx":6096 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__784 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__784)) __PYX_ERR(0, 6096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__784); - __Pyx_GIVEREF(__pyx_tuple__784); - - /* "talib/func.pyx":6098 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__785 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__785)) __PYX_ERR(0, 6098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__785); - __Pyx_GIVEREF(__pyx_tuple__785); - - /* "talib/func.pyx":6103 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__786 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__786)) __PYX_ERR(0, 6103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__786); - __Pyx_GIVEREF(__pyx_tuple__786); - - /* "talib/func.pyx":6105 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__787 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__787)) __PYX_ERR(0, 6105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__787); - __Pyx_GIVEREF(__pyx_tuple__787); - - /* "talib/func.pyx":6110 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__788 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__788)) __PYX_ERR(0, 6110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__788); - __Pyx_GIVEREF(__pyx_tuple__788); - - /* "talib/func.pyx":6112 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__789 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__789)) __PYX_ERR(0, 6112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__789); - __Pyx_GIVEREF(__pyx_tuple__789); - - /* "talib/func.pyx":6117 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__790 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__790)) __PYX_ERR(0, 6117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__790); - __Pyx_GIVEREF(__pyx_tuple__790); - - /* "talib/func.pyx":6119 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__791 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__791)) __PYX_ERR(0, 6119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__791); - __Pyx_GIVEREF(__pyx_tuple__791); - - /* "talib/func.pyx":6125 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__792 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__792)) __PYX_ERR(0, 6125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__792); - __Pyx_GIVEREF(__pyx_tuple__792); - - /* "talib/func.pyx":6127 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__793 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__793)) __PYX_ERR(0, 6127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__793); - __Pyx_GIVEREF(__pyx_tuple__793); - - /* "talib/func.pyx":6129 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__794 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__794)) __PYX_ERR(0, 6129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__794); - __Pyx_GIVEREF(__pyx_tuple__794); - - /* "talib/func.pyx":6147 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTASUKIGAP_Lookback( ) - */ - __pyx_tuple__795 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__795)) __PYX_ERR(0, 6147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__795); - __Pyx_GIVEREF(__pyx_tuple__795); - - /* "talib/func.pyx":6184 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__796 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__796)) __PYX_ERR(0, 6184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__796); - __Pyx_GIVEREF(__pyx_tuple__796); - - /* "talib/func.pyx":6186 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__797 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__797)) __PYX_ERR(0, 6186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__797); - __Pyx_GIVEREF(__pyx_tuple__797); - - /* "talib/func.pyx":6191 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__798 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__798)) __PYX_ERR(0, 6191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__798); - __Pyx_GIVEREF(__pyx_tuple__798); - - /* "talib/func.pyx":6193 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__799 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__799)) __PYX_ERR(0, 6193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__799); - __Pyx_GIVEREF(__pyx_tuple__799); - - /* "talib/func.pyx":6198 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__800 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__800)) __PYX_ERR(0, 6198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__800); - __Pyx_GIVEREF(__pyx_tuple__800); - - /* "talib/func.pyx":6200 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__801 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__801)) __PYX_ERR(0, 6200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__801); - __Pyx_GIVEREF(__pyx_tuple__801); - - /* "talib/func.pyx":6205 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__802 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__802)) __PYX_ERR(0, 6205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__802); - __Pyx_GIVEREF(__pyx_tuple__802); - - /* "talib/func.pyx":6207 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__803 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__803)) __PYX_ERR(0, 6207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__803); - __Pyx_GIVEREF(__pyx_tuple__803); - - /* "talib/func.pyx":6213 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__804 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__804)) __PYX_ERR(0, 6213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__804); - __Pyx_GIVEREF(__pyx_tuple__804); - - /* "talib/func.pyx":6215 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__805 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__805)) __PYX_ERR(0, 6215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__805); - __Pyx_GIVEREF(__pyx_tuple__805); - - /* "talib/func.pyx":6217 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__806 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__806)) __PYX_ERR(0, 6217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__806); - __Pyx_GIVEREF(__pyx_tuple__806); - - /* "talib/func.pyx":6235 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTHRUSTING_Lookback( ) - */ - __pyx_tuple__807 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__807)) __PYX_ERR(0, 6235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__807); - __Pyx_GIVEREF(__pyx_tuple__807); - - /* "talib/func.pyx":6272 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__808 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__808)) __PYX_ERR(0, 6272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__808); - __Pyx_GIVEREF(__pyx_tuple__808); - - /* "talib/func.pyx":6274 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__809 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__809)) __PYX_ERR(0, 6274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__809); - __Pyx_GIVEREF(__pyx_tuple__809); - - /* "talib/func.pyx":6279 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__810 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__810)) __PYX_ERR(0, 6279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__810); - __Pyx_GIVEREF(__pyx_tuple__810); - - /* "talib/func.pyx":6281 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__811 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__811)) __PYX_ERR(0, 6281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__811); - __Pyx_GIVEREF(__pyx_tuple__811); - - /* "talib/func.pyx":6286 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__812 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__812)) __PYX_ERR(0, 6286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__812); - __Pyx_GIVEREF(__pyx_tuple__812); - - /* "talib/func.pyx":6288 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__813 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__813)) __PYX_ERR(0, 6288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__813); - __Pyx_GIVEREF(__pyx_tuple__813); - - /* "talib/func.pyx":6293 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__814 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__814)) __PYX_ERR(0, 6293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__814); - __Pyx_GIVEREF(__pyx_tuple__814); - - /* "talib/func.pyx":6295 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__815 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__815)) __PYX_ERR(0, 6295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__815); - __Pyx_GIVEREF(__pyx_tuple__815); - - /* "talib/func.pyx":6301 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__816 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__816)) __PYX_ERR(0, 6301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__816); - __Pyx_GIVEREF(__pyx_tuple__816); - - /* "talib/func.pyx":6303 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__817 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__817)) __PYX_ERR(0, 6303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__817); - __Pyx_GIVEREF(__pyx_tuple__817); - - /* "talib/func.pyx":6305 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__818 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__818)) __PYX_ERR(0, 6305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__818); - __Pyx_GIVEREF(__pyx_tuple__818); - - /* "talib/func.pyx":6323 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLTRISTAR_Lookback( ) - */ - __pyx_tuple__819 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__819)) __PYX_ERR(0, 6323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__819); - __Pyx_GIVEREF(__pyx_tuple__819); - - /* "talib/func.pyx":6360 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__820 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__820)) __PYX_ERR(0, 6360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__820); - __Pyx_GIVEREF(__pyx_tuple__820); - - /* "talib/func.pyx":6362 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__821 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__821)) __PYX_ERR(0, 6362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__821); - __Pyx_GIVEREF(__pyx_tuple__821); - - /* "talib/func.pyx":6367 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__822 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__822)) __PYX_ERR(0, 6367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__822); - __Pyx_GIVEREF(__pyx_tuple__822); - - /* "talib/func.pyx":6369 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__823 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__823)) __PYX_ERR(0, 6369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__823); - __Pyx_GIVEREF(__pyx_tuple__823); - - /* "talib/func.pyx":6374 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__824 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__824)) __PYX_ERR(0, 6374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__824); - __Pyx_GIVEREF(__pyx_tuple__824); - - /* "talib/func.pyx":6376 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__825 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__825)) __PYX_ERR(0, 6376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__825); - __Pyx_GIVEREF(__pyx_tuple__825); - - /* "talib/func.pyx":6381 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__826 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__826)) __PYX_ERR(0, 6381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__826); - __Pyx_GIVEREF(__pyx_tuple__826); - - /* "talib/func.pyx":6383 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__827 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__827)) __PYX_ERR(0, 6383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__827); - __Pyx_GIVEREF(__pyx_tuple__827); - - /* "talib/func.pyx":6389 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__828 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__828)) __PYX_ERR(0, 6389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__828); - __Pyx_GIVEREF(__pyx_tuple__828); - - /* "talib/func.pyx":6391 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__829 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__829)) __PYX_ERR(0, 6391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__829); - __Pyx_GIVEREF(__pyx_tuple__829); - - /* "talib/func.pyx":6393 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__830 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__830)) __PYX_ERR(0, 6393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__830); - __Pyx_GIVEREF(__pyx_tuple__830); - - /* "talib/func.pyx":6411 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUNIQUE3RIVER_Lookback( ) - */ - __pyx_tuple__831 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__831)) __PYX_ERR(0, 6411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__831); - __Pyx_GIVEREF(__pyx_tuple__831); - - /* "talib/func.pyx":6448 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__832 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__832)) __PYX_ERR(0, 6448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__832); - __Pyx_GIVEREF(__pyx_tuple__832); - - /* "talib/func.pyx":6450 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__833 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__833)) __PYX_ERR(0, 6450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__833); - __Pyx_GIVEREF(__pyx_tuple__833); - - /* "talib/func.pyx":6455 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__834 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__834)) __PYX_ERR(0, 6455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__834); - __Pyx_GIVEREF(__pyx_tuple__834); - - /* "talib/func.pyx":6457 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__835 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__835)) __PYX_ERR(0, 6457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__835); - __Pyx_GIVEREF(__pyx_tuple__835); - - /* "talib/func.pyx":6462 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__836 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__836)) __PYX_ERR(0, 6462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__836); - __Pyx_GIVEREF(__pyx_tuple__836); - - /* "talib/func.pyx":6464 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__837 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__837)) __PYX_ERR(0, 6464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__837); - __Pyx_GIVEREF(__pyx_tuple__837); - - /* "talib/func.pyx":6469 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__838 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__838)) __PYX_ERR(0, 6469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__838); - __Pyx_GIVEREF(__pyx_tuple__838); - - /* "talib/func.pyx":6471 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__839 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__839)) __PYX_ERR(0, 6471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__839); - __Pyx_GIVEREF(__pyx_tuple__839); - - /* "talib/func.pyx":6477 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__840 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__840)) __PYX_ERR(0, 6477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__840); - __Pyx_GIVEREF(__pyx_tuple__840); - - /* "talib/func.pyx":6479 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__841 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__841)) __PYX_ERR(0, 6479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__841); - __Pyx_GIVEREF(__pyx_tuple__841); - - /* "talib/func.pyx":6481 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__842 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__842)) __PYX_ERR(0, 6481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__842); - __Pyx_GIVEREF(__pyx_tuple__842); - - /* "talib/func.pyx":6499 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLUPSIDEGAP2CROWS_Lookback( ) - */ - __pyx_tuple__843 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__843)) __PYX_ERR(0, 6499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__843); - __Pyx_GIVEREF(__pyx_tuple__843); - - /* "talib/func.pyx":6536 - * int* outinteger_data - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__844 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__844)) __PYX_ERR(0, 6536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__844); - __Pyx_GIVEREF(__pyx_tuple__844); - - /* "talib/func.pyx":6538 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__845 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__845)) __PYX_ERR(0, 6538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__845); - __Pyx_GIVEREF(__pyx_tuple__845); - - /* "talib/func.pyx":6543 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__846 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__846)) __PYX_ERR(0, 6543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__846); - __Pyx_GIVEREF(__pyx_tuple__846); - - /* "talib/func.pyx":6545 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__847 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__847)) __PYX_ERR(0, 6545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__847); - __Pyx_GIVEREF(__pyx_tuple__847); - - /* "talib/func.pyx":6550 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__848 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__848)) __PYX_ERR(0, 6550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__848); - __Pyx_GIVEREF(__pyx_tuple__848); - - /* "talib/func.pyx":6552 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__849 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__849)) __PYX_ERR(0, 6552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__849); - __Pyx_GIVEREF(__pyx_tuple__849); - - /* "talib/func.pyx":6557 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__850 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__850)) __PYX_ERR(0, 6557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__850); - __Pyx_GIVEREF(__pyx_tuple__850); - - /* "talib/func.pyx":6559 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__851 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__851)) __PYX_ERR(0, 6559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__851); - __Pyx_GIVEREF(__pyx_tuple__851); - - /* "talib/func.pyx":6565 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__852 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__852)) __PYX_ERR(0, 6565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__852); - __Pyx_GIVEREF(__pyx_tuple__852); - - /* "talib/func.pyx":6567 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__853 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__853)) __PYX_ERR(0, 6567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__853); - __Pyx_GIVEREF(__pyx_tuple__853); - - /* "talib/func.pyx":6569 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__854 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__854)) __PYX_ERR(0, 6569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__854); - __Pyx_GIVEREF(__pyx_tuple__854); - - /* "talib/func.pyx":6587 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CDLXSIDEGAP3METHODS_Lookback( ) - */ - __pyx_tuple__855 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__855)) __PYX_ERR(0, 6587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__855); - __Pyx_GIVEREF(__pyx_tuple__855); - - /* "talib/func.pyx":6621 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__856 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__856)) __PYX_ERR(0, 6621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__856); - __Pyx_GIVEREF(__pyx_tuple__856); - - /* "talib/func.pyx":6623 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__857 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__857)) __PYX_ERR(0, 6623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__857); - __Pyx_GIVEREF(__pyx_tuple__857); - - /* "talib/func.pyx":6636 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CEIL_Lookback( ) - */ - __pyx_tuple__858 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__858)) __PYX_ERR(0, 6636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__858); - __Pyx_GIVEREF(__pyx_tuple__858); - - /* "talib/func.pyx":6672 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__859 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__859)) __PYX_ERR(0, 6672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__859); - __Pyx_GIVEREF(__pyx_tuple__859); - - /* "talib/func.pyx":6674 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__860 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__860)) __PYX_ERR(0, 6674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__860); - __Pyx_GIVEREF(__pyx_tuple__860); - - /* "talib/func.pyx":6687 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CMO_Lookback( timeperiod ) - */ - __pyx_tuple__861 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__861)) __PYX_ERR(0, 6687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__861); - __Pyx_GIVEREF(__pyx_tuple__861); - - /* "talib/func.pyx":6725 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__862 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__862)) __PYX_ERR(0, 6725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__862); - __Pyx_GIVEREF(__pyx_tuple__862); - - /* "talib/func.pyx":6727 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__863 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__863)) __PYX_ERR(0, 6727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__863); - __Pyx_GIVEREF(__pyx_tuple__863); - - /* "talib/func.pyx":6732 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__864 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__864)) __PYX_ERR(0, 6732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__864); - __Pyx_GIVEREF(__pyx_tuple__864); - - /* "talib/func.pyx":6734 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__865 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__865)) __PYX_ERR(0, 6734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__865); - __Pyx_GIVEREF(__pyx_tuple__865); - - /* "talib/func.pyx":6740 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__866 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__866)) __PYX_ERR(0, 6740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__866); - __Pyx_GIVEREF(__pyx_tuple__866); - - /* "talib/func.pyx":6752 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_CORREL_Lookback( timeperiod ) - */ - __pyx_tuple__867 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__867)) __PYX_ERR(0, 6752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__867); - __Pyx_GIVEREF(__pyx_tuple__867); - - /* "talib/func.pyx":6786 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__868 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__868)) __PYX_ERR(0, 6786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__868); - __Pyx_GIVEREF(__pyx_tuple__868); - - /* "talib/func.pyx":6788 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__869 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__869)) __PYX_ERR(0, 6788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__869); - __Pyx_GIVEREF(__pyx_tuple__869); - - /* "talib/func.pyx":6801 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COS_Lookback( ) - */ - __pyx_tuple__870 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__870)) __PYX_ERR(0, 6801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__870); - __Pyx_GIVEREF(__pyx_tuple__870); - - /* "talib/func.pyx":6835 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__871 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__871)) __PYX_ERR(0, 6835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__871); - __Pyx_GIVEREF(__pyx_tuple__871); - - /* "talib/func.pyx":6837 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__872 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__872)) __PYX_ERR(0, 6837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__872); - __Pyx_GIVEREF(__pyx_tuple__872); - - /* "talib/func.pyx":6850 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_COSH_Lookback( ) - */ - __pyx_tuple__873 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__873)) __PYX_ERR(0, 6850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__873); - __Pyx_GIVEREF(__pyx_tuple__873); - - /* "talib/func.pyx":6886 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__874 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__874)) __PYX_ERR(0, 6886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__874); - __Pyx_GIVEREF(__pyx_tuple__874); - - /* "talib/func.pyx":6888 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__875 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__875)) __PYX_ERR(0, 6888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__875); - __Pyx_GIVEREF(__pyx_tuple__875); - - /* "talib/func.pyx":6901 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DEMA_Lookback( timeperiod ) - */ - __pyx_tuple__876 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__876)) __PYX_ERR(0, 6901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__876); - __Pyx_GIVEREF(__pyx_tuple__876); - - /* "talib/func.pyx":6937 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__877 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__877)) __PYX_ERR(0, 6937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__877); - __Pyx_GIVEREF(__pyx_tuple__877); - - /* "talib/func.pyx":6939 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__878 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__878)) __PYX_ERR(0, 6939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__878); - __Pyx_GIVEREF(__pyx_tuple__878); - - /* "talib/func.pyx":6944 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__879 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__879)) __PYX_ERR(0, 6944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__879); - __Pyx_GIVEREF(__pyx_tuple__879); - - /* "talib/func.pyx":6946 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__880 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__880)) __PYX_ERR(0, 6946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__880); - __Pyx_GIVEREF(__pyx_tuple__880); - - /* "talib/func.pyx":6952 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__881 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__881)) __PYX_ERR(0, 6952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__881); - __Pyx_GIVEREF(__pyx_tuple__881); - - /* "talib/func.pyx":6964 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DIV_Lookback( ) - */ - __pyx_tuple__882 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__882)) __PYX_ERR(0, 6964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__882); - __Pyx_GIVEREF(__pyx_tuple__882); - - /* "talib/func.pyx":7002 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__883 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__883)) __PYX_ERR(0, 7002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__883); - __Pyx_GIVEREF(__pyx_tuple__883); - - /* "talib/func.pyx":7004 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__884 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__884)) __PYX_ERR(0, 7004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__884); - __Pyx_GIVEREF(__pyx_tuple__884); - - /* "talib/func.pyx":7009 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__885 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__885)) __PYX_ERR(0, 7009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__885); - __Pyx_GIVEREF(__pyx_tuple__885); - - /* "talib/func.pyx":7011 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__886 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__886)) __PYX_ERR(0, 7011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__886); - __Pyx_GIVEREF(__pyx_tuple__886); - - /* "talib/func.pyx":7016 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__887 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__887)) __PYX_ERR(0, 7016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__887); - __Pyx_GIVEREF(__pyx_tuple__887); - - /* "talib/func.pyx":7018 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__888 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__888)) __PYX_ERR(0, 7018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__888); - __Pyx_GIVEREF(__pyx_tuple__888); - - /* "talib/func.pyx":7024 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__889 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__889)) __PYX_ERR(0, 7024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__889); - __Pyx_GIVEREF(__pyx_tuple__889); - - /* "talib/func.pyx":7026 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__890 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__890)) __PYX_ERR(0, 7026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__890); - __Pyx_GIVEREF(__pyx_tuple__890); - - /* "talib/func.pyx":7041 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_DX_Lookback( timeperiod ) - */ - __pyx_tuple__891 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__891)) __PYX_ERR(0, 7041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__891); - __Pyx_GIVEREF(__pyx_tuple__891); - - /* "talib/func.pyx":7077 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__892 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__892)) __PYX_ERR(0, 7077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__892); - __Pyx_GIVEREF(__pyx_tuple__892); - - /* "talib/func.pyx":7079 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__893 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__893)) __PYX_ERR(0, 7079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__893); - __Pyx_GIVEREF(__pyx_tuple__893); - - /* "talib/func.pyx":7092 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EMA_Lookback( timeperiod ) - */ - __pyx_tuple__894 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__894)) __PYX_ERR(0, 7092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__894); - __Pyx_GIVEREF(__pyx_tuple__894); - - /* "talib/func.pyx":7126 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__895 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__895)) __PYX_ERR(0, 7126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__895); - __Pyx_GIVEREF(__pyx_tuple__895); - - /* "talib/func.pyx":7128 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__896 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__896)) __PYX_ERR(0, 7128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__896); - __Pyx_GIVEREF(__pyx_tuple__896); - - /* "talib/func.pyx":7141 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_EXP_Lookback( ) - */ - __pyx_tuple__897 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__897)) __PYX_ERR(0, 7141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__897); - __Pyx_GIVEREF(__pyx_tuple__897); - - /* "talib/func.pyx":7175 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__898 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__898)) __PYX_ERR(0, 7175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__898); - __Pyx_GIVEREF(__pyx_tuple__898); - - /* "talib/func.pyx":7177 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__899 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__899)) __PYX_ERR(0, 7177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__899); - __Pyx_GIVEREF(__pyx_tuple__899); - - /* "talib/func.pyx":7190 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_FLOOR_Lookback( ) - */ - __pyx_tuple__900 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__900)) __PYX_ERR(0, 7190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__900); - __Pyx_GIVEREF(__pyx_tuple__900); - - /* "talib/func.pyx":7224 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__901 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__901)) __PYX_ERR(0, 7224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__901); - __Pyx_GIVEREF(__pyx_tuple__901); - - /* "talib/func.pyx":7226 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__902 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__902)) __PYX_ERR(0, 7226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__902); - __Pyx_GIVEREF(__pyx_tuple__902); - - /* "talib/func.pyx":7239 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPERIOD_Lookback( ) - */ - __pyx_tuple__903 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__903)) __PYX_ERR(0, 7239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__903); - __Pyx_GIVEREF(__pyx_tuple__903); - - /* "talib/func.pyx":7273 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__904 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__904)) __PYX_ERR(0, 7273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__904); - __Pyx_GIVEREF(__pyx_tuple__904); - - /* "talib/func.pyx":7275 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__905 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__905)) __PYX_ERR(0, 7275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__905); - __Pyx_GIVEREF(__pyx_tuple__905); - - /* "talib/func.pyx":7288 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_DCPHASE_Lookback( ) - */ - __pyx_tuple__906 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__906)) __PYX_ERR(0, 7288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__906); - __Pyx_GIVEREF(__pyx_tuple__906); - - /* "talib/func.pyx":7325 - * double* outquadrature_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__907 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__907)) __PYX_ERR(0, 7325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__907); - __Pyx_GIVEREF(__pyx_tuple__907); - - /* "talib/func.pyx":7327 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__908 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__908)) __PYX_ERR(0, 7327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__908); - __Pyx_GIVEREF(__pyx_tuple__908); - - /* "talib/func.pyx":7340 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_PHASOR_Lookback( ) - */ - __pyx_tuple__909 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__909)) __PYX_ERR(0, 7340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__909); - __Pyx_GIVEREF(__pyx_tuple__909); - - /* "talib/func.pyx":7381 - * double* outleadsine_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__910 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__910)) __PYX_ERR(0, 7381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__910); - __Pyx_GIVEREF(__pyx_tuple__910); - - /* "talib/func.pyx":7383 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__911 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__911)) __PYX_ERR(0, 7383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__911); - __Pyx_GIVEREF(__pyx_tuple__911); - - /* "talib/func.pyx":7396 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_SINE_Lookback( ) - */ - __pyx_tuple__912 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__912)) __PYX_ERR(0, 7396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__912); - __Pyx_GIVEREF(__pyx_tuple__912); - - /* "talib/func.pyx":7434 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__913 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__913)) __PYX_ERR(0, 7434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__913); - __Pyx_GIVEREF(__pyx_tuple__913); - - /* "talib/func.pyx":7436 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__914 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__914)) __PYX_ERR(0, 7436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__914); - __Pyx_GIVEREF(__pyx_tuple__914); - - /* "talib/func.pyx":7449 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDLINE_Lookback( ) - */ - __pyx_tuple__915 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__915)) __PYX_ERR(0, 7449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__915); - __Pyx_GIVEREF(__pyx_tuple__915); - - /* "talib/func.pyx":7483 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__916 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__916)) __PYX_ERR(0, 7483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__916); - __Pyx_GIVEREF(__pyx_tuple__916); - - /* "talib/func.pyx":7485 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__917 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__917)) __PYX_ERR(0, 7485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__917); - __Pyx_GIVEREF(__pyx_tuple__917); - - /* "talib/func.pyx":7498 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_HT_TRENDMODE_Lookback( ) - */ - __pyx_tuple__918 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__918)) __PYX_ERR(0, 7498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__918); - __Pyx_GIVEREF(__pyx_tuple__918); - - /* "talib/func.pyx":7534 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__919 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__919)) __PYX_ERR(0, 7534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__919); - __Pyx_GIVEREF(__pyx_tuple__919); - - /* "talib/func.pyx":7536 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__920 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__920)) __PYX_ERR(0, 7536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__920); - __Pyx_GIVEREF(__pyx_tuple__920); - - /* "talib/func.pyx":7549 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_KAMA_Lookback( timeperiod ) - */ - __pyx_tuple__921 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__921)) __PYX_ERR(0, 7549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__921); - __Pyx_GIVEREF(__pyx_tuple__921); - - /* "talib/func.pyx":7585 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__922 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__922)) __PYX_ERR(0, 7585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__922); - __Pyx_GIVEREF(__pyx_tuple__922); - - /* "talib/func.pyx":7587 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__923 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__923)) __PYX_ERR(0, 7587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__923); - __Pyx_GIVEREF(__pyx_tuple__923); - - /* "talib/func.pyx":7600 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_Lookback( timeperiod ) - */ - __pyx_tuple__924 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__924)) __PYX_ERR(0, 7600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__924); - __Pyx_GIVEREF(__pyx_tuple__924); - - /* "talib/func.pyx":7636 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__925 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__925)) __PYX_ERR(0, 7636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__925); - __Pyx_GIVEREF(__pyx_tuple__925); - - /* "talib/func.pyx":7638 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__926 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__926)) __PYX_ERR(0, 7638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__926); - __Pyx_GIVEREF(__pyx_tuple__926); - - /* "talib/func.pyx":7651 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_ANGLE_Lookback( timeperiod ) - */ - __pyx_tuple__927 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__927)) __PYX_ERR(0, 7651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__927); - __Pyx_GIVEREF(__pyx_tuple__927); - - /* "talib/func.pyx":7687 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__928 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__928)) __PYX_ERR(0, 7687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__928); - __Pyx_GIVEREF(__pyx_tuple__928); - - /* "talib/func.pyx":7689 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__929 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__929)) __PYX_ERR(0, 7689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__929); - __Pyx_GIVEREF(__pyx_tuple__929); - - /* "talib/func.pyx":7702 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_INTERCEPT_Lookback( timeperiod ) - */ - __pyx_tuple__930 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__930)) __PYX_ERR(0, 7702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__930); - __Pyx_GIVEREF(__pyx_tuple__930); - - /* "talib/func.pyx":7738 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__931 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__931)) __PYX_ERR(0, 7738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__931); - __Pyx_GIVEREF(__pyx_tuple__931); - - /* "talib/func.pyx":7740 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__932 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__932)) __PYX_ERR(0, 7740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__932); - __Pyx_GIVEREF(__pyx_tuple__932); - - /* "talib/func.pyx":7753 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LINEARREG_SLOPE_Lookback( timeperiod ) - */ - __pyx_tuple__933 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__933)) __PYX_ERR(0, 7753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__933); - __Pyx_GIVEREF(__pyx_tuple__933); - - /* "talib/func.pyx":7787 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__934 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__934)) __PYX_ERR(0, 7787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__934); - __Pyx_GIVEREF(__pyx_tuple__934); - - /* "talib/func.pyx":7789 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__935 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__935)) __PYX_ERR(0, 7789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__935); - __Pyx_GIVEREF(__pyx_tuple__935); - - /* "talib/func.pyx":7802 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LN_Lookback( ) - */ - __pyx_tuple__936 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__936)) __PYX_ERR(0, 7802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__936); - __Pyx_GIVEREF(__pyx_tuple__936); - - /* "talib/func.pyx":7836 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__937 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__937)) __PYX_ERR(0, 7836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__937); - __Pyx_GIVEREF(__pyx_tuple__937); - - /* "talib/func.pyx":7838 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__938 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__938)) __PYX_ERR(0, 7838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__938); - __Pyx_GIVEREF(__pyx_tuple__938); - - /* "talib/func.pyx":7851 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_LOG10_Lookback( ) - */ - __pyx_tuple__939 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__939)) __PYX_ERR(0, 7851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__939); - __Pyx_GIVEREF(__pyx_tuple__939); - - /* "talib/func.pyx":7888 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__940 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__940)) __PYX_ERR(0, 7888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__940); - __Pyx_GIVEREF(__pyx_tuple__940); - - /* "talib/func.pyx":7890 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__941 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__941)) __PYX_ERR(0, 7890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__941); - __Pyx_GIVEREF(__pyx_tuple__941); - - /* "talib/func.pyx":7903 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MA_Lookback( timeperiod , matype ) - */ - __pyx_tuple__942 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__942)) __PYX_ERR(0, 7903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__942); - __Pyx_GIVEREF(__pyx_tuple__942); - - /* "talib/func.pyx":7947 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__943 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__943)) __PYX_ERR(0, 7947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__943); - __Pyx_GIVEREF(__pyx_tuple__943); - - /* "talib/func.pyx":7949 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__944 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__944)) __PYX_ERR(0, 7949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__944); - __Pyx_GIVEREF(__pyx_tuple__944); - - /* "talib/func.pyx":7962 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACD_Lookback( fastperiod , slowperiod , signalperiod ) - */ - __pyx_tuple__945 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__945)) __PYX_ERR(0, 7962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__945); - __Pyx_GIVEREF(__pyx_tuple__945); - - /* "talib/func.pyx":8017 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__946 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__946)) __PYX_ERR(0, 8017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__946); - __Pyx_GIVEREF(__pyx_tuple__946); - - /* "talib/func.pyx":8019 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__947 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__947)) __PYX_ERR(0, 8019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__947); - __Pyx_GIVEREF(__pyx_tuple__947); - - /* "talib/func.pyx":8032 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDEXT_Lookback( fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype ) - */ - __pyx_tuple__948 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__948)) __PYX_ERR(0, 8032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__948); - __Pyx_GIVEREF(__pyx_tuple__948); - - /* "talib/func.pyx":8082 - * double* outmacdhist_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__949 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__949)) __PYX_ERR(0, 8082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__949); - __Pyx_GIVEREF(__pyx_tuple__949); - - /* "talib/func.pyx":8084 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__950 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__950)) __PYX_ERR(0, 8084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__950); - __Pyx_GIVEREF(__pyx_tuple__950); - - /* "talib/func.pyx":8097 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MACDFIX_Lookback( signalperiod ) - */ - __pyx_tuple__951 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__951)) __PYX_ERR(0, 8097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__951); - __Pyx_GIVEREF(__pyx_tuple__951); - - /* "talib/func.pyx":8145 - * double* outfama_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__952 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__952)) __PYX_ERR(0, 8145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__952); - __Pyx_GIVEREF(__pyx_tuple__952); - - /* "talib/func.pyx":8147 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__953 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__953)) __PYX_ERR(0, 8147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__953); - __Pyx_GIVEREF(__pyx_tuple__953); - - /* "talib/func.pyx":8160 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAMA_Lookback( fastlimit , slowlimit ) - */ - __pyx_tuple__954 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__954)) __PYX_ERR(0, 8160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__954); - __Pyx_GIVEREF(__pyx_tuple__954); - - /* "talib/func.pyx":8204 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__955 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__955)) __PYX_ERR(0, 8204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__955); - __Pyx_GIVEREF(__pyx_tuple__955); - - /* "talib/func.pyx":8206 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__956 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__956)) __PYX_ERR(0, 8206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__956); - __Pyx_GIVEREF(__pyx_tuple__956); - - /* "talib/func.pyx":8211 - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") # <<<<<<<<<<<<<< - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - */ - __pyx_tuple__957 = PyTuple_Pack(1, __pyx_kp_s_periods_is_not_double); if (unlikely(!__pyx_tuple__957)) __PYX_ERR(0, 8211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__957); - __Pyx_GIVEREF(__pyx_tuple__957); - - /* "talib/func.pyx":8213 - * raise Exception("periods is not double") - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - */ - __pyx_tuple__958 = PyTuple_Pack(1, __pyx_kp_s_periods_has_wrong_dimensions); if (unlikely(!__pyx_tuple__958)) __PYX_ERR(0, 8213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__958); - __Pyx_GIVEREF(__pyx_tuple__958); - - /* "talib/func.pyx":8219 - * length = real.shape[0] - * if length != periods.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__959 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__959)) __PYX_ERR(0, 8219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__959); - __Pyx_GIVEREF(__pyx_tuple__959); - - /* "talib/func.pyx":8231 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAVP_Lookback( minperiod , maxperiod , matype ) - */ - __pyx_tuple__960 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__960)) __PYX_ERR(0, 8231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__960); - __Pyx_GIVEREF(__pyx_tuple__960); - - /* "talib/func.pyx":8267 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__961 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__961)) __PYX_ERR(0, 8267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__961); - __Pyx_GIVEREF(__pyx_tuple__961); - - /* "talib/func.pyx":8269 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__962 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__962)) __PYX_ERR(0, 8269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__962); - __Pyx_GIVEREF(__pyx_tuple__962); - - /* "talib/func.pyx":8282 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAX_Lookback( timeperiod ) - */ - __pyx_tuple__963 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__963)) __PYX_ERR(0, 8282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__963); - __Pyx_GIVEREF(__pyx_tuple__963); - - /* "talib/func.pyx":8318 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__964 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__964)) __PYX_ERR(0, 8318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__964); - __Pyx_GIVEREF(__pyx_tuple__964); - - /* "talib/func.pyx":8320 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__965 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__965)) __PYX_ERR(0, 8320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__965); - __Pyx_GIVEREF(__pyx_tuple__965); - - /* "talib/func.pyx":8333 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MAXINDEX_Lookback( timeperiod ) - */ - __pyx_tuple__966 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__966)) __PYX_ERR(0, 8333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__966); - __Pyx_GIVEREF(__pyx_tuple__966); - - /* "talib/func.pyx":8368 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__967 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__967)) __PYX_ERR(0, 8368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__967); - __Pyx_GIVEREF(__pyx_tuple__967); - - /* "talib/func.pyx":8370 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__968 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__968)) __PYX_ERR(0, 8370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__968); - __Pyx_GIVEREF(__pyx_tuple__968); - - /* "talib/func.pyx":8375 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__969 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__969)) __PYX_ERR(0, 8375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__969); - __Pyx_GIVEREF(__pyx_tuple__969); - - /* "talib/func.pyx":8377 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__970 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__970)) __PYX_ERR(0, 8377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__970); - __Pyx_GIVEREF(__pyx_tuple__970); - - /* "talib/func.pyx":8383 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__971 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__971)) __PYX_ERR(0, 8383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__971); - __Pyx_GIVEREF(__pyx_tuple__971); - - /* "talib/func.pyx":8395 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MEDPRICE_Lookback( ) - */ - __pyx_tuple__972 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__972)) __PYX_ERR(0, 8395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__972); - __Pyx_GIVEREF(__pyx_tuple__972); - - /* "talib/func.pyx":8434 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__973 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__973)) __PYX_ERR(0, 8434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__973); - __Pyx_GIVEREF(__pyx_tuple__973); - - /* "talib/func.pyx":8436 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__974 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__974)) __PYX_ERR(0, 8436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__974); - __Pyx_GIVEREF(__pyx_tuple__974); - - /* "talib/func.pyx":8441 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__975 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__975)) __PYX_ERR(0, 8441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__975); - __Pyx_GIVEREF(__pyx_tuple__975); - - /* "talib/func.pyx":8443 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__976 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__976)) __PYX_ERR(0, 8443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__976); - __Pyx_GIVEREF(__pyx_tuple__976); - - /* "talib/func.pyx":8448 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__977 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__977)) __PYX_ERR(0, 8448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__977); - __Pyx_GIVEREF(__pyx_tuple__977); - - /* "talib/func.pyx":8450 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__978 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__978)) __PYX_ERR(0, 8450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__978); - __Pyx_GIVEREF(__pyx_tuple__978); - - /* "talib/func.pyx":8455 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__979 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__979)) __PYX_ERR(0, 8455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__979); - __Pyx_GIVEREF(__pyx_tuple__979); - - /* "talib/func.pyx":8457 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__980 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__980)) __PYX_ERR(0, 8457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__980); - __Pyx_GIVEREF(__pyx_tuple__980); - - /* "talib/func.pyx":8463 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__981 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__981)) __PYX_ERR(0, 8463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__981); - __Pyx_GIVEREF(__pyx_tuple__981); - - /* "talib/func.pyx":8465 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__982 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__982)) __PYX_ERR(0, 8465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__982); - __Pyx_GIVEREF(__pyx_tuple__982); - - /* "talib/func.pyx":8467 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__983 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__983)) __PYX_ERR(0, 8467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__983); - __Pyx_GIVEREF(__pyx_tuple__983); - - /* "talib/func.pyx":8485 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MFI_Lookback( timeperiod ) - */ - __pyx_tuple__984 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__984)) __PYX_ERR(0, 8485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__984); - __Pyx_GIVEREF(__pyx_tuple__984); - - /* "talib/func.pyx":8521 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__985 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__985)) __PYX_ERR(0, 8521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__985); - __Pyx_GIVEREF(__pyx_tuple__985); - - /* "talib/func.pyx":8523 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__986 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__986)) __PYX_ERR(0, 8523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__986); - __Pyx_GIVEREF(__pyx_tuple__986); - - /* "talib/func.pyx":8536 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPOINT_Lookback( timeperiod ) - */ - __pyx_tuple__987 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__987)) __PYX_ERR(0, 8536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__987); - __Pyx_GIVEREF(__pyx_tuple__987); - - /* "talib/func.pyx":8573 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__988 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__988)) __PYX_ERR(0, 8573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__988); - __Pyx_GIVEREF(__pyx_tuple__988); - - /* "talib/func.pyx":8575 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__989 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__989)) __PYX_ERR(0, 8575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__989); - __Pyx_GIVEREF(__pyx_tuple__989); - - /* "talib/func.pyx":8580 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__990 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__990)) __PYX_ERR(0, 8580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__990); - __Pyx_GIVEREF(__pyx_tuple__990); - - /* "talib/func.pyx":8582 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__991 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__991)) __PYX_ERR(0, 8582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__991); - __Pyx_GIVEREF(__pyx_tuple__991); - - /* "talib/func.pyx":8588 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__992 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__992)) __PYX_ERR(0, 8588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__992); - __Pyx_GIVEREF(__pyx_tuple__992); - - /* "talib/func.pyx":8600 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIDPRICE_Lookback( timeperiod ) - */ - __pyx_tuple__993 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__993)) __PYX_ERR(0, 8600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__993); - __Pyx_GIVEREF(__pyx_tuple__993); - - /* "talib/func.pyx":8636 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__994 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__994)) __PYX_ERR(0, 8636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__994); - __Pyx_GIVEREF(__pyx_tuple__994); - - /* "talib/func.pyx":8638 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__995 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__995)) __PYX_ERR(0, 8638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__995); - __Pyx_GIVEREF(__pyx_tuple__995); - - /* "talib/func.pyx":8651 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MIN_Lookback( timeperiod ) - */ - __pyx_tuple__996 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__996)) __PYX_ERR(0, 8651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__996); - __Pyx_GIVEREF(__pyx_tuple__996); - - /* "talib/func.pyx":8687 - * int* outinteger_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__997 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__997)) __PYX_ERR(0, 8687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__997); - __Pyx_GIVEREF(__pyx_tuple__997); - - /* "talib/func.pyx":8689 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__998 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__998)) __PYX_ERR(0, 8689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__998); - __Pyx_GIVEREF(__pyx_tuple__998); - - /* "talib/func.pyx":8702 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MININDEX_Lookback( timeperiod ) - */ - __pyx_tuple__999 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__999)) __PYX_ERR(0, 8702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__999); - __Pyx_GIVEREF(__pyx_tuple__999); - - /* "talib/func.pyx":8741 - * double* outmax_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1000 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1000)) __PYX_ERR(0, 8741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1000); - __Pyx_GIVEREF(__pyx_tuple__1000); - - /* "talib/func.pyx":8743 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1001 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1001)) __PYX_ERR(0, 8743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1001); - __Pyx_GIVEREF(__pyx_tuple__1001); - - /* "talib/func.pyx":8756 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAX_Lookback( timeperiod ) - */ - __pyx_tuple__1002 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1002)) __PYX_ERR(0, 8756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1002); - __Pyx_GIVEREF(__pyx_tuple__1002); - - /* "talib/func.pyx":8799 - * int* outmaxidx_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1003 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1003)) __PYX_ERR(0, 8799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1003); - __Pyx_GIVEREF(__pyx_tuple__1003); - - /* "talib/func.pyx":8801 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1004 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1004)) __PYX_ERR(0, 8801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1004); - __Pyx_GIVEREF(__pyx_tuple__1004); - - /* "talib/func.pyx":8814 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINMAXINDEX_Lookback( timeperiod ) - */ - __pyx_tuple__1005 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1005)) __PYX_ERR(0, 8814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1005); - __Pyx_GIVEREF(__pyx_tuple__1005); - - /* "talib/func.pyx":8856 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1006 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1006)) __PYX_ERR(0, 8856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1006); - __Pyx_GIVEREF(__pyx_tuple__1006); - - /* "talib/func.pyx":8858 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1007 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1007)) __PYX_ERR(0, 8858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1007); - __Pyx_GIVEREF(__pyx_tuple__1007); - - /* "talib/func.pyx":8863 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1008 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1008)) __PYX_ERR(0, 8863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1008); - __Pyx_GIVEREF(__pyx_tuple__1008); - - /* "talib/func.pyx":8865 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1009 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1009)) __PYX_ERR(0, 8865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1009); - __Pyx_GIVEREF(__pyx_tuple__1009); - - /* "talib/func.pyx":8870 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1010 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1010)) __PYX_ERR(0, 8870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1010); - __Pyx_GIVEREF(__pyx_tuple__1010); - - /* "talib/func.pyx":8872 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1011 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1011)) __PYX_ERR(0, 8872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1011); - __Pyx_GIVEREF(__pyx_tuple__1011); - - /* "talib/func.pyx":8878 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1012 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1012)) __PYX_ERR(0, 8878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1012); - __Pyx_GIVEREF(__pyx_tuple__1012); - - /* "talib/func.pyx":8880 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1013 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1013)) __PYX_ERR(0, 8880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1013); - __Pyx_GIVEREF(__pyx_tuple__1013); - - /* "talib/func.pyx":8895 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DI_Lookback( timeperiod ) - */ - __pyx_tuple__1014 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1014)) __PYX_ERR(0, 8895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1014); - __Pyx_GIVEREF(__pyx_tuple__1014); - - /* "talib/func.pyx":8932 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1015 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1015)) __PYX_ERR(0, 8932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1015); - __Pyx_GIVEREF(__pyx_tuple__1015); - - /* "talib/func.pyx":8934 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1016 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1016)) __PYX_ERR(0, 8934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1016); - __Pyx_GIVEREF(__pyx_tuple__1016); - - /* "talib/func.pyx":8939 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1017 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1017)) __PYX_ERR(0, 8939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1017); - __Pyx_GIVEREF(__pyx_tuple__1017); - - /* "talib/func.pyx":8941 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1018 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1018)) __PYX_ERR(0, 8941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1018); - __Pyx_GIVEREF(__pyx_tuple__1018); - - /* "talib/func.pyx":8947 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1019 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1019)) __PYX_ERR(0, 8947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1019); - __Pyx_GIVEREF(__pyx_tuple__1019); - - /* "talib/func.pyx":8959 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MINUS_DM_Lookback( timeperiod ) - */ - __pyx_tuple__1020 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1020)) __PYX_ERR(0, 8959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1020); - __Pyx_GIVEREF(__pyx_tuple__1020); - - /* "talib/func.pyx":8995 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1021 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1021)) __PYX_ERR(0, 8995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1021); - __Pyx_GIVEREF(__pyx_tuple__1021); - - /* "talib/func.pyx":8997 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1022 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1022)) __PYX_ERR(0, 8997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1022); - __Pyx_GIVEREF(__pyx_tuple__1022); - - /* "talib/func.pyx":9010 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MOM_Lookback( timeperiod ) - */ - __pyx_tuple__1023 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1023)) __PYX_ERR(0, 9010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1023); - __Pyx_GIVEREF(__pyx_tuple__1023); - - /* "talib/func.pyx":9046 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__1024 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1024)) __PYX_ERR(0, 9046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1024); - __Pyx_GIVEREF(__pyx_tuple__1024); - - /* "talib/func.pyx":9048 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__1025 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1025)) __PYX_ERR(0, 9048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1025); - __Pyx_GIVEREF(__pyx_tuple__1025); - - /* "talib/func.pyx":9053 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__1026 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1026)) __PYX_ERR(0, 9053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1026); - __Pyx_GIVEREF(__pyx_tuple__1026); - - /* "talib/func.pyx":9055 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__1027 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1027)) __PYX_ERR(0, 9055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1027); - __Pyx_GIVEREF(__pyx_tuple__1027); - - /* "talib/func.pyx":9061 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1028 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1028)) __PYX_ERR(0, 9061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1028); - __Pyx_GIVEREF(__pyx_tuple__1028); - - /* "talib/func.pyx":9073 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_MULT_Lookback( ) - */ - __pyx_tuple__1029 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1029)) __PYX_ERR(0, 9073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1029); - __Pyx_GIVEREF(__pyx_tuple__1029); - - /* "talib/func.pyx":9111 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1030 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1030)) __PYX_ERR(0, 9111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1030); - __Pyx_GIVEREF(__pyx_tuple__1030); - - /* "talib/func.pyx":9113 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1031 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1031)) __PYX_ERR(0, 9113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1031); - __Pyx_GIVEREF(__pyx_tuple__1031); - - /* "talib/func.pyx":9118 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1032 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1032)) __PYX_ERR(0, 9118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1032); - __Pyx_GIVEREF(__pyx_tuple__1032); - - /* "talib/func.pyx":9120 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1033 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1033)) __PYX_ERR(0, 9120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1033); - __Pyx_GIVEREF(__pyx_tuple__1033); - - /* "talib/func.pyx":9125 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1034 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1034)) __PYX_ERR(0, 9125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1034); - __Pyx_GIVEREF(__pyx_tuple__1034); - - /* "talib/func.pyx":9127 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1035 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1035)) __PYX_ERR(0, 9127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1035); - __Pyx_GIVEREF(__pyx_tuple__1035); - - /* "talib/func.pyx":9133 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1036 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1036)) __PYX_ERR(0, 9133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1036); - __Pyx_GIVEREF(__pyx_tuple__1036); - - /* "talib/func.pyx":9135 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1037 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1037)) __PYX_ERR(0, 9135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1037); - __Pyx_GIVEREF(__pyx_tuple__1037); - - /* "talib/func.pyx":9150 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_NATR_Lookback( timeperiod ) - */ - __pyx_tuple__1038 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1038)) __PYX_ERR(0, 9150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1038); - __Pyx_GIVEREF(__pyx_tuple__1038); - - /* "talib/func.pyx":9186 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1039 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1039)) __PYX_ERR(0, 9186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1039); - __Pyx_GIVEREF(__pyx_tuple__1039); - - /* "talib/func.pyx":9188 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1040 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1040)) __PYX_ERR(0, 9188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1040); - __Pyx_GIVEREF(__pyx_tuple__1040); - - /* "talib/func.pyx":9193 - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__1041 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__1041)) __PYX_ERR(0, 9193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1041); - __Pyx_GIVEREF(__pyx_tuple__1041); - - /* "talib/func.pyx":9195 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__1042 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1042)) __PYX_ERR(0, 9195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1042); - __Pyx_GIVEREF(__pyx_tuple__1042); - - /* "talib/func.pyx":9201 - * length = real.shape[0] - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1043 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1043)) __PYX_ERR(0, 9201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1043); - __Pyx_GIVEREF(__pyx_tuple__1043); - - /* "talib/func.pyx":9213 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_OBV_Lookback( ) - */ - __pyx_tuple__1044 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1044)) __PYX_ERR(0, 9213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1044); - __Pyx_GIVEREF(__pyx_tuple__1044); - - /* "talib/func.pyx":9251 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1045 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1045)) __PYX_ERR(0, 9251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1045); - __Pyx_GIVEREF(__pyx_tuple__1045); - - /* "talib/func.pyx":9253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1046 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1046)) __PYX_ERR(0, 9253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1046); - __Pyx_GIVEREF(__pyx_tuple__1046); - - /* "talib/func.pyx":9258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1047 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1047)) __PYX_ERR(0, 9258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1047); - __Pyx_GIVEREF(__pyx_tuple__1047); - - /* "talib/func.pyx":9260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1048 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1048)) __PYX_ERR(0, 9260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1048); - __Pyx_GIVEREF(__pyx_tuple__1048); - - /* "talib/func.pyx":9265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1049 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1049)) __PYX_ERR(0, 9265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1049); - __Pyx_GIVEREF(__pyx_tuple__1049); - - /* "talib/func.pyx":9267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1050 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1050)) __PYX_ERR(0, 9267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1050); - __Pyx_GIVEREF(__pyx_tuple__1050); - - /* "talib/func.pyx":9273 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1051 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1051)) __PYX_ERR(0, 9273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1051); - __Pyx_GIVEREF(__pyx_tuple__1051); - - /* "talib/func.pyx":9275 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1052 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1052)) __PYX_ERR(0, 9275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1052); - __Pyx_GIVEREF(__pyx_tuple__1052); - - /* "talib/func.pyx":9290 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DI_Lookback( timeperiod ) - */ - __pyx_tuple__1053 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1053)) __PYX_ERR(0, 9290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1053); - __Pyx_GIVEREF(__pyx_tuple__1053); - - /* "talib/func.pyx":9327 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1054 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1054)) __PYX_ERR(0, 9327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1054); - __Pyx_GIVEREF(__pyx_tuple__1054); - - /* "talib/func.pyx":9329 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1055 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1055)) __PYX_ERR(0, 9329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1055); - __Pyx_GIVEREF(__pyx_tuple__1055); - - /* "talib/func.pyx":9334 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1056 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1056)) __PYX_ERR(0, 9334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1056); - __Pyx_GIVEREF(__pyx_tuple__1056); - - /* "talib/func.pyx":9336 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1057 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1057)) __PYX_ERR(0, 9336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1057); - __Pyx_GIVEREF(__pyx_tuple__1057); - - /* "talib/func.pyx":9342 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1058 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1058)) __PYX_ERR(0, 9342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1058); - __Pyx_GIVEREF(__pyx_tuple__1058); - - /* "talib/func.pyx":9354 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PLUS_DM_Lookback( timeperiod ) - */ - __pyx_tuple__1059 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1059)) __PYX_ERR(0, 9354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1059); - __Pyx_GIVEREF(__pyx_tuple__1059); - - /* "talib/func.pyx":9392 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1060 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1060)) __PYX_ERR(0, 9392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1060); - __Pyx_GIVEREF(__pyx_tuple__1060); - - /* "talib/func.pyx":9394 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1061 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1061)) __PYX_ERR(0, 9394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1061); - __Pyx_GIVEREF(__pyx_tuple__1061); - - /* "talib/func.pyx":9407 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_PPO_Lookback( fastperiod , slowperiod , matype ) - */ - __pyx_tuple__1062 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1062)) __PYX_ERR(0, 9407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1062); - __Pyx_GIVEREF(__pyx_tuple__1062); - - /* "talib/func.pyx":9443 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1063 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1063)) __PYX_ERR(0, 9443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1063); - __Pyx_GIVEREF(__pyx_tuple__1063); - - /* "talib/func.pyx":9445 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1064 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1064)) __PYX_ERR(0, 9445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1064); - __Pyx_GIVEREF(__pyx_tuple__1064); - - /* "talib/func.pyx":9458 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROC_Lookback( timeperiod ) - */ - __pyx_tuple__1065 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1065)) __PYX_ERR(0, 9458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1065); - __Pyx_GIVEREF(__pyx_tuple__1065); - - /* "talib/func.pyx":9494 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1066 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1066)) __PYX_ERR(0, 9494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1066); - __Pyx_GIVEREF(__pyx_tuple__1066); - - /* "talib/func.pyx":9496 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1067 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1067)) __PYX_ERR(0, 9496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1067); - __Pyx_GIVEREF(__pyx_tuple__1067); - - /* "talib/func.pyx":9509 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCP_Lookback( timeperiod ) - */ - __pyx_tuple__1068 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1068)) __PYX_ERR(0, 9509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1068); - __Pyx_GIVEREF(__pyx_tuple__1068); - - /* "talib/func.pyx":9545 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1069 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1069)) __PYX_ERR(0, 9545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1069); - __Pyx_GIVEREF(__pyx_tuple__1069); - - /* "talib/func.pyx":9547 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1070 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1070)) __PYX_ERR(0, 9547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1070); - __Pyx_GIVEREF(__pyx_tuple__1070); - - /* "talib/func.pyx":9560 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR_Lookback( timeperiod ) - */ - __pyx_tuple__1071 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1071)) __PYX_ERR(0, 9560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1071); - __Pyx_GIVEREF(__pyx_tuple__1071); - - /* "talib/func.pyx":9596 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1072 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1072)) __PYX_ERR(0, 9596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1072); - __Pyx_GIVEREF(__pyx_tuple__1072); - - /* "talib/func.pyx":9598 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1073 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1073)) __PYX_ERR(0, 9598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1073); - __Pyx_GIVEREF(__pyx_tuple__1073); - - /* "talib/func.pyx":9611 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ROCR100_Lookback( timeperiod ) - */ - __pyx_tuple__1074 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1074)) __PYX_ERR(0, 9611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1074); - __Pyx_GIVEREF(__pyx_tuple__1074); - - /* "talib/func.pyx":9647 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1075 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1075)) __PYX_ERR(0, 9647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1075); - __Pyx_GIVEREF(__pyx_tuple__1075); - - /* "talib/func.pyx":9649 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1076 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1076)) __PYX_ERR(0, 9649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1076); - __Pyx_GIVEREF(__pyx_tuple__1076); - - /* "talib/func.pyx":9662 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_RSI_Lookback( timeperiod ) - */ - __pyx_tuple__1077 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1077)) __PYX_ERR(0, 9662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1077); - __Pyx_GIVEREF(__pyx_tuple__1077); - - /* "talib/func.pyx":9700 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1078 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1078)) __PYX_ERR(0, 9700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1078); - __Pyx_GIVEREF(__pyx_tuple__1078); - - /* "talib/func.pyx":9702 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1079 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1079)) __PYX_ERR(0, 9702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1079); - __Pyx_GIVEREF(__pyx_tuple__1079); - - /* "talib/func.pyx":9707 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1080 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1080)) __PYX_ERR(0, 9707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1080); - __Pyx_GIVEREF(__pyx_tuple__1080); - - /* "talib/func.pyx":9709 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1081 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1081)) __PYX_ERR(0, 9709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1081); - __Pyx_GIVEREF(__pyx_tuple__1081); - - /* "talib/func.pyx":9715 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1082 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1082)) __PYX_ERR(0, 9715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1082); - __Pyx_GIVEREF(__pyx_tuple__1082); - - /* "talib/func.pyx":9727 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAR_Lookback( acceleration , maximum ) - */ - __pyx_tuple__1083 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1083)) __PYX_ERR(0, 9727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1083); - __Pyx_GIVEREF(__pyx_tuple__1083); - - /* "talib/func.pyx":9771 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1084 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1084)) __PYX_ERR(0, 9771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1084); - __Pyx_GIVEREF(__pyx_tuple__1084); - - /* "talib/func.pyx":9773 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1085 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1085)) __PYX_ERR(0, 9773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1085); - __Pyx_GIVEREF(__pyx_tuple__1085); - - /* "talib/func.pyx":9778 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1086 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1086)) __PYX_ERR(0, 9778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1086); - __Pyx_GIVEREF(__pyx_tuple__1086); - - /* "talib/func.pyx":9780 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1087 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1087)) __PYX_ERR(0, 9780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1087); - __Pyx_GIVEREF(__pyx_tuple__1087); - - /* "talib/func.pyx":9786 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1088 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1088)) __PYX_ERR(0, 9786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1088); - __Pyx_GIVEREF(__pyx_tuple__1088); - - /* "talib/func.pyx":9798 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SAREXT_Lookback( startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort ) - */ - __pyx_tuple__1089 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1089)) __PYX_ERR(0, 9798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1089); - __Pyx_GIVEREF(__pyx_tuple__1089); - - /* "talib/func.pyx":9832 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1090 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1090)) __PYX_ERR(0, 9832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1090); - __Pyx_GIVEREF(__pyx_tuple__1090); - - /* "talib/func.pyx":9834 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1091 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1091)) __PYX_ERR(0, 9834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1091); - __Pyx_GIVEREF(__pyx_tuple__1091); - - /* "talib/func.pyx":9847 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SIN_Lookback( ) - */ - __pyx_tuple__1092 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1092)) __PYX_ERR(0, 9847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1092); - __Pyx_GIVEREF(__pyx_tuple__1092); - - /* "talib/func.pyx":9881 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1093 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1093)) __PYX_ERR(0, 9881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1093); - __Pyx_GIVEREF(__pyx_tuple__1093); - - /* "talib/func.pyx":9883 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1094 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1094)) __PYX_ERR(0, 9883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1094); - __Pyx_GIVEREF(__pyx_tuple__1094); - - /* "talib/func.pyx":9896 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SINH_Lookback( ) - */ - __pyx_tuple__1095 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1095)) __PYX_ERR(0, 9896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1095); - __Pyx_GIVEREF(__pyx_tuple__1095); - - /* "talib/func.pyx":9932 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1096 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1096)) __PYX_ERR(0, 9932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1096); - __Pyx_GIVEREF(__pyx_tuple__1096); - - /* "talib/func.pyx":9934 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1097 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1097)) __PYX_ERR(0, 9934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1097); - __Pyx_GIVEREF(__pyx_tuple__1097); - - /* "talib/func.pyx":9947 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SMA_Lookback( timeperiod ) - */ - __pyx_tuple__1098 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1098)) __PYX_ERR(0, 9947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1098); - __Pyx_GIVEREF(__pyx_tuple__1098); - - /* "talib/func.pyx":9981 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1099 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1099)) __PYX_ERR(0, 9981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1099); - __Pyx_GIVEREF(__pyx_tuple__1099); - - /* "talib/func.pyx":9983 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1100 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1100)) __PYX_ERR(0, 9983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1100); - __Pyx_GIVEREF(__pyx_tuple__1100); - - /* "talib/func.pyx":9996 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SQRT_Lookback( ) - */ - __pyx_tuple__1101 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1101)) __PYX_ERR(0, 9996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1101); - __Pyx_GIVEREF(__pyx_tuple__1101); - - /* "talib/func.pyx":10033 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1102 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1102)) __PYX_ERR(0, 10033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1102); - __Pyx_GIVEREF(__pyx_tuple__1102); - - /* "talib/func.pyx":10035 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1103 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1103)) __PYX_ERR(0, 10035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1103); - __Pyx_GIVEREF(__pyx_tuple__1103); - - /* "talib/func.pyx":10048 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STDDEV_Lookback( timeperiod , nbdev ) - */ - __pyx_tuple__1104 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1104)) __PYX_ERR(0, 10048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1104); - __Pyx_GIVEREF(__pyx_tuple__1104); - - /* "talib/func.pyx":10093 - * double* outslowd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1105 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1105)) __PYX_ERR(0, 10093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1105); - __Pyx_GIVEREF(__pyx_tuple__1105); - - /* "talib/func.pyx":10095 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1106 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1106)) __PYX_ERR(0, 10095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1106); - __Pyx_GIVEREF(__pyx_tuple__1106); - - /* "talib/func.pyx":10100 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1107 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1107)) __PYX_ERR(0, 10100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1107); - __Pyx_GIVEREF(__pyx_tuple__1107); - - /* "talib/func.pyx":10102 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1108 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1108)) __PYX_ERR(0, 10102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1108); - __Pyx_GIVEREF(__pyx_tuple__1108); - - /* "talib/func.pyx":10107 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1109 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1109)) __PYX_ERR(0, 10107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1109); - __Pyx_GIVEREF(__pyx_tuple__1109); - - /* "talib/func.pyx":10109 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1110 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1110)) __PYX_ERR(0, 10109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1110); - __Pyx_GIVEREF(__pyx_tuple__1110); - - /* "talib/func.pyx":10115 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1111 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1111)) __PYX_ERR(0, 10115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1111); - __Pyx_GIVEREF(__pyx_tuple__1111); - - /* "talib/func.pyx":10117 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1112 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1112)) __PYX_ERR(0, 10117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1112); - __Pyx_GIVEREF(__pyx_tuple__1112); - - /* "talib/func.pyx":10132 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCH_Lookback( fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype ) - */ - __pyx_tuple__1113 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1113)) __PYX_ERR(0, 10132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1113); - __Pyx_GIVEREF(__pyx_tuple__1113); - - /* "talib/func.pyx":10179 - * double* outfastd_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1114 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1114)) __PYX_ERR(0, 10179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1114); - __Pyx_GIVEREF(__pyx_tuple__1114); - - /* "talib/func.pyx":10181 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1115 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1115)) __PYX_ERR(0, 10181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1115); - __Pyx_GIVEREF(__pyx_tuple__1115); - - /* "talib/func.pyx":10186 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1116 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1116)) __PYX_ERR(0, 10186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1116); - __Pyx_GIVEREF(__pyx_tuple__1116); - - /* "talib/func.pyx":10188 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1117 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1117)) __PYX_ERR(0, 10188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1117); - __Pyx_GIVEREF(__pyx_tuple__1117); - - /* "talib/func.pyx":10193 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1118 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1118)) __PYX_ERR(0, 10193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1118); - __Pyx_GIVEREF(__pyx_tuple__1118); - - /* "talib/func.pyx":10195 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1119 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1119)) __PYX_ERR(0, 10195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1119); - __Pyx_GIVEREF(__pyx_tuple__1119); - - /* "talib/func.pyx":10201 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1120 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1120)) __PYX_ERR(0, 10201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1120); - __Pyx_GIVEREF(__pyx_tuple__1120); - - /* "talib/func.pyx":10203 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1121 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1121)) __PYX_ERR(0, 10203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1121); - __Pyx_GIVEREF(__pyx_tuple__1121); - - /* "talib/func.pyx":10218 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHF_Lookback( fastk_period , fastd_period , fastd_matype ) - */ - __pyx_tuple__1122 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1122)) __PYX_ERR(0, 10218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1122); - __Pyx_GIVEREF(__pyx_tuple__1122); - - /* "talib/func.pyx":10264 - * double* outfastd_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1123 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1123)) __PYX_ERR(0, 10264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1123); - __Pyx_GIVEREF(__pyx_tuple__1123); - - /* "talib/func.pyx":10266 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1124 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1124)) __PYX_ERR(0, 10266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1124); - __Pyx_GIVEREF(__pyx_tuple__1124); - - /* "talib/func.pyx":10279 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_STOCHRSI_Lookback( timeperiod , fastk_period , fastd_period , fastd_matype ) - */ - __pyx_tuple__1125 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1125)) __PYX_ERR(0, 10279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1125); - __Pyx_GIVEREF(__pyx_tuple__1125); - - /* "talib/func.pyx":10319 - * double* outreal_data - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__1126 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__1126)) __PYX_ERR(0, 10319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1126); - __Pyx_GIVEREF(__pyx_tuple__1126); - - /* "talib/func.pyx":10321 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__1127 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1127)) __PYX_ERR(0, 10321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1127); - __Pyx_GIVEREF(__pyx_tuple__1127); - - /* "talib/func.pyx":10326 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__1128 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__1128)) __PYX_ERR(0, 10326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1128); - __Pyx_GIVEREF(__pyx_tuple__1128); - - /* "talib/func.pyx":10328 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__1129 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1129)) __PYX_ERR(0, 10328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1129); - __Pyx_GIVEREF(__pyx_tuple__1129); - - /* "talib/func.pyx":10334 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1130 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1130)) __PYX_ERR(0, 10334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1130); - __Pyx_GIVEREF(__pyx_tuple__1130); - - /* "talib/func.pyx":10346 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUB_Lookback( ) - */ - __pyx_tuple__1131 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1131)) __PYX_ERR(0, 10346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1131); - __Pyx_GIVEREF(__pyx_tuple__1131); - - /* "talib/func.pyx":10382 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1132 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1132)) __PYX_ERR(0, 10382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1132); - __Pyx_GIVEREF(__pyx_tuple__1132); - - /* "talib/func.pyx":10384 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1133 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1133)) __PYX_ERR(0, 10384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1133); - __Pyx_GIVEREF(__pyx_tuple__1133); - - /* "talib/func.pyx":10397 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_SUM_Lookback( timeperiod ) - */ - __pyx_tuple__1134 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1134)) __PYX_ERR(0, 10397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1134); - __Pyx_GIVEREF(__pyx_tuple__1134); - - /* "talib/func.pyx":10434 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1135 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1135)) __PYX_ERR(0, 10434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1135); - __Pyx_GIVEREF(__pyx_tuple__1135); - - /* "talib/func.pyx":10436 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1136 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1136)) __PYX_ERR(0, 10436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1136); - __Pyx_GIVEREF(__pyx_tuple__1136); - - /* "talib/func.pyx":10449 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_T3_Lookback( timeperiod , vfactor ) - */ - __pyx_tuple__1137 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1137)) __PYX_ERR(0, 10449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1137); - __Pyx_GIVEREF(__pyx_tuple__1137); - - /* "talib/func.pyx":10483 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1138 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1138)) __PYX_ERR(0, 10483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1138); - __Pyx_GIVEREF(__pyx_tuple__1138); - - /* "talib/func.pyx":10485 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1139 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1139)) __PYX_ERR(0, 10485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1139); - __Pyx_GIVEREF(__pyx_tuple__1139); - - /* "talib/func.pyx":10498 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TAN_Lookback( ) - */ - __pyx_tuple__1140 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1140)) __PYX_ERR(0, 10498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1140); - __Pyx_GIVEREF(__pyx_tuple__1140); - - /* "talib/func.pyx":10532 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1141 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1141)) __PYX_ERR(0, 10532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1141); - __Pyx_GIVEREF(__pyx_tuple__1141); - - /* "talib/func.pyx":10534 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1142 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1142)) __PYX_ERR(0, 10534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1142); - __Pyx_GIVEREF(__pyx_tuple__1142); - - /* "talib/func.pyx":10547 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TANH_Lookback( ) - */ - __pyx_tuple__1143 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1143)) __PYX_ERR(0, 10547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1143); - __Pyx_GIVEREF(__pyx_tuple__1143); - - /* "talib/func.pyx":10583 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1144 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1144)) __PYX_ERR(0, 10583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1144); - __Pyx_GIVEREF(__pyx_tuple__1144); - - /* "talib/func.pyx":10585 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1145 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1145)) __PYX_ERR(0, 10585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1145); - __Pyx_GIVEREF(__pyx_tuple__1145); - - /* "talib/func.pyx":10598 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TEMA_Lookback( timeperiod ) - */ - __pyx_tuple__1146 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1146)) __PYX_ERR(0, 10598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1146); - __Pyx_GIVEREF(__pyx_tuple__1146); - - /* "talib/func.pyx":10634 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1147 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1147)) __PYX_ERR(0, 10634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1147); - __Pyx_GIVEREF(__pyx_tuple__1147); - - /* "talib/func.pyx":10636 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1148 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1148)) __PYX_ERR(0, 10636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1148); - __Pyx_GIVEREF(__pyx_tuple__1148); - - /* "talib/func.pyx":10641 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1149 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1149)) __PYX_ERR(0, 10641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1149); - __Pyx_GIVEREF(__pyx_tuple__1149); - - /* "talib/func.pyx":10643 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1150 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1150)) __PYX_ERR(0, 10643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1150); - __Pyx_GIVEREF(__pyx_tuple__1150); - - /* "talib/func.pyx":10648 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1151 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1151)) __PYX_ERR(0, 10648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1151); - __Pyx_GIVEREF(__pyx_tuple__1151); - - /* "talib/func.pyx":10650 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1152 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1152)) __PYX_ERR(0, 10650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1152); - __Pyx_GIVEREF(__pyx_tuple__1152); - - /* "talib/func.pyx":10656 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1153 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1153)) __PYX_ERR(0, 10656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1153); - __Pyx_GIVEREF(__pyx_tuple__1153); - - /* "talib/func.pyx":10658 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1154 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1154)) __PYX_ERR(0, 10658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1154); - __Pyx_GIVEREF(__pyx_tuple__1154); - - /* "talib/func.pyx":10673 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRANGE_Lookback( ) - */ - __pyx_tuple__1155 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1155)) __PYX_ERR(0, 10673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1155); - __Pyx_GIVEREF(__pyx_tuple__1155); - - /* "talib/func.pyx":10709 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1156 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1156)) __PYX_ERR(0, 10709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1156); - __Pyx_GIVEREF(__pyx_tuple__1156); - - /* "talib/func.pyx":10711 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1157 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1157)) __PYX_ERR(0, 10711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1157); - __Pyx_GIVEREF(__pyx_tuple__1157); - - /* "talib/func.pyx":10724 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIMA_Lookback( timeperiod ) - */ - __pyx_tuple__1158 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1158)) __PYX_ERR(0, 10724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1158); - __Pyx_GIVEREF(__pyx_tuple__1158); - - /* "talib/func.pyx":10760 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1159 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1159)) __PYX_ERR(0, 10760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1159); - __Pyx_GIVEREF(__pyx_tuple__1159); - - /* "talib/func.pyx":10762 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1160 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1160)) __PYX_ERR(0, 10762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1160); - __Pyx_GIVEREF(__pyx_tuple__1160); - - /* "talib/func.pyx":10775 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TRIX_Lookback( timeperiod ) - */ - __pyx_tuple__1161 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1161)) __PYX_ERR(0, 10775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1161); - __Pyx_GIVEREF(__pyx_tuple__1161); - - /* "talib/func.pyx":10811 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1162 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1162)) __PYX_ERR(0, 10811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1162); - __Pyx_GIVEREF(__pyx_tuple__1162); - - /* "talib/func.pyx":10813 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1163 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1163)) __PYX_ERR(0, 10813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1163); - __Pyx_GIVEREF(__pyx_tuple__1163); - - /* "talib/func.pyx":10826 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TSF_Lookback( timeperiod ) - */ - __pyx_tuple__1164 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1164)) __PYX_ERR(0, 10826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1164); - __Pyx_GIVEREF(__pyx_tuple__1164); - - /* "talib/func.pyx":10862 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1165 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1165)) __PYX_ERR(0, 10862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1165); - __Pyx_GIVEREF(__pyx_tuple__1165); - - /* "talib/func.pyx":10864 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1166 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1166)) __PYX_ERR(0, 10864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1166); - __Pyx_GIVEREF(__pyx_tuple__1166); - - /* "talib/func.pyx":10869 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1167 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1167)) __PYX_ERR(0, 10869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1167); - __Pyx_GIVEREF(__pyx_tuple__1167); - - /* "talib/func.pyx":10871 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1168 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1168)) __PYX_ERR(0, 10871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1168); - __Pyx_GIVEREF(__pyx_tuple__1168); - - /* "talib/func.pyx":10876 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1169 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1169)) __PYX_ERR(0, 10876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1169); - __Pyx_GIVEREF(__pyx_tuple__1169); - - /* "talib/func.pyx":10878 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1170 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1170)) __PYX_ERR(0, 10878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1170); - __Pyx_GIVEREF(__pyx_tuple__1170); - - /* "talib/func.pyx":10884 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1171 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1171)) __PYX_ERR(0, 10884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1171); - __Pyx_GIVEREF(__pyx_tuple__1171); - - /* "talib/func.pyx":10886 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1172 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1172)) __PYX_ERR(0, 10886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1172); - __Pyx_GIVEREF(__pyx_tuple__1172); - - /* "talib/func.pyx":10901 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_TYPPRICE_Lookback( ) - */ - __pyx_tuple__1173 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1173)) __PYX_ERR(0, 10901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1173); - __Pyx_GIVEREF(__pyx_tuple__1173); - - /* "talib/func.pyx":10941 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1174 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1174)) __PYX_ERR(0, 10941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1174); - __Pyx_GIVEREF(__pyx_tuple__1174); - - /* "talib/func.pyx":10943 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1175 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1175)) __PYX_ERR(0, 10943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1175); - __Pyx_GIVEREF(__pyx_tuple__1175); - - /* "talib/func.pyx":10948 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1176 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1176)) __PYX_ERR(0, 10948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1176); - __Pyx_GIVEREF(__pyx_tuple__1176); - - /* "talib/func.pyx":10950 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1177 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1177)) __PYX_ERR(0, 10950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1177); - __Pyx_GIVEREF(__pyx_tuple__1177); - - /* "talib/func.pyx":10955 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1178 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1178)) __PYX_ERR(0, 10955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1178); - __Pyx_GIVEREF(__pyx_tuple__1178); - - /* "talib/func.pyx":10957 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1179 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1179)) __PYX_ERR(0, 10957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1179); - __Pyx_GIVEREF(__pyx_tuple__1179); - - /* "talib/func.pyx":10963 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1180 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1180)) __PYX_ERR(0, 10963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1180); - __Pyx_GIVEREF(__pyx_tuple__1180); - - /* "talib/func.pyx":10965 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1181 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1181)) __PYX_ERR(0, 10965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1181); - __Pyx_GIVEREF(__pyx_tuple__1181); - - /* "talib/func.pyx":10980 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_ULTOSC_Lookback( timeperiod1 , timeperiod2 , timeperiod3 ) - */ - __pyx_tuple__1182 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1182)) __PYX_ERR(0, 10980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1182); - __Pyx_GIVEREF(__pyx_tuple__1182); - - /* "talib/func.pyx":11017 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1183 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1183)) __PYX_ERR(0, 11017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1183); - __Pyx_GIVEREF(__pyx_tuple__1183); - - /* "talib/func.pyx":11019 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1184 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1184)) __PYX_ERR(0, 11019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1184); - __Pyx_GIVEREF(__pyx_tuple__1184); - - /* "talib/func.pyx":11032 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_VAR_Lookback( timeperiod , nbdev ) - */ - __pyx_tuple__1185 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1185)) __PYX_ERR(0, 11032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1185); - __Pyx_GIVEREF(__pyx_tuple__1185); - - /* "talib/func.pyx":11068 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1186 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1186)) __PYX_ERR(0, 11068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1186); - __Pyx_GIVEREF(__pyx_tuple__1186); - - /* "talib/func.pyx":11070 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1187 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1187)) __PYX_ERR(0, 11070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1187); - __Pyx_GIVEREF(__pyx_tuple__1187); - - /* "talib/func.pyx":11075 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1188 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1188)) __PYX_ERR(0, 11075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1188); - __Pyx_GIVEREF(__pyx_tuple__1188); - - /* "talib/func.pyx":11077 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1189 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1189)) __PYX_ERR(0, 11077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1189); - __Pyx_GIVEREF(__pyx_tuple__1189); - - /* "talib/func.pyx":11082 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1190 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1190)) __PYX_ERR(0, 11082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1190); - __Pyx_GIVEREF(__pyx_tuple__1190); - - /* "talib/func.pyx":11084 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1191 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1191)) __PYX_ERR(0, 11084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1191); - __Pyx_GIVEREF(__pyx_tuple__1191); - - /* "talib/func.pyx":11090 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1192 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1192)) __PYX_ERR(0, 11090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1192); - __Pyx_GIVEREF(__pyx_tuple__1192); - - /* "talib/func.pyx":11092 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1193 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1193)) __PYX_ERR(0, 11092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1193); - __Pyx_GIVEREF(__pyx_tuple__1193); - - /* "talib/func.pyx":11107 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WCLPRICE_Lookback( ) - */ - __pyx_tuple__1194 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1194)) __PYX_ERR(0, 11107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1194); - __Pyx_GIVEREF(__pyx_tuple__1194); - - /* "talib/func.pyx":11145 - * double* outreal_data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1195 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1195)) __PYX_ERR(0, 11145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1195); - __Pyx_GIVEREF(__pyx_tuple__1195); - - /* "talib/func.pyx":11147 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1196 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1196)) __PYX_ERR(0, 11147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1196); - __Pyx_GIVEREF(__pyx_tuple__1196); - - /* "talib/func.pyx":11152 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1197 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1197)) __PYX_ERR(0, 11152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1197); - __Pyx_GIVEREF(__pyx_tuple__1197); - - /* "talib/func.pyx":11154 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1198 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1198)) __PYX_ERR(0, 11154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1198); - __Pyx_GIVEREF(__pyx_tuple__1198); - - /* "talib/func.pyx":11159 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1199 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1199)) __PYX_ERR(0, 11159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1199); - __Pyx_GIVEREF(__pyx_tuple__1199); - - /* "talib/func.pyx":11161 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1200 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1200)) __PYX_ERR(0, 11161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1200); - __Pyx_GIVEREF(__pyx_tuple__1200); - - /* "talib/func.pyx":11167 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1201 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1201)) __PYX_ERR(0, 11167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1201); - __Pyx_GIVEREF(__pyx_tuple__1201); - - /* "talib/func.pyx":11169 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * begidx = 0 - * for i from 0 <= i < length: - */ - __pyx_tuple__1202 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1202)) __PYX_ERR(0, 11169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1202); - __Pyx_GIVEREF(__pyx_tuple__1202); - - /* "talib/func.pyx":11184 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WILLR_Lookback( timeperiod ) - */ - __pyx_tuple__1203 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1203)) __PYX_ERR(0, 11184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1203); - __Pyx_GIVEREF(__pyx_tuple__1203); - - /* "talib/func.pyx":11220 - * double* outreal_data - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1204 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1204)) __PYX_ERR(0, 11220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1204); - __Pyx_GIVEREF(__pyx_tuple__1204); - - /* "talib/func.pyx":11222 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1205 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1205)) __PYX_ERR(0, 11222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1205); - __Pyx_GIVEREF(__pyx_tuple__1205); - - /* "talib/func.pyx":11235 - * break - * else: - * raise Exception("inputs are all NaN") # <<<<<<<<<<<<<< - * endidx = length - begidx - 1 - * lookback = begidx + lib.TA_WMA_Lookback( timeperiod ) - */ - __pyx_tuple__1206 = PyTuple_Pack(1, __pyx_kp_s_inputs_are_all_NaN); if (unlikely(!__pyx_tuple__1206)) __PYX_ERR(0, 11235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1206); - __Pyx_GIVEREF(__pyx_tuple__1206); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple__1207 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__1207)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1207); - __Pyx_GIVEREF(__pyx_tuple__1207); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__1208 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__1208)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1208); - __Pyx_GIVEREF(__pyx_tuple__1208); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__1209 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__1209)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1209); - __Pyx_GIVEREF(__pyx_tuple__1209); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_tuple__1210 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__1210)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1210); - __Pyx_GIVEREF(__pyx_tuple__1210); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__1211 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__1211)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1211); - __Pyx_GIVEREF(__pyx_tuple__1211); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__1212 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__1212)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1212); - __Pyx_GIVEREF(__pyx_tuple__1212); - - /* "talib/func.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - __pyx_tuple__1213 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1213)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1213); - __Pyx_GIVEREF(__pyx_tuple__1213); - __pyx_codeobj__1214 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ACOS, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1214)) __PYX_ERR(0, 24, __pyx_L1_error) - - /* "talib/func.pyx":73 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - __pyx_tuple__1215 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1215)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1215); - __Pyx_GIVEREF(__pyx_tuple__1215); - __pyx_codeobj__1216 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AD, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1216)) __PYX_ERR(0, 73, __pyx_L1_error) - - /* "talib/func.pyx":161 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - __pyx_tuple__1217 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1217)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1217); - __Pyx_GIVEREF(__pyx_tuple__1217); - __pyx_codeobj__1218 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADD, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1218)) __PYX_ERR(0, 161, __pyx_L1_error) - - /* "talib/func.pyx":224 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - __pyx_tuple__1219 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1219)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1219); - __Pyx_GIVEREF(__pyx_tuple__1219); - __pyx_codeobj__1220 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADOSC, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1220)) __PYX_ERR(0, 224, __pyx_L1_error) - - /* "talib/func.pyx":315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1221 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1221)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1221); - __Pyx_GIVEREF(__pyx_tuple__1221); - __pyx_codeobj__1222 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADX, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1222)) __PYX_ERR(0, 315, __pyx_L1_error) - - /* "talib/func.pyx":392 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1223 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1223)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1223); - __Pyx_GIVEREF(__pyx_tuple__1223); - __pyx_codeobj__1224 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADXR, 392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1224)) __PYX_ERR(0, 392, __pyx_L1_error) - - /* "talib/func.pyx":469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_tuple__1225 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1225)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1225); - __Pyx_GIVEREF(__pyx_tuple__1225); - __pyx_codeobj__1226 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_APO, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1226)) __PYX_ERR(0, 469, __pyx_L1_error) - - /* "talib/func.pyx":522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1227 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outaroondown, __pyx_n_s_outaroondown_data, __pyx_n_s_outaroonup, __pyx_n_s_outaroonup_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1227)) __PYX_ERR(0, 522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1227); - __Pyx_GIVEREF(__pyx_tuple__1227); - __pyx_codeobj__1228 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AROON, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1228)) __PYX_ERR(0, 522, __pyx_L1_error) - - /* "talib/func.pyx":593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1229 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1229)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1229); - __Pyx_GIVEREF(__pyx_tuple__1229); - __pyx_codeobj__1230 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AROONOSC, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1230)) __PYX_ERR(0, 593, __pyx_L1_error) - - /* "talib/func.pyx":657 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - __pyx_tuple__1231 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1231)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1231); - __Pyx_GIVEREF(__pyx_tuple__1231); - __pyx_codeobj__1232 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ASIN, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1232)) __PYX_ERR(0, 657, __pyx_L1_error) - - /* "talib/func.pyx":706 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - __pyx_tuple__1233 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1233)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1233); - __Pyx_GIVEREF(__pyx_tuple__1233); - __pyx_codeobj__1234 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ATAN, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1234)) __PYX_ERR(0, 706, __pyx_L1_error) - - /* "talib/func.pyx":755 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1235 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1235)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1235); - __Pyx_GIVEREF(__pyx_tuple__1235); - __pyx_codeobj__1236 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ATR, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1236)) __PYX_ERR(0, 755, __pyx_L1_error) - - /* "talib/func.pyx":832 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - __pyx_tuple__1237 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1237)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1237); - __Pyx_GIVEREF(__pyx_tuple__1237); - __pyx_codeobj__1238 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AVGPRICE, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1238)) __PYX_ERR(0, 832, __pyx_L1_error) - - /* "talib/func.pyx":920 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - __pyx_tuple__1239 = PyTuple_Pack(21, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdevup, __pyx_n_s_nbdevdn, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outrealupperband, __pyx_n_s_outrealupperband_data, __pyx_n_s_outrealmiddleband, __pyx_n_s_outrealmiddleband_data, __pyx_n_s_outreallowerband, __pyx_n_s_outreallowerband_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1239)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1239); - __Pyx_GIVEREF(__pyx_tuple__1239); - __pyx_codeobj__1240 = (PyObject*)__Pyx_PyCode_New(5, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BBANDS, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1240)) __PYX_ERR(0, 920, __pyx_L1_error) - - /* "talib/func.pyx":988 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - __pyx_tuple__1241 = PyTuple_Pack(16, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1241)) __PYX_ERR(0, 988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1241); - __Pyx_GIVEREF(__pyx_tuple__1241); - __pyx_codeobj__1242 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BETA, 988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1242)) __PYX_ERR(0, 988, __pyx_L1_error) - - /* "talib/func.pyx":1053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - __pyx_tuple__1243 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1243)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1243); - __Pyx_GIVEREF(__pyx_tuple__1243); - __pyx_codeobj__1244 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BOP, 1053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1244)) __PYX_ERR(0, 1053, __pyx_L1_error) - - /* "talib/func.pyx":1141 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1245 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1245)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1245); - __Pyx_GIVEREF(__pyx_tuple__1245); - __pyx_codeobj__1246 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CCI, 1141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1246)) __PYX_ERR(0, 1141, __pyx_L1_error) - - /* "talib/func.pyx":1218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - __pyx_tuple__1247 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1247)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1247); - __Pyx_GIVEREF(__pyx_tuple__1247); - __pyx_codeobj__1248 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL2CROWS, 1218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1248)) __PYX_ERR(0, 1218, __pyx_L1_error) - - /* "talib/func.pyx":1306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - __pyx_tuple__1249 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1249)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1249); - __Pyx_GIVEREF(__pyx_tuple__1249); - __pyx_codeobj__1250 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3BLACKCROWS, 1306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1250)) __PYX_ERR(0, 1306, __pyx_L1_error) - - /* "talib/func.pyx":1394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - __pyx_tuple__1251 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1251)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1251); - __Pyx_GIVEREF(__pyx_tuple__1251); - __pyx_codeobj__1252 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3INSIDE, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1252)) __PYX_ERR(0, 1394, __pyx_L1_error) - - /* "talib/func.pyx":1482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - __pyx_tuple__1253 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1253)) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1253); - __Pyx_GIVEREF(__pyx_tuple__1253); - __pyx_codeobj__1254 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3LINESTRIKE, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1254)) __PYX_ERR(0, 1482, __pyx_L1_error) - - /* "talib/func.pyx":1570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - __pyx_tuple__1255 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1255)) __PYX_ERR(0, 1570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1255); - __Pyx_GIVEREF(__pyx_tuple__1255); - __pyx_codeobj__1256 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3OUTSIDE, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1256)) __PYX_ERR(0, 1570, __pyx_L1_error) - - /* "talib/func.pyx":1658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - __pyx_tuple__1257 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1257)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1257); - __Pyx_GIVEREF(__pyx_tuple__1257); - __pyx_codeobj__1258 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3STARSINSOUTH, 1658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1258)) __PYX_ERR(0, 1658, __pyx_L1_error) - - /* "talib/func.pyx":1746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - __pyx_tuple__1259 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1259)) __PYX_ERR(0, 1746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1259); - __Pyx_GIVEREF(__pyx_tuple__1259); - __pyx_codeobj__1260 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3WHITESOLDIERS, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1260)) __PYX_ERR(0, 1746, __pyx_L1_error) - - /* "talib/func.pyx":1834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1261 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1261)) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1261); - __Pyx_GIVEREF(__pyx_tuple__1261); - __pyx_codeobj__1262 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLABANDONEDBABY, 1834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1262)) __PYX_ERR(0, 1834, __pyx_L1_error) - - /* "talib/func.pyx":1924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - __pyx_tuple__1263 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1263)) __PYX_ERR(0, 1924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1263); - __Pyx_GIVEREF(__pyx_tuple__1263); - __pyx_codeobj__1264 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLADVANCEBLOCK, 1924, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1264)) __PYX_ERR(0, 1924, __pyx_L1_error) - - /* "talib/func.pyx":2012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - __pyx_tuple__1265 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1265)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1265); - __Pyx_GIVEREF(__pyx_tuple__1265); - __pyx_codeobj__1266 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLBELTHOLD, 2012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1266)) __PYX_ERR(0, 2012, __pyx_L1_error) - - /* "talib/func.pyx":2100 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - __pyx_tuple__1267 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1267)) __PYX_ERR(0, 2100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1267); - __Pyx_GIVEREF(__pyx_tuple__1267); - __pyx_codeobj__1268 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLBREAKAWAY, 2100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1268)) __PYX_ERR(0, 2100, __pyx_L1_error) - - /* "talib/func.pyx":2188 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - __pyx_tuple__1269 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1269)) __PYX_ERR(0, 2188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1269); - __Pyx_GIVEREF(__pyx_tuple__1269); - __pyx_codeobj__1270 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCLOSINGMARUBOZU, 2188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1270)) __PYX_ERR(0, 2188, __pyx_L1_error) - - /* "talib/func.pyx":2276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - __pyx_tuple__1271 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1271)) __PYX_ERR(0, 2276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1271); - __Pyx_GIVEREF(__pyx_tuple__1271); - __pyx_codeobj__1272 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCONCEALBABYSWALL, 2276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1272)) __PYX_ERR(0, 2276, __pyx_L1_error) - - /* "talib/func.pyx":2364 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - __pyx_tuple__1273 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1273)) __PYX_ERR(0, 2364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1273); - __Pyx_GIVEREF(__pyx_tuple__1273); - __pyx_codeobj__1274 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCOUNTERATTACK, 2364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1274)) __PYX_ERR(0, 2364, __pyx_L1_error) - - /* "talib/func.pyx":2452 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1275 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1275)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1275); - __Pyx_GIVEREF(__pyx_tuple__1275); - __pyx_codeobj__1276 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDARKCLOUDCOVER, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1276)) __PYX_ERR(0, 2452, __pyx_L1_error) - - /* "talib/func.pyx":2542 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - __pyx_tuple__1277 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1277)) __PYX_ERR(0, 2542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1277); - __Pyx_GIVEREF(__pyx_tuple__1277); - __pyx_codeobj__1278 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDOJI, 2542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1278)) __PYX_ERR(0, 2542, __pyx_L1_error) - - /* "talib/func.pyx":2630 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - __pyx_tuple__1279 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1279)) __PYX_ERR(0, 2630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1279); - __Pyx_GIVEREF(__pyx_tuple__1279); - __pyx_codeobj__1280 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDOJISTAR, 2630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1280)) __PYX_ERR(0, 2630, __pyx_L1_error) - - /* "talib/func.pyx":2718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - __pyx_tuple__1281 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1281)) __PYX_ERR(0, 2718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1281); - __Pyx_GIVEREF(__pyx_tuple__1281); - __pyx_codeobj__1282 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDRAGONFLYDOJI, 2718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1282)) __PYX_ERR(0, 2718, __pyx_L1_error) - - /* "talib/func.pyx":2806 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - __pyx_tuple__1283 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1283)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1283); - __Pyx_GIVEREF(__pyx_tuple__1283); - __pyx_codeobj__1284 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLENGULFING, 2806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1284)) __PYX_ERR(0, 2806, __pyx_L1_error) - - /* "talib/func.pyx":2894 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1285 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1285)) __PYX_ERR(0, 2894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1285); - __Pyx_GIVEREF(__pyx_tuple__1285); - __pyx_codeobj__1286 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLEVENINGDOJISTAR, 2894, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1286)) __PYX_ERR(0, 2894, __pyx_L1_error) - - /* "talib/func.pyx":2984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1287 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1287)) __PYX_ERR(0, 2984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1287); - __Pyx_GIVEREF(__pyx_tuple__1287); - __pyx_codeobj__1288 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLEVENINGSTAR, 2984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1288)) __PYX_ERR(0, 2984, __pyx_L1_error) - - /* "talib/func.pyx":3074 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - __pyx_tuple__1289 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1289)) __PYX_ERR(0, 3074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1289); - __Pyx_GIVEREF(__pyx_tuple__1289); - __pyx_codeobj__1290 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLGAPSIDESIDEWHITE, 3074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1290)) __PYX_ERR(0, 3074, __pyx_L1_error) - - /* "talib/func.pyx":3162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - __pyx_tuple__1291 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1291)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1291); - __Pyx_GIVEREF(__pyx_tuple__1291); - __pyx_codeobj__1292 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLGRAVESTONEDOJI, 3162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1292)) __PYX_ERR(0, 3162, __pyx_L1_error) - - /* "talib/func.pyx":3250 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - __pyx_tuple__1293 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1293)) __PYX_ERR(0, 3250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1293); - __Pyx_GIVEREF(__pyx_tuple__1293); - __pyx_codeobj__1294 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHAMMER, 3250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1294)) __PYX_ERR(0, 3250, __pyx_L1_error) - - /* "talib/func.pyx":3338 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - __pyx_tuple__1295 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1295)) __PYX_ERR(0, 3338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1295); - __Pyx_GIVEREF(__pyx_tuple__1295); - __pyx_codeobj__1296 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHANGINGMAN, 3338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1296)) __PYX_ERR(0, 3338, __pyx_L1_error) - - /* "talib/func.pyx":3426 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - __pyx_tuple__1297 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1297)) __PYX_ERR(0, 3426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1297); - __Pyx_GIVEREF(__pyx_tuple__1297); - __pyx_codeobj__1298 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHARAMI, 3426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1298)) __PYX_ERR(0, 3426, __pyx_L1_error) - - /* "talib/func.pyx":3514 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - __pyx_tuple__1299 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1299)) __PYX_ERR(0, 3514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1299); - __Pyx_GIVEREF(__pyx_tuple__1299); - __pyx_codeobj__1300 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHARAMICROSS, 3514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1300)) __PYX_ERR(0, 3514, __pyx_L1_error) - - /* "talib/func.pyx":3602 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - __pyx_tuple__1301 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1301)) __PYX_ERR(0, 3602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1301); - __Pyx_GIVEREF(__pyx_tuple__1301); - __pyx_codeobj__1302 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIGHWAVE, 3602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1302)) __PYX_ERR(0, 3602, __pyx_L1_error) - - /* "talib/func.pyx":3690 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - __pyx_tuple__1303 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1303)) __PYX_ERR(0, 3690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1303); - __Pyx_GIVEREF(__pyx_tuple__1303); - __pyx_codeobj__1304 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIKKAKE, 3690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1304)) __PYX_ERR(0, 3690, __pyx_L1_error) - - /* "talib/func.pyx":3778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - __pyx_tuple__1305 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1305)) __PYX_ERR(0, 3778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1305); - __Pyx_GIVEREF(__pyx_tuple__1305); - __pyx_codeobj__1306 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIKKAKEMOD, 3778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1306)) __PYX_ERR(0, 3778, __pyx_L1_error) - - /* "talib/func.pyx":3866 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - __pyx_tuple__1307 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1307)) __PYX_ERR(0, 3866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1307); - __Pyx_GIVEREF(__pyx_tuple__1307); - __pyx_codeobj__1308 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHOMINGPIGEON, 3866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1308)) __PYX_ERR(0, 3866, __pyx_L1_error) - - /* "talib/func.pyx":3954 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - __pyx_tuple__1309 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1309)) __PYX_ERR(0, 3954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1309); - __Pyx_GIVEREF(__pyx_tuple__1309); - __pyx_codeobj__1310 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLIDENTICAL3CROWS, 3954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1310)) __PYX_ERR(0, 3954, __pyx_L1_error) - - /* "talib/func.pyx":4042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - __pyx_tuple__1311 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1311)) __PYX_ERR(0, 4042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1311); - __Pyx_GIVEREF(__pyx_tuple__1311); - __pyx_codeobj__1312 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLINNECK, 4042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1312)) __PYX_ERR(0, 4042, __pyx_L1_error) - - /* "talib/func.pyx":4130 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - __pyx_tuple__1313 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1313)) __PYX_ERR(0, 4130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1313); - __Pyx_GIVEREF(__pyx_tuple__1313); - __pyx_codeobj__1314 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLINVERTEDHAMMER, 4130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1314)) __PYX_ERR(0, 4130, __pyx_L1_error) - - /* "talib/func.pyx":4218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - __pyx_tuple__1315 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1315)) __PYX_ERR(0, 4218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1315); - __Pyx_GIVEREF(__pyx_tuple__1315); - __pyx_codeobj__1316 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLKICKING, 4218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1316)) __PYX_ERR(0, 4218, __pyx_L1_error) - - /* "talib/func.pyx":4306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - __pyx_tuple__1317 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1317)) __PYX_ERR(0, 4306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1317); - __Pyx_GIVEREF(__pyx_tuple__1317); - __pyx_codeobj__1318 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLKICKINGBYLENGTH, 4306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1318)) __PYX_ERR(0, 4306, __pyx_L1_error) - - /* "talib/func.pyx":4394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - __pyx_tuple__1319 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1319)) __PYX_ERR(0, 4394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1319); - __Pyx_GIVEREF(__pyx_tuple__1319); - __pyx_codeobj__1320 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLADDERBOTTOM, 4394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1320)) __PYX_ERR(0, 4394, __pyx_L1_error) - - /* "talib/func.pyx":4482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - __pyx_tuple__1321 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1321)) __PYX_ERR(0, 4482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1321); - __Pyx_GIVEREF(__pyx_tuple__1321); - __pyx_codeobj__1322 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLONGLEGGEDDOJI, 4482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1322)) __PYX_ERR(0, 4482, __pyx_L1_error) - - /* "talib/func.pyx":4570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - __pyx_tuple__1323 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1323)) __PYX_ERR(0, 4570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1323); - __Pyx_GIVEREF(__pyx_tuple__1323); - __pyx_codeobj__1324 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLONGLINE, 4570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1324)) __PYX_ERR(0, 4570, __pyx_L1_error) - - /* "talib/func.pyx":4658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - __pyx_tuple__1325 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1325)) __PYX_ERR(0, 4658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1325); - __Pyx_GIVEREF(__pyx_tuple__1325); - __pyx_codeobj__1326 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMARUBOZU, 4658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1326)) __PYX_ERR(0, 4658, __pyx_L1_error) - - /* "talib/func.pyx":4746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - __pyx_tuple__1327 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1327)) __PYX_ERR(0, 4746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1327); - __Pyx_GIVEREF(__pyx_tuple__1327); - __pyx_codeobj__1328 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMATCHINGLOW, 4746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1328)) __PYX_ERR(0, 4746, __pyx_L1_error) - - /* "talib/func.pyx":4834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1329 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1329)) __PYX_ERR(0, 4834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1329); - __Pyx_GIVEREF(__pyx_tuple__1329); - __pyx_codeobj__1330 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMATHOLD, 4834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1330)) __PYX_ERR(0, 4834, __pyx_L1_error) - - /* "talib/func.pyx":4924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1331 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1331)) __PYX_ERR(0, 4924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1331); - __Pyx_GIVEREF(__pyx_tuple__1331); - __pyx_codeobj__1332 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMORNINGDOJISTAR, 4924, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1332)) __PYX_ERR(0, 4924, __pyx_L1_error) - - /* "talib/func.pyx":5014 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1333 = PyTuple_Pack(20, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1333)) __PYX_ERR(0, 5014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1333); - __Pyx_GIVEREF(__pyx_tuple__1333); - __pyx_codeobj__1334 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMORNINGSTAR, 5014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1334)) __PYX_ERR(0, 5014, __pyx_L1_error) - - /* "talib/func.pyx":5104 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - __pyx_tuple__1335 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1335)) __PYX_ERR(0, 5104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1335); - __Pyx_GIVEREF(__pyx_tuple__1335); - __pyx_codeobj__1336 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLONNECK, 5104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1336)) __PYX_ERR(0, 5104, __pyx_L1_error) - - /* "talib/func.pyx":5192 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - __pyx_tuple__1337 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1337)) __PYX_ERR(0, 5192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1337); - __Pyx_GIVEREF(__pyx_tuple__1337); - __pyx_codeobj__1338 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLPIERCING, 5192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1338)) __PYX_ERR(0, 5192, __pyx_L1_error) - - /* "talib/func.pyx":5280 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - __pyx_tuple__1339 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1339)) __PYX_ERR(0, 5280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1339); - __Pyx_GIVEREF(__pyx_tuple__1339); - __pyx_codeobj__1340 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLRICKSHAWMAN, 5280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1340)) __PYX_ERR(0, 5280, __pyx_L1_error) - - /* "talib/func.pyx":5368 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - __pyx_tuple__1341 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1341)) __PYX_ERR(0, 5368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1341); - __Pyx_GIVEREF(__pyx_tuple__1341); - __pyx_codeobj__1342 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLRISEFALL3METHODS, 5368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1342)) __PYX_ERR(0, 5368, __pyx_L1_error) - - /* "talib/func.pyx":5456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - __pyx_tuple__1343 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1343)) __PYX_ERR(0, 5456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1343); - __Pyx_GIVEREF(__pyx_tuple__1343); - __pyx_codeobj__1344 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSEPARATINGLINES, 5456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1344)) __PYX_ERR(0, 5456, __pyx_L1_error) - - /* "talib/func.pyx":5544 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - __pyx_tuple__1345 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1345)) __PYX_ERR(0, 5544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1345); - __Pyx_GIVEREF(__pyx_tuple__1345); - __pyx_codeobj__1346 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSHOOTINGSTAR, 5544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1346)) __PYX_ERR(0, 5544, __pyx_L1_error) - - /* "talib/func.pyx":5632 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - __pyx_tuple__1347 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1347)) __PYX_ERR(0, 5632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1347); - __Pyx_GIVEREF(__pyx_tuple__1347); - __pyx_codeobj__1348 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSHORTLINE, 5632, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1348)) __PYX_ERR(0, 5632, __pyx_L1_error) - - /* "talib/func.pyx":5720 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - __pyx_tuple__1349 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1349)) __PYX_ERR(0, 5720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1349); - __Pyx_GIVEREF(__pyx_tuple__1349); - __pyx_codeobj__1350 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSPINNINGTOP, 5720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1350)) __PYX_ERR(0, 5720, __pyx_L1_error) - - /* "talib/func.pyx":5808 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - __pyx_tuple__1351 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1351)) __PYX_ERR(0, 5808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1351); - __Pyx_GIVEREF(__pyx_tuple__1351); - __pyx_codeobj__1352 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSTALLEDPATTERN, 5808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1352)) __PYX_ERR(0, 5808, __pyx_L1_error) - - /* "talib/func.pyx":5896 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - __pyx_tuple__1353 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1353)) __PYX_ERR(0, 5896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1353); - __Pyx_GIVEREF(__pyx_tuple__1353); - __pyx_codeobj__1354 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSTICKSANDWICH, 5896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1354)) __PYX_ERR(0, 5896, __pyx_L1_error) - - /* "talib/func.pyx":5984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - __pyx_tuple__1355 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1355)) __PYX_ERR(0, 5984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1355); - __Pyx_GIVEREF(__pyx_tuple__1355); - __pyx_codeobj__1356 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTAKURI, 5984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1356)) __PYX_ERR(0, 5984, __pyx_L1_error) - - /* "talib/func.pyx":6072 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - __pyx_tuple__1357 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1357)) __PYX_ERR(0, 6072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1357); - __Pyx_GIVEREF(__pyx_tuple__1357); - __pyx_codeobj__1358 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTASUKIGAP, 6072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1358)) __PYX_ERR(0, 6072, __pyx_L1_error) - - /* "talib/func.pyx":6160 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - __pyx_tuple__1359 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1359)) __PYX_ERR(0, 6160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1359); - __Pyx_GIVEREF(__pyx_tuple__1359); - __pyx_codeobj__1360 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTHRUSTING, 6160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1360)) __PYX_ERR(0, 6160, __pyx_L1_error) - - /* "talib/func.pyx":6248 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - __pyx_tuple__1361 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1361)) __PYX_ERR(0, 6248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1361); - __Pyx_GIVEREF(__pyx_tuple__1361); - __pyx_codeobj__1362 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTRISTAR, 6248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1362)) __PYX_ERR(0, 6248, __pyx_L1_error) - - /* "talib/func.pyx":6336 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - __pyx_tuple__1363 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1363)) __PYX_ERR(0, 6336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1363); - __Pyx_GIVEREF(__pyx_tuple__1363); - __pyx_codeobj__1364 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLUNIQUE3RIVER, 6336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1364)) __PYX_ERR(0, 6336, __pyx_L1_error) - - /* "talib/func.pyx":6424 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - __pyx_tuple__1365 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1365)) __PYX_ERR(0, 6424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1365); - __Pyx_GIVEREF(__pyx_tuple__1365); - __pyx_codeobj__1366 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLUPSIDEGAP2CROWS, 6424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1366)) __PYX_ERR(0, 6424, __pyx_L1_error) - - /* "talib/func.pyx":6512 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - __pyx_tuple__1367 = PyTuple_Pack(19, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1367)) __PYX_ERR(0, 6512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1367); - __Pyx_GIVEREF(__pyx_tuple__1367); - __pyx_codeobj__1368 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLXSIDEGAP3METHODS, 6512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1368)) __PYX_ERR(0, 6512, __pyx_L1_error) - - /* "talib/func.pyx":6600 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - __pyx_tuple__1369 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1369)) __PYX_ERR(0, 6600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1369); - __Pyx_GIVEREF(__pyx_tuple__1369); - __pyx_codeobj__1370 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CEIL, 6600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1370)) __PYX_ERR(0, 6600, __pyx_L1_error) - - /* "talib/func.pyx":6649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - __pyx_tuple__1371 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1371)) __PYX_ERR(0, 6649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1371); - __Pyx_GIVEREF(__pyx_tuple__1371); - __pyx_codeobj__1372 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CMO, 6649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1372)) __PYX_ERR(0, 6649, __pyx_L1_error) - - /* "talib/func.pyx":6700 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - __pyx_tuple__1373 = PyTuple_Pack(16, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1373)) __PYX_ERR(0, 6700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1373); - __Pyx_GIVEREF(__pyx_tuple__1373); - __pyx_codeobj__1374 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CORREL, 6700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1374)) __PYX_ERR(0, 6700, __pyx_L1_error) - - /* "talib/func.pyx":6765 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - __pyx_tuple__1375 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1375)) __PYX_ERR(0, 6765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1375); - __Pyx_GIVEREF(__pyx_tuple__1375); - __pyx_codeobj__1376 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_COS, 6765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1376)) __PYX_ERR(0, 6765, __pyx_L1_error) - - /* "talib/func.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - __pyx_tuple__1377 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1377)) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1377); - __Pyx_GIVEREF(__pyx_tuple__1377); - __pyx_codeobj__1378 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_COSH, 6814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1378)) __PYX_ERR(0, 6814, __pyx_L1_error) - - /* "talib/func.pyx":6863 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1379 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1379)) __PYX_ERR(0, 6863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1379); - __Pyx_GIVEREF(__pyx_tuple__1379); - __pyx_codeobj__1380 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DEMA, 6863, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1380)) __PYX_ERR(0, 6863, __pyx_L1_error) - - /* "talib/func.pyx":6914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - __pyx_tuple__1381 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1381)) __PYX_ERR(0, 6914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1381); - __Pyx_GIVEREF(__pyx_tuple__1381); - __pyx_codeobj__1382 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DIV, 6914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1382)) __PYX_ERR(0, 6914, __pyx_L1_error) - - /* "talib/func.pyx":6977 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1383 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1383)) __PYX_ERR(0, 6977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1383); - __Pyx_GIVEREF(__pyx_tuple__1383); - __pyx_codeobj__1384 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DX, 6977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1384)) __PYX_ERR(0, 6977, __pyx_L1_error) - - /* "talib/func.pyx":7054 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1385 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1385)) __PYX_ERR(0, 7054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1385); - __Pyx_GIVEREF(__pyx_tuple__1385); - __pyx_codeobj__1386 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_EMA, 7054, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1386)) __PYX_ERR(0, 7054, __pyx_L1_error) - - /* "talib/func.pyx":7105 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - __pyx_tuple__1387 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1387)) __PYX_ERR(0, 7105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1387); - __Pyx_GIVEREF(__pyx_tuple__1387); - __pyx_codeobj__1388 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_EXP, 7105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1388)) __PYX_ERR(0, 7105, __pyx_L1_error) - - /* "talib/func.pyx":7154 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - __pyx_tuple__1389 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1389)) __PYX_ERR(0, 7154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1389); - __Pyx_GIVEREF(__pyx_tuple__1389); - __pyx_codeobj__1390 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_FLOOR, 7154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1390)) __PYX_ERR(0, 7154, __pyx_L1_error) - - /* "talib/func.pyx":7203 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - __pyx_tuple__1391 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1391)) __PYX_ERR(0, 7203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1391); - __Pyx_GIVEREF(__pyx_tuple__1391); - __pyx_codeobj__1392 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_DCPERIOD, 7203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1392)) __PYX_ERR(0, 7203, __pyx_L1_error) - - /* "talib/func.pyx":7252 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - __pyx_tuple__1393 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1393)) __PYX_ERR(0, 7252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1393); - __Pyx_GIVEREF(__pyx_tuple__1393); - __pyx_codeobj__1394 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_DCPHASE, 7252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1394)) __PYX_ERR(0, 7252, __pyx_L1_error) - - /* "talib/func.pyx":7301 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - __pyx_tuple__1395 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinphase, __pyx_n_s_outinphase_data, __pyx_n_s_outquadrature, __pyx_n_s_outquadrature_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1395)) __PYX_ERR(0, 7301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1395); - __Pyx_GIVEREF(__pyx_tuple__1395); - __pyx_codeobj__1396 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_PHASOR, 7301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1396)) __PYX_ERR(0, 7301, __pyx_L1_error) - - /* "talib/func.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - __pyx_tuple__1397 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outsine, __pyx_n_s_outsine_data, __pyx_n_s_outleadsine, __pyx_n_s_outleadsine_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1397)) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1397); - __Pyx_GIVEREF(__pyx_tuple__1397); - __pyx_codeobj__1398 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_SINE, 7357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1398)) __PYX_ERR(0, 7357, __pyx_L1_error) - - /* "talib/func.pyx":7413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - __pyx_tuple__1399 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1399)) __PYX_ERR(0, 7413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1399); - __Pyx_GIVEREF(__pyx_tuple__1399); - __pyx_codeobj__1400 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_TRENDLINE, 7413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1400)) __PYX_ERR(0, 7413, __pyx_L1_error) - - /* "talib/func.pyx":7462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - __pyx_tuple__1401 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1401)) __PYX_ERR(0, 7462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1401); - __Pyx_GIVEREF(__pyx_tuple__1401); - __pyx_codeobj__1402 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_TRENDMODE, 7462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1402)) __PYX_ERR(0, 7462, __pyx_L1_error) - - /* "talib/func.pyx":7511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1403 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1403)) __PYX_ERR(0, 7511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1403); - __Pyx_GIVEREF(__pyx_tuple__1403); - __pyx_codeobj__1404 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_KAMA, 7511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1404)) __PYX_ERR(0, 7511, __pyx_L1_error) - - /* "talib/func.pyx":7562 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - __pyx_tuple__1405 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1405)) __PYX_ERR(0, 7562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1405); - __Pyx_GIVEREF(__pyx_tuple__1405); - __pyx_codeobj__1406 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG, 7562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1406)) __PYX_ERR(0, 7562, __pyx_L1_error) - - /* "talib/func.pyx":7613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - __pyx_tuple__1407 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1407)) __PYX_ERR(0, 7613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1407); - __Pyx_GIVEREF(__pyx_tuple__1407); - __pyx_codeobj__1408 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_ANGLE, 7613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1408)) __PYX_ERR(0, 7613, __pyx_L1_error) - - /* "talib/func.pyx":7664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - __pyx_tuple__1409 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1409)) __PYX_ERR(0, 7664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1409); - __Pyx_GIVEREF(__pyx_tuple__1409); - __pyx_codeobj__1410 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_INTERCEPT, 7664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1410)) __PYX_ERR(0, 7664, __pyx_L1_error) - - /* "talib/func.pyx":7715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - __pyx_tuple__1411 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1411)) __PYX_ERR(0, 7715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1411); - __Pyx_GIVEREF(__pyx_tuple__1411); - __pyx_codeobj__1412 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_SLOPE, 7715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1412)) __PYX_ERR(0, 7715, __pyx_L1_error) - - /* "talib/func.pyx":7766 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - __pyx_tuple__1413 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1413)) __PYX_ERR(0, 7766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1413); - __Pyx_GIVEREF(__pyx_tuple__1413); - __pyx_codeobj__1414 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LN, 7766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1414)) __PYX_ERR(0, 7766, __pyx_L1_error) - - /* "talib/func.pyx":7815 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - __pyx_tuple__1415 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1415)) __PYX_ERR(0, 7815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1415); - __Pyx_GIVEREF(__pyx_tuple__1415); - __pyx_codeobj__1416 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LOG10, 7815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1416)) __PYX_ERR(0, 7815, __pyx_L1_error) - - /* "talib/func.pyx":7864 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - __pyx_tuple__1417 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1417)) __PYX_ERR(0, 7864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1417); - __Pyx_GIVEREF(__pyx_tuple__1417); - __pyx_codeobj__1418 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MA, 7864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1418)) __PYX_ERR(0, 7864, __pyx_L1_error) - - /* "talib/func.pyx":7916 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - __pyx_tuple__1419 = PyTuple_Pack(20, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1419)) __PYX_ERR(0, 7916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1419); - __Pyx_GIVEREF(__pyx_tuple__1419); - __pyx_codeobj__1420 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACD, 7916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1420)) __PYX_ERR(0, 7916, __pyx_L1_error) - - /* "talib/func.pyx":7983 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - __pyx_tuple__1421 = PyTuple_Pack(23, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_fastmatype, __pyx_n_s_slowperiod, __pyx_n_s_slowmatype, __pyx_n_s_signalperiod, __pyx_n_s_signalmatype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1421)) __PYX_ERR(0, 7983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1421); - __Pyx_GIVEREF(__pyx_tuple__1421); - __pyx_codeobj__1422 = (PyObject*)__Pyx_PyCode_New(7, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACDEXT, 7983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1422)) __PYX_ERR(0, 7983, __pyx_L1_error) - - /* "talib/func.pyx":8053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - __pyx_tuple__1423 = PyTuple_Pack(18, __pyx_n_s_real, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacd_data, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdsignal_data, __pyx_n_s_outmacdhist, __pyx_n_s_outmacdhist_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1423)) __PYX_ERR(0, 8053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1423); - __Pyx_GIVEREF(__pyx_tuple__1423); - __pyx_codeobj__1424 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACDFIX, 8053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1424)) __PYX_ERR(0, 8053, __pyx_L1_error) - - /* "talib/func.pyx":8118 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - __pyx_tuple__1425 = PyTuple_Pack(17, __pyx_n_s_real, __pyx_n_s_fastlimit, __pyx_n_s_slowlimit, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmama, __pyx_n_s_outmama_data, __pyx_n_s_outfama, __pyx_n_s_outfama_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1425)) __PYX_ERR(0, 8118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1425); - __Pyx_GIVEREF(__pyx_tuple__1425); - __pyx_codeobj__1426 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAMA, 8118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1426)) __PYX_ERR(0, 8118, __pyx_L1_error) - - /* "talib/func.pyx":8177 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - __pyx_tuple__1427 = PyTuple_Pack(18, __pyx_n_s_real, __pyx_n_s_periods, __pyx_n_s_minperiod, __pyx_n_s_maxperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_periods_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1427)) __PYX_ERR(0, 8177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1427); - __Pyx_GIVEREF(__pyx_tuple__1427); - __pyx_codeobj__1428 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAVP, 8177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1428)) __PYX_ERR(0, 8177, __pyx_L1_error) - - /* "talib/func.pyx":8244 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1429 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1429)) __PYX_ERR(0, 8244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1429); - __Pyx_GIVEREF(__pyx_tuple__1429); - __pyx_codeobj__1430 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1429, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAX, 8244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1430)) __PYX_ERR(0, 8244, __pyx_L1_error) - - /* "talib/func.pyx":8295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1431 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1431)) __PYX_ERR(0, 8295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1431); - __Pyx_GIVEREF(__pyx_tuple__1431); - __pyx_codeobj__1432 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1431, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAXINDEX, 8295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1432)) __PYX_ERR(0, 8295, __pyx_L1_error) - - /* "talib/func.pyx":8346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - __pyx_tuple__1433 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1433)) __PYX_ERR(0, 8346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1433); - __Pyx_GIVEREF(__pyx_tuple__1433); - __pyx_codeobj__1434 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1433, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MEDPRICE, 8346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1434)) __PYX_ERR(0, 8346, __pyx_L1_error) - - /* "talib/func.pyx":8408 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - __pyx_tuple__1435 = PyTuple_Pack(20, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1435)) __PYX_ERR(0, 8408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1435); - __Pyx_GIVEREF(__pyx_tuple__1435); - __pyx_codeobj__1436 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1435, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MFI, 8408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1436)) __PYX_ERR(0, 8408, __pyx_L1_error) - - /* "talib/func.pyx":8498 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - __pyx_tuple__1437 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1437)) __PYX_ERR(0, 8498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1437); - __Pyx_GIVEREF(__pyx_tuple__1437); - __pyx_codeobj__1438 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1437, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIDPOINT, 8498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1438)) __PYX_ERR(0, 8498, __pyx_L1_error) - - /* "talib/func.pyx":8549 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1439 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1439)) __PYX_ERR(0, 8549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1439); - __Pyx_GIVEREF(__pyx_tuple__1439); - __pyx_codeobj__1440 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1439, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIDPRICE, 8549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1440)) __PYX_ERR(0, 8549, __pyx_L1_error) - - /* "talib/func.pyx":8613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - __pyx_tuple__1441 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1441)) __PYX_ERR(0, 8613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1441); - __Pyx_GIVEREF(__pyx_tuple__1441); - __pyx_codeobj__1442 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1441, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIN, 8613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1442)) __PYX_ERR(0, 8613, __pyx_L1_error) - - /* "talib/func.pyx":8664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1443 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger, __pyx_n_s_outinteger_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1443)) __PYX_ERR(0, 8664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1443); - __Pyx_GIVEREF(__pyx_tuple__1443); - __pyx_codeobj__1444 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1443, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MININDEX, 8664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1444)) __PYX_ERR(0, 8664, __pyx_L1_error) - - /* "talib/func.pyx":8715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1445 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmin, __pyx_n_s_outmin_data, __pyx_n_s_outmax, __pyx_n_s_outmax_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1445)) __PYX_ERR(0, 8715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1445); - __Pyx_GIVEREF(__pyx_tuple__1445); - __pyx_codeobj__1446 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1445, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINMAX, 8715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1446)) __PYX_ERR(0, 8715, __pyx_L1_error) - - /* "talib/func.pyx":8773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1447 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outminidx, __pyx_n_s_outminidx_data, __pyx_n_s_outmaxidx, __pyx_n_s_outmaxidx_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1447)) __PYX_ERR(0, 8773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1447); - __Pyx_GIVEREF(__pyx_tuple__1447); - __pyx_codeobj__1448 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1447, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINMAXINDEX, 8773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1448)) __PYX_ERR(0, 8773, __pyx_L1_error) - - /* "talib/func.pyx":8831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1449 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1449)) __PYX_ERR(0, 8831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1449); - __Pyx_GIVEREF(__pyx_tuple__1449); - __pyx_codeobj__1450 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1449, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINUS_DI, 8831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1450)) __PYX_ERR(0, 8831, __pyx_L1_error) - - /* "talib/func.pyx":8908 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1451 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1451)) __PYX_ERR(0, 8908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1451); - __Pyx_GIVEREF(__pyx_tuple__1451); - __pyx_codeobj__1452 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1451, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINUS_DM, 8908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1452)) __PYX_ERR(0, 8908, __pyx_L1_error) - - /* "talib/func.pyx":8972 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - __pyx_tuple__1453 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1453)) __PYX_ERR(0, 8972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1453); - __Pyx_GIVEREF(__pyx_tuple__1453); - __pyx_codeobj__1454 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1453, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MOM, 8972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1454)) __PYX_ERR(0, 8972, __pyx_L1_error) - - /* "talib/func.pyx":9023 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - __pyx_tuple__1455 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1455)) __PYX_ERR(0, 9023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1455); - __Pyx_GIVEREF(__pyx_tuple__1455); - __pyx_codeobj__1456 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1455, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MULT, 9023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1456)) __PYX_ERR(0, 9023, __pyx_L1_error) - - /* "talib/func.pyx":9086 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1457 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1457)) __PYX_ERR(0, 9086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1457); - __Pyx_GIVEREF(__pyx_tuple__1457); - __pyx_codeobj__1458 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1457, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_NATR, 9086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1458)) __PYX_ERR(0, 9086, __pyx_L1_error) - - /* "talib/func.pyx":9163 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - __pyx_tuple__1459 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1459)) __PYX_ERR(0, 9163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1459); - __Pyx_GIVEREF(__pyx_tuple__1459); - __pyx_codeobj__1460 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_OBV, 9163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1460)) __PYX_ERR(0, 9163, __pyx_L1_error) - - /* "talib/func.pyx":9226 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1461 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1461)) __PYX_ERR(0, 9226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1461); - __Pyx_GIVEREF(__pyx_tuple__1461); - __pyx_codeobj__1462 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1461, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PLUS_DI, 9226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1462)) __PYX_ERR(0, 9226, __pyx_L1_error) - - /* "talib/func.pyx":9303 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1463 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1463)) __PYX_ERR(0, 9303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1463); - __Pyx_GIVEREF(__pyx_tuple__1463); - __pyx_codeobj__1464 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1463, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PLUS_DM, 9303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1464)) __PYX_ERR(0, 9303, __pyx_L1_error) - - /* "talib/func.pyx":9367 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_tuple__1465 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1465)) __PYX_ERR(0, 9367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1465); - __Pyx_GIVEREF(__pyx_tuple__1465); - __pyx_codeobj__1466 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PPO, 9367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1466)) __PYX_ERR(0, 9367, __pyx_L1_error) - - /* "talib/func.pyx":9420 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - __pyx_tuple__1467 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1467)) __PYX_ERR(0, 9420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1467); - __Pyx_GIVEREF(__pyx_tuple__1467); - __pyx_codeobj__1468 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROC, 9420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1468)) __PYX_ERR(0, 9420, __pyx_L1_error) - - /* "talib/func.pyx":9471 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - __pyx_tuple__1469 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1469)) __PYX_ERR(0, 9471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1469); - __Pyx_GIVEREF(__pyx_tuple__1469); - __pyx_codeobj__1470 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCP, 9471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1470)) __PYX_ERR(0, 9471, __pyx_L1_error) - - /* "talib/func.pyx":9522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - __pyx_tuple__1471 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1471)) __PYX_ERR(0, 9522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1471); - __Pyx_GIVEREF(__pyx_tuple__1471); - __pyx_codeobj__1472 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCR, 9522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1472)) __PYX_ERR(0, 9522, __pyx_L1_error) - - /* "talib/func.pyx":9573 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - __pyx_tuple__1473 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1473)) __PYX_ERR(0, 9573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1473); - __Pyx_GIVEREF(__pyx_tuple__1473); - __pyx_codeobj__1474 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCR100, 9573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1474)) __PYX_ERR(0, 9573, __pyx_L1_error) - - /* "talib/func.pyx":9624 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - __pyx_tuple__1475 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1475)) __PYX_ERR(0, 9624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1475); - __Pyx_GIVEREF(__pyx_tuple__1475); - __pyx_codeobj__1476 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_RSI, 9624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1476)) __PYX_ERR(0, 9624, __pyx_L1_error) - - /* "talib/func.pyx":9675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - __pyx_tuple__1477 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_acceleration, __pyx_n_s_maximum, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1477)) __PYX_ERR(0, 9675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1477); - __Pyx_GIVEREF(__pyx_tuple__1477); - __pyx_codeobj__1478 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SAR, 9675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1478)) __PYX_ERR(0, 9675, __pyx_L1_error) - - /* "talib/func.pyx":9740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - __pyx_tuple__1479 = PyTuple_Pack(23, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_startvalue, __pyx_n_s_offsetonreverse, __pyx_n_s_accelerationinitlong, __pyx_n_s_accelerationlong, __pyx_n_s_accelerationmaxlong, __pyx_n_s_accelerationinitshort, __pyx_n_s_accelerationshort, __pyx_n_s_accelerationmaxshort, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1479)) __PYX_ERR(0, 9740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1479); - __Pyx_GIVEREF(__pyx_tuple__1479); - __pyx_codeobj__1480 = (PyObject*)__Pyx_PyCode_New(10, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SAREXT, 9740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1480)) __PYX_ERR(0, 9740, __pyx_L1_error) - - /* "talib/func.pyx":9811 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - __pyx_tuple__1481 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1481)) __PYX_ERR(0, 9811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1481); - __Pyx_GIVEREF(__pyx_tuple__1481); - __pyx_codeobj__1482 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SIN, 9811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1482)) __PYX_ERR(0, 9811, __pyx_L1_error) - - /* "talib/func.pyx":9860 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - __pyx_tuple__1483 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1483)) __PYX_ERR(0, 9860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1483); - __Pyx_GIVEREF(__pyx_tuple__1483); - __pyx_codeobj__1484 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SINH, 9860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1484)) __PYX_ERR(0, 9860, __pyx_L1_error) - - /* "talib/func.pyx":9909 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1485 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1485)) __PYX_ERR(0, 9909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1485); - __Pyx_GIVEREF(__pyx_tuple__1485); - __pyx_codeobj__1486 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SMA, 9909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1486)) __PYX_ERR(0, 9909, __pyx_L1_error) - - /* "talib/func.pyx":9960 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - __pyx_tuple__1487 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1487)) __PYX_ERR(0, 9960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1487); - __Pyx_GIVEREF(__pyx_tuple__1487); - __pyx_codeobj__1488 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SQRT, 9960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1488)) __PYX_ERR(0, 9960, __pyx_L1_error) - - /* "talib/func.pyx":10009 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_tuple__1489 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1489)) __PYX_ERR(0, 10009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1489); - __Pyx_GIVEREF(__pyx_tuple__1489); - __pyx_codeobj__1490 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1489, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STDDEV, 10009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1490)) __PYX_ERR(0, 10009, __pyx_L1_error) - - /* "talib/func.pyx":10061 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - __pyx_tuple__1491 = PyTuple_Pack(24, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_slowk_period, __pyx_n_s_slowk_matype, __pyx_n_s_slowd_period, __pyx_n_s_slowd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outslowk, __pyx_n_s_outslowk_data, __pyx_n_s_outslowd, __pyx_n_s_outslowd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1491)) __PYX_ERR(0, 10061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1491); - __Pyx_GIVEREF(__pyx_tuple__1491); - __pyx_codeobj__1492 = (PyObject*)__Pyx_PyCode_New(8, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1491, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCH, 10061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1492)) __PYX_ERR(0, 10061, __pyx_L1_error) - - /* "talib/func.pyx":10149 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_tuple__1493 = PyTuple_Pack(22, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastk_data, __pyx_n_s_outfastd, __pyx_n_s_outfastd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1493)) __PYX_ERR(0, 10149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1493); - __Pyx_GIVEREF(__pyx_tuple__1493); - __pyx_codeobj__1494 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1493, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCHF, 10149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1494)) __PYX_ERR(0, 10149, __pyx_L1_error) - - /* "talib/func.pyx":10235 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_tuple__1495 = PyTuple_Pack(19, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastk_data, __pyx_n_s_outfastd, __pyx_n_s_outfastd_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1495)) __PYX_ERR(0, 10235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1495); - __Pyx_GIVEREF(__pyx_tuple__1495); - __pyx_codeobj__1496 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1495, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCHRSI, 10235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1496)) __PYX_ERR(0, 10235, __pyx_L1_error) - - /* "talib/func.pyx":10296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - __pyx_tuple__1497 = PyTuple_Pack(15, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1497)) __PYX_ERR(0, 10296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1497); - __Pyx_GIVEREF(__pyx_tuple__1497); - __pyx_codeobj__1498 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SUB, 10296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1498)) __PYX_ERR(0, 10296, __pyx_L1_error) - - /* "talib/func.pyx":10359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - __pyx_tuple__1499 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1499)) __PYX_ERR(0, 10359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1499); - __Pyx_GIVEREF(__pyx_tuple__1499); - __pyx_codeobj__1500 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SUM, 10359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1500)) __PYX_ERR(0, 10359, __pyx_L1_error) - - /* "talib/func.pyx":10410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - __pyx_tuple__1501 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_vfactor, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1501)) __PYX_ERR(0, 10410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1501); - __Pyx_GIVEREF(__pyx_tuple__1501); - __pyx_codeobj__1502 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1501, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_T3, 10410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1502)) __PYX_ERR(0, 10410, __pyx_L1_error) - - /* "talib/func.pyx":10462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - __pyx_tuple__1503 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1503)) __PYX_ERR(0, 10462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1503); - __Pyx_GIVEREF(__pyx_tuple__1503); - __pyx_codeobj__1504 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1503, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TAN, 10462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1504)) __PYX_ERR(0, 10462, __pyx_L1_error) - - /* "talib/func.pyx":10511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - __pyx_tuple__1505 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1505)) __PYX_ERR(0, 10511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1505); - __Pyx_GIVEREF(__pyx_tuple__1505); - __pyx_codeobj__1506 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1505, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TANH, 10511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1506)) __PYX_ERR(0, 10511, __pyx_L1_error) - - /* "talib/func.pyx":10560 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1507 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1507)) __PYX_ERR(0, 10560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1507); - __Pyx_GIVEREF(__pyx_tuple__1507); - __pyx_codeobj__1508 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1507, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TEMA, 10560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1508)) __PYX_ERR(0, 10560, __pyx_L1_error) - - /* "talib/func.pyx":10611 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - __pyx_tuple__1509 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1509)) __PYX_ERR(0, 10611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1509); - __Pyx_GIVEREF(__pyx_tuple__1509); - __pyx_codeobj__1510 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1509, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRANGE, 10611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1510)) __PYX_ERR(0, 10611, __pyx_L1_error) - - /* "talib/func.pyx":10686 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1511 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1511)) __PYX_ERR(0, 10686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1511); - __Pyx_GIVEREF(__pyx_tuple__1511); - __pyx_codeobj__1512 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1511, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRIMA, 10686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1512)) __PYX_ERR(0, 10686, __pyx_L1_error) - - /* "talib/func.pyx":10737 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1513 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1513)) __PYX_ERR(0, 10737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1513); - __Pyx_GIVEREF(__pyx_tuple__1513); - __pyx_codeobj__1514 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1513, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRIX, 10737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1514)) __PYX_ERR(0, 10737, __pyx_L1_error) - - /* "talib/func.pyx":10788 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - __pyx_tuple__1515 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1515)) __PYX_ERR(0, 10788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1515); - __Pyx_GIVEREF(__pyx_tuple__1515); - __pyx_codeobj__1516 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1515, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TSF, 10788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1516)) __PYX_ERR(0, 10788, __pyx_L1_error) - - /* "talib/func.pyx":10839 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - __pyx_tuple__1517 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1517)) __PYX_ERR(0, 10839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1517); - __Pyx_GIVEREF(__pyx_tuple__1517); - __pyx_codeobj__1518 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TYPPRICE, 10839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1518)) __PYX_ERR(0, 10839, __pyx_L1_error) - - /* "talib/func.pyx":10914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - __pyx_tuple__1519 = PyTuple_Pack(20, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod1, __pyx_n_s_timeperiod2, __pyx_n_s_timeperiod3, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1519)) __PYX_ERR(0, 10914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1519); - __Pyx_GIVEREF(__pyx_tuple__1519); - __pyx_codeobj__1520 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ULTOSC, 10914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1520)) __PYX_ERR(0, 10914, __pyx_L1_error) - - /* "talib/func.pyx":10993 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_tuple__1521 = PyTuple_Pack(15, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1521)) __PYX_ERR(0, 10993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1521); - __Pyx_GIVEREF(__pyx_tuple__1521); - __pyx_codeobj__1522 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_VAR, 10993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1522)) __PYX_ERR(0, 10993, __pyx_L1_error) - - /* "talib/func.pyx":11045 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - __pyx_tuple__1523 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1523)) __PYX_ERR(0, 11045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1523); - __Pyx_GIVEREF(__pyx_tuple__1523); - __pyx_codeobj__1524 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1523, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WCLPRICE, 11045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1524)) __PYX_ERR(0, 11045, __pyx_L1_error) - - /* "talib/func.pyx":11120 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1525 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1525)) __PYX_ERR(0, 11120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1525); - __Pyx_GIVEREF(__pyx_tuple__1525); - __pyx_codeobj__1526 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1525, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WILLR, 11120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1526)) __PYX_ERR(0, 11120, __pyx_L1_error) - - /* "talib/func.pyx":11197 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1527 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal, __pyx_n_s_outreal_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__1527)) __PYX_ERR(0, 11197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1527); - __Pyx_GIVEREF(__pyx_tuple__1527); - __pyx_codeobj__1528 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1527, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WMA, 11197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1528)) __PYX_ERR(0, 11197, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initfunc(void); /*proto*/ -PyMODINIT_FUNC initfunc(void) -#else -PyMODINIT_FUNC PyInit_func(void); /*proto*/ -PyMODINIT_FUNC PyInit_func(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - double __pyx_t_4; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_func(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("func", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_talib__func) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "talib.func")) { - if (unlikely(PyDict_SetItemString(modules, "talib.func", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - __pyx_t_1 = __Pyx_ImportModule("talib.common"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "_ta_check_success", (void (**)(void))&__pyx_f_5talib_6common__ta_check_success, "PyObject *(PyObject *, TA_RetCode, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "talib/func.pyx":2 - * cimport numpy as np - * from numpy import nan # <<<<<<<<<<<<<< - * from cython import boundscheck, wraparound - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_nan); - __Pyx_GIVEREF(__pyx_n_s_nan); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_nan); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nan, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7 - * from .common cimport _ta_check_success - * - * cdef double NaN = nan # <<<<<<<<<<<<<< - * - * cdef extern from "numpy/arrayobject.h": - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_5talib_4func_NaN = __pyx_t_4; - - /* "talib/func.pyx":15 - * object PyArray_GETCONTIGUOUS(np.ndarray) - * - * np.import_array() # Initialize the NumPy C API # <<<<<<<<<<<<<< - * - * cimport libta_lib as lib - */ - import_array(); - - /* "talib/func.pyx":20 - * from libta_lib cimport TA_RetCode - * - * lib.TA_Initialize() # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - TA_Initialize(); - - /* "talib/func.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_1ACOS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACOS, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":73 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_3AD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AD, __pyx_t_3) < 0) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":161 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_5ADD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD, __pyx_t_3) < 0) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":224 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_7ADOSC, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADOSC, __pyx_t_3) < 0) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_9ADX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADX, __pyx_t_3) < 0) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":392 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_11ADXR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADXR, __pyx_t_3) < 0) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_13APO, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_APO, __pyx_t_3) < 0) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_15AROON, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROON, __pyx_t_3) < 0) __PYX_ERR(0, 522, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_17AROONOSC, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROONOSC, __pyx_t_3) < 0) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":657 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_19ASIN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASIN, __pyx_t_3) < 0) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":706 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_21ATAN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATAN, __pyx_t_3) < 0) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":755 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_23ATR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATR, __pyx_t_3) < 0) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":832 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_25AVGPRICE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AVGPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":920 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_27BBANDS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BBANDS, __pyx_t_3) < 0) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":988 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_29BETA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BETA, __pyx_t_3) < 0) __PYX_ERR(0, 988, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_31BOP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BOP, __pyx_t_3) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1141 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_33CCI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CCI, __pyx_t_3) < 0) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_35CDL2CROWS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL2CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_37CDL3BLACKCROWS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3BLACKCROWS, __pyx_t_3) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_39CDL3INSIDE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3INSIDE, __pyx_t_3) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_41CDL3LINESTRIKE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3LINESTRIKE, __pyx_t_3) < 0) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_43CDL3OUTSIDE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3OUTSIDE, __pyx_t_3) < 0) __PYX_ERR(0, 1570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_45CDL3STARSINSOUTH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3STARSINSOUTH, __pyx_t_3) < 0) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_47CDL3WHITESOLDIERS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3WHITESOLDIERS, __pyx_t_3) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_49CDLABANDONEDBABY, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLABANDONEDBABY, __pyx_t_3) < 0) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_51CDLADVANCEBLOCK, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLADVANCEBLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 1924, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_53CDLBELTHOLD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBELTHOLD, __pyx_t_3) < 0) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2100 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_55CDLBREAKAWAY, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBREAKAWAY, __pyx_t_3) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2188 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_57CDLCLOSINGMARUBOZU, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(0, 2188, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_59CDLCONCEALBABYSWALL, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCONCEALBABYSWALL, __pyx_t_3) < 0) __PYX_ERR(0, 2276, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2364 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_61CDLCOUNTERATTACK, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCOUNTERATTACK, __pyx_t_3) < 0) __PYX_ERR(0, 2364, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2452 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_63CDLDARKCLOUDCOVER, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDARKCLOUDCOVER, __pyx_t_3) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2542 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_65CDLDOJI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 2542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2630 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_67CDLDOJISTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 2630, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_69CDLDRAGONFLYDOJI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDRAGONFLYDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 2718, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2806 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_71CDLENGULFING, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLENGULFING, __pyx_t_3) < 0) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2894 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_73CDLEVENINGDOJISTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 2894, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":2984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_75CDLEVENINGSTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 2984, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3074 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_77CDLGAPSIDESIDEWHITE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_t_3) < 0) __PYX_ERR(0, 3074, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_79CDLGRAVESTONEDOJI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGRAVESTONEDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3250 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_81CDLHAMMER, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHAMMER, __pyx_t_3) < 0) __PYX_ERR(0, 3250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3338 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_83CDLHANGINGMAN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHANGINGMAN, __pyx_t_3) < 0) __PYX_ERR(0, 3338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3426 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_85CDLHARAMI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMI, __pyx_t_3) < 0) __PYX_ERR(0, 3426, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3514 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_87CDLHARAMICROSS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMICROSS, __pyx_t_3) < 0) __PYX_ERR(0, 3514, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3602 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_89CDLHIGHWAVE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIGHWAVE, __pyx_t_3) < 0) __PYX_ERR(0, 3602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3690 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_91CDLHIKKAKE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKE, __pyx_t_3) < 0) __PYX_ERR(0, 3690, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_93CDLHIKKAKEMOD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKEMOD, __pyx_t_3) < 0) __PYX_ERR(0, 3778, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3866 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_95CDLHOMINGPIGEON, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHOMINGPIGEON, __pyx_t_3) < 0) __PYX_ERR(0, 3866, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":3954 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_97CDLIDENTICAL3CROWS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLIDENTICAL3CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 3954, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_99CDLINNECK, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINNECK, __pyx_t_3) < 0) __PYX_ERR(0, 4042, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4130 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_101CDLINVERTEDHAMMER, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINVERTEDHAMMER, __pyx_t_3) < 0) __PYX_ERR(0, 4130, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4218 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_103CDLKICKING, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKING, __pyx_t_3) < 0) __PYX_ERR(0, 4218, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4306 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_105CDLKICKINGBYLENGTH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKINGBYLENGTH, __pyx_t_3) < 0) __PYX_ERR(0, 4306, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4394 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_107CDLLADDERBOTTOM, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLADDERBOTTOM, __pyx_t_3) < 0) __PYX_ERR(0, 4394, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4482 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_109CDLLONGLEGGEDDOJI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 4482, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4570 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_111CDLLONGLINE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLINE, __pyx_t_3) < 0) __PYX_ERR(0, 4570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4658 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_113CDLMARUBOZU, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(0, 4658, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4746 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_115CDLMATCHINGLOW, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATCHINGLOW, __pyx_t_3) < 0) __PYX_ERR(0, 4746, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4834 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_117CDLMATHOLD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATHOLD, __pyx_t_3) < 0) __PYX_ERR(0, 4834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":4924 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_119CDLMORNINGDOJISTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 4924, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5014 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_121CDLMORNINGSTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 5014, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5104 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_123CDLONNECK, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLONNECK, __pyx_t_3) < 0) __PYX_ERR(0, 5104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5192 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_125CDLPIERCING, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLPIERCING, __pyx_t_3) < 0) __PYX_ERR(0, 5192, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5280 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_127CDLRICKSHAWMAN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRICKSHAWMAN, __pyx_t_3) < 0) __PYX_ERR(0, 5280, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5368 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_129CDLRISEFALL3METHODS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRISEFALL3METHODS, __pyx_t_3) < 0) __PYX_ERR(0, 5368, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_131CDLSEPARATINGLINES, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSEPARATINGLINES, __pyx_t_3) < 0) __PYX_ERR(0, 5456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5544 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_133CDLSHOOTINGSTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHOOTINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 5544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5632 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_135CDLSHORTLINE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHORTLINE, __pyx_t_3) < 0) __PYX_ERR(0, 5632, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5720 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_137CDLSPINNINGTOP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSPINNINGTOP, __pyx_t_3) < 0) __PYX_ERR(0, 5720, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5808 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_139CDLSTALLEDPATTERN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTALLEDPATTERN, __pyx_t_3) < 0) __PYX_ERR(0, 5808, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5896 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_141CDLSTICKSANDWICH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTICKSANDWICH, __pyx_t_3) < 0) __PYX_ERR(0, 5896, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":5984 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_143CDLTAKURI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTAKURI, __pyx_t_3) < 0) __PYX_ERR(0, 5984, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6072 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_145CDLTASUKIGAP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTASUKIGAP, __pyx_t_3) < 0) __PYX_ERR(0, 6072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6160 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_147CDLTHRUSTING, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTHRUSTING, __pyx_t_3) < 0) __PYX_ERR(0, 6160, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6248 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_149CDLTRISTAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTRISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 6248, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6336 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_151CDLUNIQUE3RIVER, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUNIQUE3RIVER, __pyx_t_3) < 0) __PYX_ERR(0, 6336, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6424 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_153CDLUPSIDEGAP2CROWS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 6424, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6512 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_155CDLXSIDEGAP3METHODS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_t_3) < 0) __PYX_ERR(0, 6512, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6600 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_157CEIL, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CEIL, __pyx_t_3) < 0) __PYX_ERR(0, 6600, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_159CMO, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMO, __pyx_t_3) < 0) __PYX_ERR(0, 6649, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6700 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_161CORREL, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CORREL, __pyx_t_3) < 0) __PYX_ERR(0, 6700, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6765 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_163COS, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_COS, __pyx_t_3) < 0) __PYX_ERR(0, 6765, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_165COSH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_COSH, __pyx_t_3) < 0) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6863 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_167DEMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEMA, __pyx_t_3) < 0) __PYX_ERR(0, 6863, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_169DIV, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DIV, __pyx_t_3) < 0) __PYX_ERR(0, 6914, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":6977 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_171DX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DX, __pyx_t_3) < 0) __PYX_ERR(0, 6977, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7054 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_173EMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMA, __pyx_t_3) < 0) __PYX_ERR(0, 7054, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7105 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_175EXP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXP, __pyx_t_3) < 0) __PYX_ERR(0, 7105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7154 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_177FLOOR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FLOOR, __pyx_t_3) < 0) __PYX_ERR(0, 7154, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7203 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_179HT_DCPERIOD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPERIOD, __pyx_t_3) < 0) __PYX_ERR(0, 7203, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7252 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_181HT_DCPHASE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPHASE, __pyx_t_3) < 0) __PYX_ERR(0, 7252, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7301 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_183HT_PHASOR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_PHASOR, __pyx_t_3) < 0) __PYX_ERR(0, 7301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_185HT_SINE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_SINE, __pyx_t_3) < 0) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_187HT_TRENDLINE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDLINE, __pyx_t_3) < 0) __PYX_ERR(0, 7413, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_189HT_TRENDMODE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDMODE, __pyx_t_3) < 0) __PYX_ERR(0, 7462, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_191KAMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_KAMA, __pyx_t_3) < 0) __PYX_ERR(0, 7511, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7562 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_193LINEARREG, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG, __pyx_t_3) < 0) __PYX_ERR(0, 7562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_195LINEARREG_ANGLE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_ANGLE, __pyx_t_3) < 0) __PYX_ERR(0, 7613, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_197LINEARREG_INTERCEPT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_INTERCEPT, __pyx_t_3) < 0) __PYX_ERR(0, 7664, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_199LINEARREG_SLOPE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_SLOPE, __pyx_t_3) < 0) __PYX_ERR(0, 7715, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7766 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_201LN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LN, __pyx_t_3) < 0) __PYX_ERR(0, 7766, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7815 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_203LOG10, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOG10, __pyx_t_3) < 0) __PYX_ERR(0, 7815, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7864 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_205MA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA, __pyx_t_3) < 0) __PYX_ERR(0, 7864, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7916 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_207MACD, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACD, __pyx_t_3) < 0) __PYX_ERR(0, 7916, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":7983 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_209MACDEXT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDEXT, __pyx_t_3) < 0) __PYX_ERR(0, 7983, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8053 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_211MACDFIX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDFIX, __pyx_t_3) < 0) __PYX_ERR(0, 8053, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8118 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_213MAMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAMA, __pyx_t_3) < 0) __PYX_ERR(0, 8118, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8177 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_215MAVP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAVP, __pyx_t_3) < 0) __PYX_ERR(0, 8177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8244 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_217MAX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX, __pyx_t_3) < 0) __PYX_ERR(0, 8244, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_219MAXINDEX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINDEX, __pyx_t_3) < 0) __PYX_ERR(0, 8295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_221MEDPRICE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MEDPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 8346, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8408 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_223MFI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MFI, __pyx_t_3) < 0) __PYX_ERR(0, 8408, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8498 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_225MIDPOINT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPOINT, __pyx_t_3) < 0) __PYX_ERR(0, 8498, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8549 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_227MIDPRICE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 8549, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_229MIN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIN, __pyx_t_3) < 0) __PYX_ERR(0, 8613, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8664 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_231MININDEX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MININDEX, __pyx_t_3) < 0) __PYX_ERR(0, 8664, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8715 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_233MINMAX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAX, __pyx_t_3) < 0) __PYX_ERR(0, 8715, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_235MINMAXINDEX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAXINDEX, __pyx_t_3) < 0) __PYX_ERR(0, 8773, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_237MINUS_DI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DI, __pyx_t_3) < 0) __PYX_ERR(0, 8831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8908 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_239MINUS_DM, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DM, __pyx_t_3) < 0) __PYX_ERR(0, 8908, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":8972 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_241MOM, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOM, __pyx_t_3) < 0) __PYX_ERR(0, 8972, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9023 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_243MULT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULT, __pyx_t_3) < 0) __PYX_ERR(0, 9023, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9086 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_245NATR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NATR, __pyx_t_3) < 0) __PYX_ERR(0, 9086, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9163 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_247OBV, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OBV, __pyx_t_3) < 0) __PYX_ERR(0, 9163, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9226 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_249PLUS_DI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DI, __pyx_t_3) < 0) __PYX_ERR(0, 9226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9303 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_251PLUS_DM, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DM, __pyx_t_3) < 0) __PYX_ERR(0, 9303, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9367 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_253PPO, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PPO, __pyx_t_3) < 0) __PYX_ERR(0, 9367, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9420 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_255ROC, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROC, __pyx_t_3) < 0) __PYX_ERR(0, 9420, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9471 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_257ROCP, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCP, __pyx_t_3) < 0) __PYX_ERR(0, 9471, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9522 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_259ROCR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9522, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR, __pyx_t_3) < 0) __PYX_ERR(0, 9522, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9573 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_261ROCR100, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR100, __pyx_t_3) < 0) __PYX_ERR(0, 9573, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9624 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_263RSI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RSI, __pyx_t_3) < 0) __PYX_ERR(0, 9624, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_265SAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAR, __pyx_t_3) < 0) __PYX_ERR(0, 9675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_267SAREXT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAREXT, __pyx_t_3) < 0) __PYX_ERR(0, 9740, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9811 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_269SIN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIN, __pyx_t_3) < 0) __PYX_ERR(0, 9811, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9860 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_271SINH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SINH, __pyx_t_3) < 0) __PYX_ERR(0, 9860, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9909 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_273SMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SMA, __pyx_t_3) < 0) __PYX_ERR(0, 9909, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":9960 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_275SQRT, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQRT, __pyx_t_3) < 0) __PYX_ERR(0, 9960, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10009 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_277STDDEV, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STDDEV, __pyx_t_3) < 0) __PYX_ERR(0, 10009, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10061 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_279STOCH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCH, __pyx_t_3) < 0) __PYX_ERR(0, 10061, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10149 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_281STOCHF, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHF, __pyx_t_3) < 0) __PYX_ERR(0, 10149, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10235 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_283STOCHRSI, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHRSI, __pyx_t_3) < 0) __PYX_ERR(0, 10235, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_285SUB, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUB, __pyx_t_3) < 0) __PYX_ERR(0, 10296, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_287SUM, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUM, __pyx_t_3) < 0) __PYX_ERR(0, 10359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_289T3, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_T3, __pyx_t_3) < 0) __PYX_ERR(0, 10410, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10462 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_291TAN, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAN, __pyx_t_3) < 0) __PYX_ERR(0, 10462, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_293TANH, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TANH, __pyx_t_3) < 0) __PYX_ERR(0, 10511, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10560 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_295TEMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEMA, __pyx_t_3) < 0) __PYX_ERR(0, 10560, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10611 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_297TRANGE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRANGE, __pyx_t_3) < 0) __PYX_ERR(0, 10611, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10686 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_299TRIMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIMA, __pyx_t_3) < 0) __PYX_ERR(0, 10686, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10737 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_301TRIX, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIX, __pyx_t_3) < 0) __PYX_ERR(0, 10737, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10788 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_303TSF, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSF, __pyx_t_3) < 0) __PYX_ERR(0, 10788, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10839 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_305TYPPRICE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 10839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_307ULTOSC, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ULTOSC, __pyx_t_3) < 0) __PYX_ERR(0, 10914, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":10993 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_309VAR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VAR, __pyx_t_3) < 0) __PYX_ERR(0, 10993, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":11045 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_311WCLPRICE, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WCLPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 11045, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":11120 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_313WILLR, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WILLR, __pyx_t_3) < 0) __PYX_ERR(0, 11120, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":11197 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_4func_315WMA, NULL, __pyx_n_s_talib_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WMA, __pyx_t_3) < 0) __PYX_ERR(0, 11197, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":11246 - * return outreal - * - * __all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] # <<<<<<<<<<<<<< - */ - __pyx_t_3 = PyList_New(158); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_ACOS); - __Pyx_GIVEREF(__pyx_n_s_ACOS); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ACOS); - __Pyx_INCREF(__pyx_n_s_AD); - __Pyx_GIVEREF(__pyx_n_s_AD); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_AD); - __Pyx_INCREF(__pyx_n_s_ADD); - __Pyx_GIVEREF(__pyx_n_s_ADD); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ADD); - __Pyx_INCREF(__pyx_n_s_ADOSC); - __Pyx_GIVEREF(__pyx_n_s_ADOSC); - PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ADOSC); - __Pyx_INCREF(__pyx_n_s_ADX); - __Pyx_GIVEREF(__pyx_n_s_ADX); - PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ADX); - __Pyx_INCREF(__pyx_n_s_ADXR); - __Pyx_GIVEREF(__pyx_n_s_ADXR); - PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ADXR); - __Pyx_INCREF(__pyx_n_s_APO); - __Pyx_GIVEREF(__pyx_n_s_APO); - PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_APO); - __Pyx_INCREF(__pyx_n_s_AROON); - __Pyx_GIVEREF(__pyx_n_s_AROON); - PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_AROON); - __Pyx_INCREF(__pyx_n_s_AROONOSC); - __Pyx_GIVEREF(__pyx_n_s_AROONOSC); - PyList_SET_ITEM(__pyx_t_3, 8, __pyx_n_s_AROONOSC); - __Pyx_INCREF(__pyx_n_s_ASIN); - __Pyx_GIVEREF(__pyx_n_s_ASIN); - PyList_SET_ITEM(__pyx_t_3, 9, __pyx_n_s_ASIN); - __Pyx_INCREF(__pyx_n_s_ATAN); - __Pyx_GIVEREF(__pyx_n_s_ATAN); - PyList_SET_ITEM(__pyx_t_3, 10, __pyx_n_s_ATAN); - __Pyx_INCREF(__pyx_n_s_ATR); - __Pyx_GIVEREF(__pyx_n_s_ATR); - PyList_SET_ITEM(__pyx_t_3, 11, __pyx_n_s_ATR); - __Pyx_INCREF(__pyx_n_s_AVGPRICE); - __Pyx_GIVEREF(__pyx_n_s_AVGPRICE); - PyList_SET_ITEM(__pyx_t_3, 12, __pyx_n_s_AVGPRICE); - __Pyx_INCREF(__pyx_n_s_BBANDS); - __Pyx_GIVEREF(__pyx_n_s_BBANDS); - PyList_SET_ITEM(__pyx_t_3, 13, __pyx_n_s_BBANDS); - __Pyx_INCREF(__pyx_n_s_BETA); - __Pyx_GIVEREF(__pyx_n_s_BETA); - PyList_SET_ITEM(__pyx_t_3, 14, __pyx_n_s_BETA); - __Pyx_INCREF(__pyx_n_s_BOP); - __Pyx_GIVEREF(__pyx_n_s_BOP); - PyList_SET_ITEM(__pyx_t_3, 15, __pyx_n_s_BOP); - __Pyx_INCREF(__pyx_n_s_CCI); - __Pyx_GIVEREF(__pyx_n_s_CCI); - PyList_SET_ITEM(__pyx_t_3, 16, __pyx_n_s_CCI); - __Pyx_INCREF(__pyx_n_s_CDL2CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDL2CROWS); - PyList_SET_ITEM(__pyx_t_3, 17, __pyx_n_s_CDL2CROWS); - __Pyx_INCREF(__pyx_n_s_CDL3BLACKCROWS); - __Pyx_GIVEREF(__pyx_n_s_CDL3BLACKCROWS); - PyList_SET_ITEM(__pyx_t_3, 18, __pyx_n_s_CDL3BLACKCROWS); - __Pyx_INCREF(__pyx_n_s_CDL3INSIDE); - __Pyx_GIVEREF(__pyx_n_s_CDL3INSIDE); - PyList_SET_ITEM(__pyx_t_3, 19, __pyx_n_s_CDL3INSIDE); - __Pyx_INCREF(__pyx_n_s_CDL3LINESTRIKE); - __Pyx_GIVEREF(__pyx_n_s_CDL3LINESTRIKE); - PyList_SET_ITEM(__pyx_t_3, 20, __pyx_n_s_CDL3LINESTRIKE); - __Pyx_INCREF(__pyx_n_s_CDL3OUTSIDE); - __Pyx_GIVEREF(__pyx_n_s_CDL3OUTSIDE); - PyList_SET_ITEM(__pyx_t_3, 21, __pyx_n_s_CDL3OUTSIDE); - __Pyx_INCREF(__pyx_n_s_CDL3STARSINSOUTH); - __Pyx_GIVEREF(__pyx_n_s_CDL3STARSINSOUTH); - PyList_SET_ITEM(__pyx_t_3, 22, __pyx_n_s_CDL3STARSINSOUTH); - __Pyx_INCREF(__pyx_n_s_CDL3WHITESOLDIERS); - __Pyx_GIVEREF(__pyx_n_s_CDL3WHITESOLDIERS); - PyList_SET_ITEM(__pyx_t_3, 23, __pyx_n_s_CDL3WHITESOLDIERS); - __Pyx_INCREF(__pyx_n_s_CDLABANDONEDBABY); - __Pyx_GIVEREF(__pyx_n_s_CDLABANDONEDBABY); - PyList_SET_ITEM(__pyx_t_3, 24, __pyx_n_s_CDLABANDONEDBABY); - __Pyx_INCREF(__pyx_n_s_CDLADVANCEBLOCK); - __Pyx_GIVEREF(__pyx_n_s_CDLADVANCEBLOCK); - PyList_SET_ITEM(__pyx_t_3, 25, __pyx_n_s_CDLADVANCEBLOCK); - __Pyx_INCREF(__pyx_n_s_CDLBELTHOLD); - __Pyx_GIVEREF(__pyx_n_s_CDLBELTHOLD); - PyList_SET_ITEM(__pyx_t_3, 26, __pyx_n_s_CDLBELTHOLD); - __Pyx_INCREF(__pyx_n_s_CDLBREAKAWAY); - __Pyx_GIVEREF(__pyx_n_s_CDLBREAKAWAY); - PyList_SET_ITEM(__pyx_t_3, 27, __pyx_n_s_CDLBREAKAWAY); - __Pyx_INCREF(__pyx_n_s_CDLCLOSINGMARUBOZU); - __Pyx_GIVEREF(__pyx_n_s_CDLCLOSINGMARUBOZU); - PyList_SET_ITEM(__pyx_t_3, 28, __pyx_n_s_CDLCLOSINGMARUBOZU); - __Pyx_INCREF(__pyx_n_s_CDLCONCEALBABYSWALL); - __Pyx_GIVEREF(__pyx_n_s_CDLCONCEALBABYSWALL); - PyList_SET_ITEM(__pyx_t_3, 29, __pyx_n_s_CDLCONCEALBABYSWALL); - __Pyx_INCREF(__pyx_n_s_CDLCOUNTERATTACK); - __Pyx_GIVEREF(__pyx_n_s_CDLCOUNTERATTACK); - PyList_SET_ITEM(__pyx_t_3, 30, __pyx_n_s_CDLCOUNTERATTACK); - __Pyx_INCREF(__pyx_n_s_CDLDARKCLOUDCOVER); - __Pyx_GIVEREF(__pyx_n_s_CDLDARKCLOUDCOVER); - PyList_SET_ITEM(__pyx_t_3, 31, __pyx_n_s_CDLDARKCLOUDCOVER); - __Pyx_INCREF(__pyx_n_s_CDLDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLDOJI); - PyList_SET_ITEM(__pyx_t_3, 32, __pyx_n_s_CDLDOJI); - __Pyx_INCREF(__pyx_n_s_CDLDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 33, __pyx_n_s_CDLDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLDRAGONFLYDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLDRAGONFLYDOJI); - PyList_SET_ITEM(__pyx_t_3, 34, __pyx_n_s_CDLDRAGONFLYDOJI); - __Pyx_INCREF(__pyx_n_s_CDLENGULFING); - __Pyx_GIVEREF(__pyx_n_s_CDLENGULFING); - PyList_SET_ITEM(__pyx_t_3, 35, __pyx_n_s_CDLENGULFING); - __Pyx_INCREF(__pyx_n_s_CDLEVENINGDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 36, __pyx_n_s_CDLEVENINGDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLEVENINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 37, __pyx_n_s_CDLEVENINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); - __Pyx_GIVEREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); - PyList_SET_ITEM(__pyx_t_3, 38, __pyx_n_s_CDLGAPSIDESIDEWHITE); - __Pyx_INCREF(__pyx_n_s_CDLGRAVESTONEDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLGRAVESTONEDOJI); - PyList_SET_ITEM(__pyx_t_3, 39, __pyx_n_s_CDLGRAVESTONEDOJI); - __Pyx_INCREF(__pyx_n_s_CDLHAMMER); - __Pyx_GIVEREF(__pyx_n_s_CDLHAMMER); - PyList_SET_ITEM(__pyx_t_3, 40, __pyx_n_s_CDLHAMMER); - __Pyx_INCREF(__pyx_n_s_CDLHANGINGMAN); - __Pyx_GIVEREF(__pyx_n_s_CDLHANGINGMAN); - PyList_SET_ITEM(__pyx_t_3, 41, __pyx_n_s_CDLHANGINGMAN); - __Pyx_INCREF(__pyx_n_s_CDLHARAMI); - __Pyx_GIVEREF(__pyx_n_s_CDLHARAMI); - PyList_SET_ITEM(__pyx_t_3, 42, __pyx_n_s_CDLHARAMI); - __Pyx_INCREF(__pyx_n_s_CDLHARAMICROSS); - __Pyx_GIVEREF(__pyx_n_s_CDLHARAMICROSS); - PyList_SET_ITEM(__pyx_t_3, 43, __pyx_n_s_CDLHARAMICROSS); - __Pyx_INCREF(__pyx_n_s_CDLHIGHWAVE); - __Pyx_GIVEREF(__pyx_n_s_CDLHIGHWAVE); - PyList_SET_ITEM(__pyx_t_3, 44, __pyx_n_s_CDLHIGHWAVE); - __Pyx_INCREF(__pyx_n_s_CDLHIKKAKE); - __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKE); - PyList_SET_ITEM(__pyx_t_3, 45, __pyx_n_s_CDLHIKKAKE); - __Pyx_INCREF(__pyx_n_s_CDLHIKKAKEMOD); - __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKEMOD); - PyList_SET_ITEM(__pyx_t_3, 46, __pyx_n_s_CDLHIKKAKEMOD); - __Pyx_INCREF(__pyx_n_s_CDLHOMINGPIGEON); - __Pyx_GIVEREF(__pyx_n_s_CDLHOMINGPIGEON); - PyList_SET_ITEM(__pyx_t_3, 47, __pyx_n_s_CDLHOMINGPIGEON); - __Pyx_INCREF(__pyx_n_s_CDLIDENTICAL3CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDLIDENTICAL3CROWS); - PyList_SET_ITEM(__pyx_t_3, 48, __pyx_n_s_CDLIDENTICAL3CROWS); - __Pyx_INCREF(__pyx_n_s_CDLINNECK); - __Pyx_GIVEREF(__pyx_n_s_CDLINNECK); - PyList_SET_ITEM(__pyx_t_3, 49, __pyx_n_s_CDLINNECK); - __Pyx_INCREF(__pyx_n_s_CDLINVERTEDHAMMER); - __Pyx_GIVEREF(__pyx_n_s_CDLINVERTEDHAMMER); - PyList_SET_ITEM(__pyx_t_3, 50, __pyx_n_s_CDLINVERTEDHAMMER); - __Pyx_INCREF(__pyx_n_s_CDLKICKING); - __Pyx_GIVEREF(__pyx_n_s_CDLKICKING); - PyList_SET_ITEM(__pyx_t_3, 51, __pyx_n_s_CDLKICKING); - __Pyx_INCREF(__pyx_n_s_CDLKICKINGBYLENGTH); - __Pyx_GIVEREF(__pyx_n_s_CDLKICKINGBYLENGTH); - PyList_SET_ITEM(__pyx_t_3, 52, __pyx_n_s_CDLKICKINGBYLENGTH); - __Pyx_INCREF(__pyx_n_s_CDLLADDERBOTTOM); - __Pyx_GIVEREF(__pyx_n_s_CDLLADDERBOTTOM); - PyList_SET_ITEM(__pyx_t_3, 53, __pyx_n_s_CDLLADDERBOTTOM); - __Pyx_INCREF(__pyx_n_s_CDLLONGLEGGEDDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLLONGLEGGEDDOJI); - PyList_SET_ITEM(__pyx_t_3, 54, __pyx_n_s_CDLLONGLEGGEDDOJI); - __Pyx_INCREF(__pyx_n_s_CDLLONGLINE); - __Pyx_GIVEREF(__pyx_n_s_CDLLONGLINE); - PyList_SET_ITEM(__pyx_t_3, 55, __pyx_n_s_CDLLONGLINE); - __Pyx_INCREF(__pyx_n_s_CDLMARUBOZU); - __Pyx_GIVEREF(__pyx_n_s_CDLMARUBOZU); - PyList_SET_ITEM(__pyx_t_3, 56, __pyx_n_s_CDLMARUBOZU); - __Pyx_INCREF(__pyx_n_s_CDLMATCHINGLOW); - __Pyx_GIVEREF(__pyx_n_s_CDLMATCHINGLOW); - PyList_SET_ITEM(__pyx_t_3, 57, __pyx_n_s_CDLMATCHINGLOW); - __Pyx_INCREF(__pyx_n_s_CDLMATHOLD); - __Pyx_GIVEREF(__pyx_n_s_CDLMATHOLD); - PyList_SET_ITEM(__pyx_t_3, 58, __pyx_n_s_CDLMATHOLD); - __Pyx_INCREF(__pyx_n_s_CDLMORNINGDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 59, __pyx_n_s_CDLMORNINGDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLMORNINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 60, __pyx_n_s_CDLMORNINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLONNECK); - __Pyx_GIVEREF(__pyx_n_s_CDLONNECK); - PyList_SET_ITEM(__pyx_t_3, 61, __pyx_n_s_CDLONNECK); - __Pyx_INCREF(__pyx_n_s_CDLPIERCING); - __Pyx_GIVEREF(__pyx_n_s_CDLPIERCING); - PyList_SET_ITEM(__pyx_t_3, 62, __pyx_n_s_CDLPIERCING); - __Pyx_INCREF(__pyx_n_s_CDLRICKSHAWMAN); - __Pyx_GIVEREF(__pyx_n_s_CDLRICKSHAWMAN); - PyList_SET_ITEM(__pyx_t_3, 63, __pyx_n_s_CDLRICKSHAWMAN); - __Pyx_INCREF(__pyx_n_s_CDLRISEFALL3METHODS); - __Pyx_GIVEREF(__pyx_n_s_CDLRISEFALL3METHODS); - PyList_SET_ITEM(__pyx_t_3, 64, __pyx_n_s_CDLRISEFALL3METHODS); - __Pyx_INCREF(__pyx_n_s_CDLSEPARATINGLINES); - __Pyx_GIVEREF(__pyx_n_s_CDLSEPARATINGLINES); - PyList_SET_ITEM(__pyx_t_3, 65, __pyx_n_s_CDLSEPARATINGLINES); - __Pyx_INCREF(__pyx_n_s_CDLSHOOTINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLSHOOTINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 66, __pyx_n_s_CDLSHOOTINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLSHORTLINE); - __Pyx_GIVEREF(__pyx_n_s_CDLSHORTLINE); - PyList_SET_ITEM(__pyx_t_3, 67, __pyx_n_s_CDLSHORTLINE); - __Pyx_INCREF(__pyx_n_s_CDLSPINNINGTOP); - __Pyx_GIVEREF(__pyx_n_s_CDLSPINNINGTOP); - PyList_SET_ITEM(__pyx_t_3, 68, __pyx_n_s_CDLSPINNINGTOP); - __Pyx_INCREF(__pyx_n_s_CDLSTALLEDPATTERN); - __Pyx_GIVEREF(__pyx_n_s_CDLSTALLEDPATTERN); - PyList_SET_ITEM(__pyx_t_3, 69, __pyx_n_s_CDLSTALLEDPATTERN); - __Pyx_INCREF(__pyx_n_s_CDLSTICKSANDWICH); - __Pyx_GIVEREF(__pyx_n_s_CDLSTICKSANDWICH); - PyList_SET_ITEM(__pyx_t_3, 70, __pyx_n_s_CDLSTICKSANDWICH); - __Pyx_INCREF(__pyx_n_s_CDLTAKURI); - __Pyx_GIVEREF(__pyx_n_s_CDLTAKURI); - PyList_SET_ITEM(__pyx_t_3, 71, __pyx_n_s_CDLTAKURI); - __Pyx_INCREF(__pyx_n_s_CDLTASUKIGAP); - __Pyx_GIVEREF(__pyx_n_s_CDLTASUKIGAP); - PyList_SET_ITEM(__pyx_t_3, 72, __pyx_n_s_CDLTASUKIGAP); - __Pyx_INCREF(__pyx_n_s_CDLTHRUSTING); - __Pyx_GIVEREF(__pyx_n_s_CDLTHRUSTING); - PyList_SET_ITEM(__pyx_t_3, 73, __pyx_n_s_CDLTHRUSTING); - __Pyx_INCREF(__pyx_n_s_CDLTRISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLTRISTAR); - PyList_SET_ITEM(__pyx_t_3, 74, __pyx_n_s_CDLTRISTAR); - __Pyx_INCREF(__pyx_n_s_CDLUNIQUE3RIVER); - __Pyx_GIVEREF(__pyx_n_s_CDLUNIQUE3RIVER); - PyList_SET_ITEM(__pyx_t_3, 75, __pyx_n_s_CDLUNIQUE3RIVER); - __Pyx_INCREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); - PyList_SET_ITEM(__pyx_t_3, 76, __pyx_n_s_CDLUPSIDEGAP2CROWS); - __Pyx_INCREF(__pyx_n_s_CDLXSIDEGAP3METHODS); - __Pyx_GIVEREF(__pyx_n_s_CDLXSIDEGAP3METHODS); - PyList_SET_ITEM(__pyx_t_3, 77, __pyx_n_s_CDLXSIDEGAP3METHODS); - __Pyx_INCREF(__pyx_n_s_CEIL); - __Pyx_GIVEREF(__pyx_n_s_CEIL); - PyList_SET_ITEM(__pyx_t_3, 78, __pyx_n_s_CEIL); - __Pyx_INCREF(__pyx_n_s_CMO); - __Pyx_GIVEREF(__pyx_n_s_CMO); - PyList_SET_ITEM(__pyx_t_3, 79, __pyx_n_s_CMO); - __Pyx_INCREF(__pyx_n_s_CORREL); - __Pyx_GIVEREF(__pyx_n_s_CORREL); - PyList_SET_ITEM(__pyx_t_3, 80, __pyx_n_s_CORREL); - __Pyx_INCREF(__pyx_n_s_COS); - __Pyx_GIVEREF(__pyx_n_s_COS); - PyList_SET_ITEM(__pyx_t_3, 81, __pyx_n_s_COS); - __Pyx_INCREF(__pyx_n_s_COSH); - __Pyx_GIVEREF(__pyx_n_s_COSH); - PyList_SET_ITEM(__pyx_t_3, 82, __pyx_n_s_COSH); - __Pyx_INCREF(__pyx_n_s_DEMA); - __Pyx_GIVEREF(__pyx_n_s_DEMA); - PyList_SET_ITEM(__pyx_t_3, 83, __pyx_n_s_DEMA); - __Pyx_INCREF(__pyx_n_s_DIV); - __Pyx_GIVEREF(__pyx_n_s_DIV); - PyList_SET_ITEM(__pyx_t_3, 84, __pyx_n_s_DIV); - __Pyx_INCREF(__pyx_n_s_DX); - __Pyx_GIVEREF(__pyx_n_s_DX); - PyList_SET_ITEM(__pyx_t_3, 85, __pyx_n_s_DX); - __Pyx_INCREF(__pyx_n_s_EMA); - __Pyx_GIVEREF(__pyx_n_s_EMA); - PyList_SET_ITEM(__pyx_t_3, 86, __pyx_n_s_EMA); - __Pyx_INCREF(__pyx_n_s_EXP); - __Pyx_GIVEREF(__pyx_n_s_EXP); - PyList_SET_ITEM(__pyx_t_3, 87, __pyx_n_s_EXP); - __Pyx_INCREF(__pyx_n_s_FLOOR); - __Pyx_GIVEREF(__pyx_n_s_FLOOR); - PyList_SET_ITEM(__pyx_t_3, 88, __pyx_n_s_FLOOR); - __Pyx_INCREF(__pyx_n_s_HT_DCPERIOD); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPERIOD); - PyList_SET_ITEM(__pyx_t_3, 89, __pyx_n_s_HT_DCPERIOD); - __Pyx_INCREF(__pyx_n_s_HT_DCPHASE); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPHASE); - PyList_SET_ITEM(__pyx_t_3, 90, __pyx_n_s_HT_DCPHASE); - __Pyx_INCREF(__pyx_n_s_HT_PHASOR); - __Pyx_GIVEREF(__pyx_n_s_HT_PHASOR); - PyList_SET_ITEM(__pyx_t_3, 91, __pyx_n_s_HT_PHASOR); - __Pyx_INCREF(__pyx_n_s_HT_SINE); - __Pyx_GIVEREF(__pyx_n_s_HT_SINE); - PyList_SET_ITEM(__pyx_t_3, 92, __pyx_n_s_HT_SINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDLINE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDLINE); - PyList_SET_ITEM(__pyx_t_3, 93, __pyx_n_s_HT_TRENDLINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDMODE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDMODE); - PyList_SET_ITEM(__pyx_t_3, 94, __pyx_n_s_HT_TRENDMODE); - __Pyx_INCREF(__pyx_n_s_KAMA); - __Pyx_GIVEREF(__pyx_n_s_KAMA); - PyList_SET_ITEM(__pyx_t_3, 95, __pyx_n_s_KAMA); - __Pyx_INCREF(__pyx_n_s_LINEARREG); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG); - PyList_SET_ITEM(__pyx_t_3, 96, __pyx_n_s_LINEARREG); - __Pyx_INCREF(__pyx_n_s_LINEARREG_ANGLE); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_ANGLE); - PyList_SET_ITEM(__pyx_t_3, 97, __pyx_n_s_LINEARREG_ANGLE); - __Pyx_INCREF(__pyx_n_s_LINEARREG_INTERCEPT); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_INTERCEPT); - PyList_SET_ITEM(__pyx_t_3, 98, __pyx_n_s_LINEARREG_INTERCEPT); - __Pyx_INCREF(__pyx_n_s_LINEARREG_SLOPE); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_SLOPE); - PyList_SET_ITEM(__pyx_t_3, 99, __pyx_n_s_LINEARREG_SLOPE); - __Pyx_INCREF(__pyx_n_s_LN); - __Pyx_GIVEREF(__pyx_n_s_LN); - PyList_SET_ITEM(__pyx_t_3, 100, __pyx_n_s_LN); - __Pyx_INCREF(__pyx_n_s_LOG10); - __Pyx_GIVEREF(__pyx_n_s_LOG10); - PyList_SET_ITEM(__pyx_t_3, 101, __pyx_n_s_LOG10); - __Pyx_INCREF(__pyx_n_s_MA); - __Pyx_GIVEREF(__pyx_n_s_MA); - PyList_SET_ITEM(__pyx_t_3, 102, __pyx_n_s_MA); - __Pyx_INCREF(__pyx_n_s_MACD); - __Pyx_GIVEREF(__pyx_n_s_MACD); - PyList_SET_ITEM(__pyx_t_3, 103, __pyx_n_s_MACD); - __Pyx_INCREF(__pyx_n_s_MACDEXT); - __Pyx_GIVEREF(__pyx_n_s_MACDEXT); - PyList_SET_ITEM(__pyx_t_3, 104, __pyx_n_s_MACDEXT); - __Pyx_INCREF(__pyx_n_s_MACDFIX); - __Pyx_GIVEREF(__pyx_n_s_MACDFIX); - PyList_SET_ITEM(__pyx_t_3, 105, __pyx_n_s_MACDFIX); - __Pyx_INCREF(__pyx_n_s_MAMA); - __Pyx_GIVEREF(__pyx_n_s_MAMA); - PyList_SET_ITEM(__pyx_t_3, 106, __pyx_n_s_MAMA); - __Pyx_INCREF(__pyx_n_s_MAVP); - __Pyx_GIVEREF(__pyx_n_s_MAVP); - PyList_SET_ITEM(__pyx_t_3, 107, __pyx_n_s_MAVP); - __Pyx_INCREF(__pyx_n_s_MAX); - __Pyx_GIVEREF(__pyx_n_s_MAX); - PyList_SET_ITEM(__pyx_t_3, 108, __pyx_n_s_MAX); - __Pyx_INCREF(__pyx_n_s_MAXINDEX); - __Pyx_GIVEREF(__pyx_n_s_MAXINDEX); - PyList_SET_ITEM(__pyx_t_3, 109, __pyx_n_s_MAXINDEX); - __Pyx_INCREF(__pyx_n_s_MEDPRICE); - __Pyx_GIVEREF(__pyx_n_s_MEDPRICE); - PyList_SET_ITEM(__pyx_t_3, 110, __pyx_n_s_MEDPRICE); - __Pyx_INCREF(__pyx_n_s_MFI); - __Pyx_GIVEREF(__pyx_n_s_MFI); - PyList_SET_ITEM(__pyx_t_3, 111, __pyx_n_s_MFI); - __Pyx_INCREF(__pyx_n_s_MIDPOINT); - __Pyx_GIVEREF(__pyx_n_s_MIDPOINT); - PyList_SET_ITEM(__pyx_t_3, 112, __pyx_n_s_MIDPOINT); - __Pyx_INCREF(__pyx_n_s_MIDPRICE); - __Pyx_GIVEREF(__pyx_n_s_MIDPRICE); - PyList_SET_ITEM(__pyx_t_3, 113, __pyx_n_s_MIDPRICE); - __Pyx_INCREF(__pyx_n_s_MIN); - __Pyx_GIVEREF(__pyx_n_s_MIN); - PyList_SET_ITEM(__pyx_t_3, 114, __pyx_n_s_MIN); - __Pyx_INCREF(__pyx_n_s_MININDEX); - __Pyx_GIVEREF(__pyx_n_s_MININDEX); - PyList_SET_ITEM(__pyx_t_3, 115, __pyx_n_s_MININDEX); - __Pyx_INCREF(__pyx_n_s_MINMAX); - __Pyx_GIVEREF(__pyx_n_s_MINMAX); - PyList_SET_ITEM(__pyx_t_3, 116, __pyx_n_s_MINMAX); - __Pyx_INCREF(__pyx_n_s_MINMAXINDEX); - __Pyx_GIVEREF(__pyx_n_s_MINMAXINDEX); - PyList_SET_ITEM(__pyx_t_3, 117, __pyx_n_s_MINMAXINDEX); - __Pyx_INCREF(__pyx_n_s_MINUS_DI); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DI); - PyList_SET_ITEM(__pyx_t_3, 118, __pyx_n_s_MINUS_DI); - __Pyx_INCREF(__pyx_n_s_MINUS_DM); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DM); - PyList_SET_ITEM(__pyx_t_3, 119, __pyx_n_s_MINUS_DM); - __Pyx_INCREF(__pyx_n_s_MOM); - __Pyx_GIVEREF(__pyx_n_s_MOM); - PyList_SET_ITEM(__pyx_t_3, 120, __pyx_n_s_MOM); - __Pyx_INCREF(__pyx_n_s_MULT); - __Pyx_GIVEREF(__pyx_n_s_MULT); - PyList_SET_ITEM(__pyx_t_3, 121, __pyx_n_s_MULT); - __Pyx_INCREF(__pyx_n_s_NATR); - __Pyx_GIVEREF(__pyx_n_s_NATR); - PyList_SET_ITEM(__pyx_t_3, 122, __pyx_n_s_NATR); - __Pyx_INCREF(__pyx_n_s_OBV); - __Pyx_GIVEREF(__pyx_n_s_OBV); - PyList_SET_ITEM(__pyx_t_3, 123, __pyx_n_s_OBV); - __Pyx_INCREF(__pyx_n_s_PLUS_DI); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DI); - PyList_SET_ITEM(__pyx_t_3, 124, __pyx_n_s_PLUS_DI); - __Pyx_INCREF(__pyx_n_s_PLUS_DM); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DM); - PyList_SET_ITEM(__pyx_t_3, 125, __pyx_n_s_PLUS_DM); - __Pyx_INCREF(__pyx_n_s_PPO); - __Pyx_GIVEREF(__pyx_n_s_PPO); - PyList_SET_ITEM(__pyx_t_3, 126, __pyx_n_s_PPO); - __Pyx_INCREF(__pyx_n_s_ROC); - __Pyx_GIVEREF(__pyx_n_s_ROC); - PyList_SET_ITEM(__pyx_t_3, 127, __pyx_n_s_ROC); - __Pyx_INCREF(__pyx_n_s_ROCP); - __Pyx_GIVEREF(__pyx_n_s_ROCP); - PyList_SET_ITEM(__pyx_t_3, 128, __pyx_n_s_ROCP); - __Pyx_INCREF(__pyx_n_s_ROCR); - __Pyx_GIVEREF(__pyx_n_s_ROCR); - PyList_SET_ITEM(__pyx_t_3, 129, __pyx_n_s_ROCR); - __Pyx_INCREF(__pyx_n_s_ROCR100); - __Pyx_GIVEREF(__pyx_n_s_ROCR100); - PyList_SET_ITEM(__pyx_t_3, 130, __pyx_n_s_ROCR100); - __Pyx_INCREF(__pyx_n_s_RSI); - __Pyx_GIVEREF(__pyx_n_s_RSI); - PyList_SET_ITEM(__pyx_t_3, 131, __pyx_n_s_RSI); - __Pyx_INCREF(__pyx_n_s_SAR); - __Pyx_GIVEREF(__pyx_n_s_SAR); - PyList_SET_ITEM(__pyx_t_3, 132, __pyx_n_s_SAR); - __Pyx_INCREF(__pyx_n_s_SAREXT); - __Pyx_GIVEREF(__pyx_n_s_SAREXT); - PyList_SET_ITEM(__pyx_t_3, 133, __pyx_n_s_SAREXT); - __Pyx_INCREF(__pyx_n_s_SIN); - __Pyx_GIVEREF(__pyx_n_s_SIN); - PyList_SET_ITEM(__pyx_t_3, 134, __pyx_n_s_SIN); - __Pyx_INCREF(__pyx_n_s_SINH); - __Pyx_GIVEREF(__pyx_n_s_SINH); - PyList_SET_ITEM(__pyx_t_3, 135, __pyx_n_s_SINH); - __Pyx_INCREF(__pyx_n_s_SMA); - __Pyx_GIVEREF(__pyx_n_s_SMA); - PyList_SET_ITEM(__pyx_t_3, 136, __pyx_n_s_SMA); - __Pyx_INCREF(__pyx_n_s_SQRT); - __Pyx_GIVEREF(__pyx_n_s_SQRT); - PyList_SET_ITEM(__pyx_t_3, 137, __pyx_n_s_SQRT); - __Pyx_INCREF(__pyx_n_s_STDDEV); - __Pyx_GIVEREF(__pyx_n_s_STDDEV); - PyList_SET_ITEM(__pyx_t_3, 138, __pyx_n_s_STDDEV); - __Pyx_INCREF(__pyx_n_s_STOCH); - __Pyx_GIVEREF(__pyx_n_s_STOCH); - PyList_SET_ITEM(__pyx_t_3, 139, __pyx_n_s_STOCH); - __Pyx_INCREF(__pyx_n_s_STOCHF); - __Pyx_GIVEREF(__pyx_n_s_STOCHF); - PyList_SET_ITEM(__pyx_t_3, 140, __pyx_n_s_STOCHF); - __Pyx_INCREF(__pyx_n_s_STOCHRSI); - __Pyx_GIVEREF(__pyx_n_s_STOCHRSI); - PyList_SET_ITEM(__pyx_t_3, 141, __pyx_n_s_STOCHRSI); - __Pyx_INCREF(__pyx_n_s_SUB); - __Pyx_GIVEREF(__pyx_n_s_SUB); - PyList_SET_ITEM(__pyx_t_3, 142, __pyx_n_s_SUB); - __Pyx_INCREF(__pyx_n_s_SUM); - __Pyx_GIVEREF(__pyx_n_s_SUM); - PyList_SET_ITEM(__pyx_t_3, 143, __pyx_n_s_SUM); - __Pyx_INCREF(__pyx_n_s_T3); - __Pyx_GIVEREF(__pyx_n_s_T3); - PyList_SET_ITEM(__pyx_t_3, 144, __pyx_n_s_T3); - __Pyx_INCREF(__pyx_n_s_TAN); - __Pyx_GIVEREF(__pyx_n_s_TAN); - PyList_SET_ITEM(__pyx_t_3, 145, __pyx_n_s_TAN); - __Pyx_INCREF(__pyx_n_s_TANH); - __Pyx_GIVEREF(__pyx_n_s_TANH); - PyList_SET_ITEM(__pyx_t_3, 146, __pyx_n_s_TANH); - __Pyx_INCREF(__pyx_n_s_TEMA); - __Pyx_GIVEREF(__pyx_n_s_TEMA); - PyList_SET_ITEM(__pyx_t_3, 147, __pyx_n_s_TEMA); - __Pyx_INCREF(__pyx_n_s_TRANGE); - __Pyx_GIVEREF(__pyx_n_s_TRANGE); - PyList_SET_ITEM(__pyx_t_3, 148, __pyx_n_s_TRANGE); - __Pyx_INCREF(__pyx_n_s_TRIMA); - __Pyx_GIVEREF(__pyx_n_s_TRIMA); - PyList_SET_ITEM(__pyx_t_3, 149, __pyx_n_s_TRIMA); - __Pyx_INCREF(__pyx_n_s_TRIX); - __Pyx_GIVEREF(__pyx_n_s_TRIX); - PyList_SET_ITEM(__pyx_t_3, 150, __pyx_n_s_TRIX); - __Pyx_INCREF(__pyx_n_s_TSF); - __Pyx_GIVEREF(__pyx_n_s_TSF); - PyList_SET_ITEM(__pyx_t_3, 151, __pyx_n_s_TSF); - __Pyx_INCREF(__pyx_n_s_TYPPRICE); - __Pyx_GIVEREF(__pyx_n_s_TYPPRICE); - PyList_SET_ITEM(__pyx_t_3, 152, __pyx_n_s_TYPPRICE); - __Pyx_INCREF(__pyx_n_s_ULTOSC); - __Pyx_GIVEREF(__pyx_n_s_ULTOSC); - PyList_SET_ITEM(__pyx_t_3, 153, __pyx_n_s_ULTOSC); - __Pyx_INCREF(__pyx_n_s_VAR); - __Pyx_GIVEREF(__pyx_n_s_VAR); - PyList_SET_ITEM(__pyx_t_3, 154, __pyx_n_s_VAR); - __Pyx_INCREF(__pyx_n_s_WCLPRICE); - __Pyx_GIVEREF(__pyx_n_s_WCLPRICE); - PyList_SET_ITEM(__pyx_t_3, 155, __pyx_n_s_WCLPRICE); - __Pyx_INCREF(__pyx_n_s_WILLR); - __Pyx_GIVEREF(__pyx_n_s_WILLR); - PyList_SET_ITEM(__pyx_t_3, 156, __pyx_n_s_WILLR); - __Pyx_INCREF(__pyx_n_s_WMA); - __Pyx_GIVEREF(__pyx_n_s_WMA); - PyList_SET_ITEM(__pyx_t_3, 157, __pyx_n_s_WMA); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 11246, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/func.pyx":1 - * cimport numpy as np # <<<<<<<<<<<<<< - * from numpy import nan - * from cython import boundscheck, wraparound - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init talib.func", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init talib.func"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); - case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); - case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_absf(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); - case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); - case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_abs(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -/* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); - if (!d) - goto bad; - cobj = PyDict_GetItemString(d, funcname); - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C function %.200s", - PyModule_GetName(module), funcname); - goto bad; - } -#if PY_VERSION_HEX >= 0x02070000 - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); -#else - {const char *desc, *s1, *s2; - desc = (const char *)PyCObject_GetDesc(cobj); - if (!desc) - goto bad; - s1 = desc; s2 = sig; - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - if (*s1 != *s2) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, desc); - goto bad; - } - tmp.p = PyCObject_AsVoidPtr(cobj);} -#endif - *f = tmp.fp; - if (!(*f)) - goto bad; - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(d); - return -1; -} -#endif - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/talib/stream.c b/talib/stream.c deleted file mode 100644 index 6dcf16bf5..000000000 --- a/talib/stream.c +++ /dev/null @@ -1,102155 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__talib__stream -#define __PYX_HAVE_API__talib__stream -#include "string.h" -#include "stdio.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#if defined(WIN32) || defined(MS_WINDOWS) -#include "ta_libc.h" -#else -#include "ta-lib/ta_defs.h" -#include "ta-lib/ta_common.h" -#include "ta-lib/ta_abstract.h" -#include "ta-lib/ta_func.h" -#endif -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* None.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - - -static const char *__pyx_f[] = { - "talib/stream.pyx", - "__init__.pxd", - "type.pxd", -}; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - - -/*--- Type declarations ---*/ - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -/* ModuleImport.proto */ -static PyObject *__Pyx_ImportModule(const char *name); - -/* TypeImport.proto */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -/* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'talib.libta_lib' */ - -/* Module declarations from 'talib.common' */ -static PyObject *(*__pyx_f_5talib_6common__ta_check_success)(PyObject *, TA_RetCode, int __pyx_skip_dispatch); /*proto*/ - -/* Module declarations from 'talib.stream' */ -static double __pyx_v_5talib_6stream_NaN; -#define __Pyx_MODULE_NAME "talib.stream" -int __pyx_module_is_main_talib__stream = 0; - -/* Implementation of 'talib.stream' */ -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static const char __pyx_k_AD[] = "AD"; -static const char __pyx_k_DX[] = "DX"; -static const char __pyx_k_LN[] = "LN"; -static const char __pyx_k_MA[] = "MA"; -static const char __pyx_k_T3[] = "T3"; -static const char __pyx_k_ADD[] = "ADD"; -static const char __pyx_k_ADX[] = "ADX"; -static const char __pyx_k_APO[] = "APO"; -static const char __pyx_k_ATR[] = "ATR"; -static const char __pyx_k_BOP[] = "BOP"; -static const char __pyx_k_CCI[] = "CCI"; -static const char __pyx_k_CMO[] = "CMO"; -static const char __pyx_k_COS[] = "COS"; -static const char __pyx_k_DIV[] = "DIV"; -static const char __pyx_k_EMA[] = "EMA"; -static const char __pyx_k_EXP[] = "EXP"; -static const char __pyx_k_MAX[] = "MAX"; -static const char __pyx_k_MFI[] = "MFI"; -static const char __pyx_k_MIN[] = "MIN"; -static const char __pyx_k_MOM[] = "MOM"; -static const char __pyx_k_OBV[] = "OBV"; -static const char __pyx_k_PPO[] = "PPO"; -static const char __pyx_k_ROC[] = "ROC"; -static const char __pyx_k_RSI[] = "RSI"; -static const char __pyx_k_SAR[] = "SAR"; -static const char __pyx_k_SIN[] = "SIN"; -static const char __pyx_k_SMA[] = "SMA"; -static const char __pyx_k_SUB[] = "SUB"; -static const char __pyx_k_SUM[] = "SUM"; -static const char __pyx_k_TAN[] = "TAN"; -static const char __pyx_k_TSF[] = "TSF"; -static const char __pyx_k_VAR[] = "VAR"; -static const char __pyx_k_WMA[] = "WMA"; -static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_low[] = "low"; -static const char __pyx_k_nan[] = "nan"; -static const char __pyx_k_val[] = "val"; -static const char __pyx_k_ACOS[] = "ACOS"; -static const char __pyx_k_ADXR[] = "ADXR"; -static const char __pyx_k_ASIN[] = "ASIN"; -static const char __pyx_k_ATAN[] = "ATAN"; -static const char __pyx_k_BETA[] = "BETA"; -static const char __pyx_k_CEIL[] = "CEIL"; -static const char __pyx_k_COSH[] = "COSH"; -static const char __pyx_k_DEMA[] = "DEMA"; -static const char __pyx_k_KAMA[] = "KAMA"; -static const char __pyx_k_MACD[] = "MACD"; -static const char __pyx_k_MAMA[] = "MAMA"; -static const char __pyx_k_MAVP[] = "MAVP"; -static const char __pyx_k_MULT[] = "MULT"; -static const char __pyx_k_NATR[] = "NATR"; -static const char __pyx_k_ROCP[] = "ROCP"; -static const char __pyx_k_ROCR[] = "ROCR"; -static const char __pyx_k_SINH[] = "SINH"; -static const char __pyx_k_SQRT[] = "SQRT"; -static const char __pyx_k_TANH[] = "TANH"; -static const char __pyx_k_TEMA[] = "TEMA"; -static const char __pyx_k_TRIX[] = "TRIX"; -static const char __pyx_k_high[] = "high"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_open[] = "open"; -static const char __pyx_k_real[] = "real"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_ADOSC[] = "ADOSC"; -static const char __pyx_k_AROON[] = "AROON"; -static const char __pyx_k_FLOOR[] = "FLOOR"; -static const char __pyx_k_LOG10[] = "LOG10"; -static const char __pyx_k_STOCH[] = "STOCH"; -static const char __pyx_k_TA_AD[] = "TA_AD"; -static const char __pyx_k_TA_DX[] = "TA_DX"; -static const char __pyx_k_TA_LN[] = "TA_LN"; -static const char __pyx_k_TA_MA[] = "TA_MA"; -static const char __pyx_k_TA_T3[] = "TA_T3"; -static const char __pyx_k_TRIMA[] = "TRIMA"; -static const char __pyx_k_WILLR[] = "WILLR"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_nbdev[] = "nbdev"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_real0[] = "real0"; -static const char __pyx_k_real1[] = "real1"; -static const char __pyx_k_BBANDS[] = "BBANDS"; -static const char __pyx_k_CORREL[] = "CORREL"; -static const char __pyx_k_MINMAX[] = "MINMAX"; -static const char __pyx_k_SAREXT[] = "SAREXT"; -static const char __pyx_k_STDDEV[] = "STDDEV"; -static const char __pyx_k_STOCHF[] = "STOCHF"; -static const char __pyx_k_TA_ADD[] = "TA_ADD"; -static const char __pyx_k_TA_ADX[] = "TA_ADX"; -static const char __pyx_k_TA_APO[] = "TA_APO"; -static const char __pyx_k_TA_ATR[] = "TA_ATR"; -static const char __pyx_k_TA_BOP[] = "TA_BOP"; -static const char __pyx_k_TA_CCI[] = "TA_CCI"; -static const char __pyx_k_TA_CMO[] = "TA_CMO"; -static const char __pyx_k_TA_COS[] = "TA_COS"; -static const char __pyx_k_TA_DIV[] = "TA_DIV"; -static const char __pyx_k_TA_EMA[] = "TA_EMA"; -static const char __pyx_k_TA_EXP[] = "TA_EXP"; -static const char __pyx_k_TA_MAX[] = "TA_MAX"; -static const char __pyx_k_TA_MFI[] = "TA_MFI"; -static const char __pyx_k_TA_MIN[] = "TA_MIN"; -static const char __pyx_k_TA_MOM[] = "TA_MOM"; -static const char __pyx_k_TA_OBV[] = "TA_OBV"; -static const char __pyx_k_TA_PPO[] = "TA_PPO"; -static const char __pyx_k_TA_ROC[] = "TA_ROC"; -static const char __pyx_k_TA_RSI[] = "TA_RSI"; -static const char __pyx_k_TA_SAR[] = "TA_SAR"; -static const char __pyx_k_TA_SIN[] = "TA_SIN"; -static const char __pyx_k_TA_SMA[] = "TA_SMA"; -static const char __pyx_k_TA_SUB[] = "TA_SUB"; -static const char __pyx_k_TA_SUM[] = "TA_SUM"; -static const char __pyx_k_TA_TAN[] = "TA_TAN"; -static const char __pyx_k_TA_TSF[] = "TA_TSF"; -static const char __pyx_k_TA_VAR[] = "TA_VAR"; -static const char __pyx_k_TA_WMA[] = "TA_WMA"; -static const char __pyx_k_TRANGE[] = "TRANGE"; -static const char __pyx_k_ULTOSC[] = "ULTOSC"; -static const char __pyx_k_begidx[] = "begidx"; -static const char __pyx_k_endidx[] = "endidx"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_length[] = "length"; -static const char __pyx_k_matype[] = "matype"; -static const char __pyx_k_outmax[] = "outmax"; -static const char __pyx_k_outmin[] = "outmin"; -static const char __pyx_k_volume[] = "volume"; -static const char __pyx_k_CDLDOJI[] = "CDLDOJI"; -static const char __pyx_k_HT_SINE[] = "HT_SINE"; -static const char __pyx_k_MACDEXT[] = "MACDEXT"; -static const char __pyx_k_MACDFIX[] = "MACDFIX"; -static const char __pyx_k_PLUS_DI[] = "PLUS_DI"; -static const char __pyx_k_PLUS_DM[] = "PLUS_DM"; -static const char __pyx_k_ROCR100[] = "ROCR100"; -static const char __pyx_k_TA_ACOS[] = "TA_ACOS"; -static const char __pyx_k_TA_ADXR[] = "TA_ADXR"; -static const char __pyx_k_TA_ASIN[] = "TA_ASIN"; -static const char __pyx_k_TA_ATAN[] = "TA_ATAN"; -static const char __pyx_k_TA_BETA[] = "TA_BETA"; -static const char __pyx_k_TA_CEIL[] = "TA_CEIL"; -static const char __pyx_k_TA_COSH[] = "TA_COSH"; -static const char __pyx_k_TA_DEMA[] = "TA_DEMA"; -static const char __pyx_k_TA_KAMA[] = "TA_KAMA"; -static const char __pyx_k_TA_MACD[] = "TA_MACD"; -static const char __pyx_k_TA_MAMA[] = "TA_MAMA"; -static const char __pyx_k_TA_MAVP[] = "TA_MAVP"; -static const char __pyx_k_TA_MULT[] = "TA_MULT"; -static const char __pyx_k_TA_NATR[] = "TA_NATR"; -static const char __pyx_k_TA_ROCP[] = "TA_ROCP"; -static const char __pyx_k_TA_ROCR[] = "TA_ROCR"; -static const char __pyx_k_TA_SINH[] = "TA_SINH"; -static const char __pyx_k_TA_SQRT[] = "TA_SQRT"; -static const char __pyx_k_TA_TANH[] = "TA_TANH"; -static const char __pyx_k_TA_TEMA[] = "TA_TEMA"; -static const char __pyx_k_TA_TRIX[] = "TA_TRIX"; -static const char __pyx_k_maximum[] = "maximum"; -static const char __pyx_k_nbdevdn[] = "nbdevdn"; -static const char __pyx_k_nbdevup[] = "nbdevup"; -static const char __pyx_k_outfama[] = "outfama"; -static const char __pyx_k_outmacd[] = "outmacd"; -static const char __pyx_k_outmama[] = "outmama"; -static const char __pyx_k_outreal[] = "outreal"; -static const char __pyx_k_outsine[] = "outsine"; -static const char __pyx_k_periods[] = "periods"; -static const char __pyx_k_retCode[] = "retCode"; -static const char __pyx_k_vfactor[] = "vfactor"; -static const char __pyx_k_AROONOSC[] = "AROONOSC"; -static const char __pyx_k_AVGPRICE[] = "AVGPRICE"; -static const char __pyx_k_MAXINDEX[] = "MAXINDEX"; -static const char __pyx_k_MEDPRICE[] = "MEDPRICE"; -static const char __pyx_k_MIDPOINT[] = "MIDPOINT"; -static const char __pyx_k_MIDPRICE[] = "MIDPRICE"; -static const char __pyx_k_MININDEX[] = "MININDEX"; -static const char __pyx_k_MINUS_DI[] = "MINUS_DI"; -static const char __pyx_k_MINUS_DM[] = "MINUS_DM"; -static const char __pyx_k_STOCHRSI[] = "STOCHRSI"; -static const char __pyx_k_TA_ADOSC[] = "TA_ADOSC"; -static const char __pyx_k_TA_AROON[] = "TA_AROON"; -static const char __pyx_k_TA_FLOOR[] = "TA_FLOOR"; -static const char __pyx_k_TA_LOG10[] = "TA_LOG10"; -static const char __pyx_k_TA_STOCH[] = "TA_STOCH"; -static const char __pyx_k_TA_TRIMA[] = "TA_TRIMA"; -static const char __pyx_k_TA_WILLR[] = "TA_WILLR"; -static const char __pyx_k_TYPPRICE[] = "TYPPRICE"; -static const char __pyx_k_WCLPRICE[] = "WCLPRICE"; -static const char __pyx_k_lookback[] = "lookback"; -static const char __pyx_k_low_data[] = "low_data"; -static const char __pyx_k_outfastd[] = "outfastd"; -static const char __pyx_k_outfastk[] = "outfastk"; -static const char __pyx_k_outslowd[] = "outslowd"; -static const char __pyx_k_outslowk[] = "outslowk"; -static const char __pyx_k_CDL2CROWS[] = "CDL2CROWS"; -static const char __pyx_k_CDLHAMMER[] = "CDLHAMMER"; -static const char __pyx_k_CDLHARAMI[] = "CDLHARAMI"; -static const char __pyx_k_CDLINNECK[] = "CDLINNECK"; -static const char __pyx_k_CDLONNECK[] = "CDLONNECK"; -static const char __pyx_k_CDLTAKURI[] = "CDLTAKURI"; -static const char __pyx_k_Exception[] = "Exception"; -static const char __pyx_k_HT_PHASOR[] = "HT_PHASOR"; -static const char __pyx_k_LINEARREG[] = "LINEARREG"; -static const char __pyx_k_TA_BBANDS[] = "TA_BBANDS"; -static const char __pyx_k_TA_CORREL[] = "TA_CORREL"; -static const char __pyx_k_TA_MINMAX[] = "TA_MINMAX"; -static const char __pyx_k_TA_SAREXT[] = "TA_SAREXT"; -static const char __pyx_k_TA_STDDEV[] = "TA_STDDEV"; -static const char __pyx_k_TA_STOCHF[] = "TA_STOCHF"; -static const char __pyx_k_TA_TRANGE[] = "TA_TRANGE"; -static const char __pyx_k_TA_ULTOSC[] = "TA_ULTOSC"; -static const char __pyx_k_fastlimit[] = "fastlimit"; -static const char __pyx_k_high_data[] = "high_data"; -static const char __pyx_k_maxperiod[] = "maxperiod"; -static const char __pyx_k_minperiod[] = "minperiod"; -static const char __pyx_k_open_data[] = "open_data"; -static const char __pyx_k_outbegidx[] = "outbegidx"; -static const char __pyx_k_outmaxidx[] = "outmaxidx"; -static const char __pyx_k_outminidx[] = "outminidx"; -static const char __pyx_k_real_data[] = "real_data"; -static const char __pyx_k_slowlimit[] = "slowlimit"; -static const char __pyx_k_CDL3INSIDE[] = "CDL3INSIDE"; -static const char __pyx_k_CDLHIKKAKE[] = "CDLHIKKAKE"; -static const char __pyx_k_CDLKICKING[] = "CDLKICKING"; -static const char __pyx_k_CDLMATHOLD[] = "CDLMATHOLD"; -static const char __pyx_k_CDLTRISTAR[] = "CDLTRISTAR"; -static const char __pyx_k_HT_DCPHASE[] = "HT_DCPHASE"; -static const char __pyx_k_TA_CDLDOJI[] = "TA_CDLDOJI"; -static const char __pyx_k_TA_HT_SINE[] = "TA_HT_SINE"; -static const char __pyx_k_TA_MACDEXT[] = "TA_MACDEXT"; -static const char __pyx_k_TA_MACDFIX[] = "TA_MACDFIX"; -static const char __pyx_k_TA_PLUS_DI[] = "TA_PLUS_DI"; -static const char __pyx_k_TA_PLUS_DM[] = "TA_PLUS_DM"; -static const char __pyx_k_TA_ROCR100[] = "TA_ROCR100"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_close_data[] = "close_data"; -static const char __pyx_k_fastmatype[] = "fastmatype"; -static const char __pyx_k_fastperiod[] = "fastperiod"; -static const char __pyx_k_outaroonup[] = "outaroonup"; -static const char __pyx_k_outinphase[] = "outinphase"; -static const char __pyx_k_outinteger[] = "outinteger"; -static const char __pyx_k_real0_data[] = "real0_data"; -static const char __pyx_k_real1_data[] = "real1_data"; -static const char __pyx_k_slowmatype[] = "slowmatype"; -static const char __pyx_k_slowperiod[] = "slowperiod"; -static const char __pyx_k_startvalue[] = "startvalue"; -static const char __pyx_k_timeperiod[] = "timeperiod"; -static const char __pyx_k_CDL3OUTSIDE[] = "CDL3OUTSIDE"; -static const char __pyx_k_CDLBELTHOLD[] = "CDLBELTHOLD"; -static const char __pyx_k_CDLDOJISTAR[] = "CDLDOJISTAR"; -static const char __pyx_k_CDLHIGHWAVE[] = "CDLHIGHWAVE"; -static const char __pyx_k_CDLLONGLINE[] = "CDLLONGLINE"; -static const char __pyx_k_CDLMARUBOZU[] = "CDLMARUBOZU"; -static const char __pyx_k_CDLPIERCING[] = "CDLPIERCING"; -static const char __pyx_k_HT_DCPERIOD[] = "HT_DCPERIOD"; -static const char __pyx_k_MINMAXINDEX[] = "MINMAXINDEX"; -static const char __pyx_k_TA_AROONOSC[] = "TA_AROONOSC"; -static const char __pyx_k_TA_AVGPRICE[] = "TA_AVGPRICE"; -static const char __pyx_k_TA_MAXINDEX[] = "TA_MAXINDEX"; -static const char __pyx_k_TA_MEDPRICE[] = "TA_MEDPRICE"; -static const char __pyx_k_TA_MIDPOINT[] = "TA_MIDPOINT"; -static const char __pyx_k_TA_MIDPRICE[] = "TA_MIDPRICE"; -static const char __pyx_k_TA_MININDEX[] = "TA_MININDEX"; -static const char __pyx_k_TA_MINUS_DI[] = "TA_MINUS_DI"; -static const char __pyx_k_TA_MINUS_DM[] = "TA_MINUS_DM"; -static const char __pyx_k_TA_STOCHRSI[] = "TA_STOCHRSI"; -static const char __pyx_k_TA_TYPPRICE[] = "TA_TYPPRICE"; -static const char __pyx_k_TA_WCLPRICE[] = "TA_WCLPRICE"; -static const char __pyx_k_outleadsine[] = "outleadsine"; -static const char __pyx_k_outmacdhist[] = "outmacdhist"; -static const char __pyx_k_penetration[] = "penetration"; -static const char __pyx_k_timeperiod1[] = "timeperiod1"; -static const char __pyx_k_timeperiod2[] = "timeperiod2"; -static const char __pyx_k_timeperiod3[] = "timeperiod3"; -static const char __pyx_k_volume_data[] = "volume_data"; -static const char __pyx_k_CDLBREAKAWAY[] = "CDLBREAKAWAY"; -static const char __pyx_k_CDLENGULFING[] = "CDLENGULFING"; -static const char __pyx_k_CDLSHORTLINE[] = "CDLSHORTLINE"; -static const char __pyx_k_CDLTASUKIGAP[] = "CDLTASUKIGAP"; -static const char __pyx_k_CDLTHRUSTING[] = "CDLTHRUSTING"; -static const char __pyx_k_HT_TRENDLINE[] = "HT_TRENDLINE"; -static const char __pyx_k_HT_TRENDMODE[] = "HT_TRENDMODE"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_TA_CDL2CROWS[] = "TA_CDL2CROWS"; -static const char __pyx_k_TA_CDLHAMMER[] = "TA_CDLHAMMER"; -static const char __pyx_k_TA_CDLHARAMI[] = "TA_CDLHARAMI"; -static const char __pyx_k_TA_CDLINNECK[] = "TA_CDLINNECK"; -static const char __pyx_k_TA_CDLONNECK[] = "TA_CDLONNECK"; -static const char __pyx_k_TA_CDLTAKURI[] = "TA_CDLTAKURI"; -static const char __pyx_k_TA_HT_PHASOR[] = "TA_HT_PHASOR"; -static const char __pyx_k_TA_LINEARREG[] = "TA_LINEARREG"; -static const char __pyx_k_acceleration[] = "acceleration"; -static const char __pyx_k_fastd_matype[] = "fastd_matype"; -static const char __pyx_k_fastd_period[] = "fastd_period"; -static const char __pyx_k_fastk_period[] = "fastk_period"; -static const char __pyx_k_outaroondown[] = "outaroondown"; -static const char __pyx_k_outnbelement[] = "outnbelement"; -static const char __pyx_k_periods_data[] = "periods_data"; -static const char __pyx_k_signalmatype[] = "signalmatype"; -static const char __pyx_k_signalperiod[] = "signalperiod"; -static const char __pyx_k_slowd_matype[] = "slowd_matype"; -static const char __pyx_k_slowd_period[] = "slowd_period"; -static const char __pyx_k_slowk_matype[] = "slowk_matype"; -static const char __pyx_k_slowk_period[] = "slowk_period"; -static const char __pyx_k_talib_stream[] = "talib.stream"; -static const char __pyx_k_CDLHANGINGMAN[] = "CDLHANGINGMAN"; -static const char __pyx_k_CDLHIKKAKEMOD[] = "CDLHIKKAKEMOD"; -static const char __pyx_k_TA_CDL3INSIDE[] = "TA_CDL3INSIDE"; -static const char __pyx_k_TA_CDLHIKKAKE[] = "TA_CDLHIKKAKE"; -static const char __pyx_k_TA_CDLKICKING[] = "TA_CDLKICKING"; -static const char __pyx_k_TA_CDLMATHOLD[] = "TA_CDLMATHOLD"; -static const char __pyx_k_TA_CDLTRISTAR[] = "TA_CDLTRISTAR"; -static const char __pyx_k_TA_HT_DCPHASE[] = "TA_HT_DCPHASE"; -static const char __pyx_k_outmacdsignal[] = "outmacdsignal"; -static const char __pyx_k_outquadrature[] = "outquadrature"; -static const char __pyx_k_CDL3BLACKCROWS[] = "CDL3BLACKCROWS"; -static const char __pyx_k_CDL3LINESTRIKE[] = "CDL3LINESTRIKE"; -static const char __pyx_k_CDLEVENINGSTAR[] = "CDLEVENINGSTAR"; -static const char __pyx_k_CDLHARAMICROSS[] = "CDLHARAMICROSS"; -static const char __pyx_k_CDLMATCHINGLOW[] = "CDLMATCHINGLOW"; -static const char __pyx_k_CDLMORNINGSTAR[] = "CDLMORNINGSTAR"; -static const char __pyx_k_CDLRICKSHAWMAN[] = "CDLRICKSHAWMAN"; -static const char __pyx_k_CDLSPINNINGTOP[] = "CDLSPINNINGTOP"; -static const char __pyx_k_TA_CDL3OUTSIDE[] = "TA_CDL3OUTSIDE"; -static const char __pyx_k_TA_CDLBELTHOLD[] = "TA_CDLBELTHOLD"; -static const char __pyx_k_TA_CDLDOJISTAR[] = "TA_CDLDOJISTAR"; -static const char __pyx_k_TA_CDLHIGHWAVE[] = "TA_CDLHIGHWAVE"; -static const char __pyx_k_TA_CDLLONGLINE[] = "TA_CDLLONGLINE"; -static const char __pyx_k_TA_CDLMARUBOZU[] = "TA_CDLMARUBOZU"; -static const char __pyx_k_TA_CDLPIERCING[] = "TA_CDLPIERCING"; -static const char __pyx_k_TA_HT_DCPERIOD[] = "TA_HT_DCPERIOD"; -static const char __pyx_k_TA_MINMAXINDEX[] = "TA_MINMAXINDEX"; -static const char __pyx_k_CDLADVANCEBLOCK[] = "CDLADVANCEBLOCK"; -static const char __pyx_k_CDLHOMINGPIGEON[] = "CDLHOMINGPIGEON"; -static const char __pyx_k_CDLLADDERBOTTOM[] = "CDLLADDERBOTTOM"; -static const char __pyx_k_CDLSHOOTINGSTAR[] = "CDLSHOOTINGSTAR"; -static const char __pyx_k_CDLUNIQUE3RIVER[] = "CDLUNIQUE3RIVER"; -static const char __pyx_k_LINEARREG_ANGLE[] = "LINEARREG_ANGLE"; -static const char __pyx_k_LINEARREG_SLOPE[] = "LINEARREG_SLOPE"; -static const char __pyx_k_TA_CDLBREAKAWAY[] = "TA_CDLBREAKAWAY"; -static const char __pyx_k_TA_CDLENGULFING[] = "TA_CDLENGULFING"; -static const char __pyx_k_TA_CDLSHORTLINE[] = "TA_CDLSHORTLINE"; -static const char __pyx_k_TA_CDLTASUKIGAP[] = "TA_CDLTASUKIGAP"; -static const char __pyx_k_TA_CDLTHRUSTING[] = "TA_CDLTHRUSTING"; -static const char __pyx_k_TA_HT_TRENDLINE[] = "TA_HT_TRENDLINE"; -static const char __pyx_k_TA_HT_TRENDMODE[] = "TA_HT_TRENDMODE"; -static const char __pyx_k_offsetonreverse[] = "offsetonreverse"; -static const char __pyx_k_CDL3STARSINSOUTH[] = "CDL3STARSINSOUTH"; -static const char __pyx_k_CDLABANDONEDBABY[] = "CDLABANDONEDBABY"; -static const char __pyx_k_CDLCOUNTERATTACK[] = "CDLCOUNTERATTACK"; -static const char __pyx_k_CDLDRAGONFLYDOJI[] = "CDLDRAGONFLYDOJI"; -static const char __pyx_k_CDLSTICKSANDWICH[] = "CDLSTICKSANDWICH"; -static const char __pyx_k_TA_CDLHANGINGMAN[] = "TA_CDLHANGINGMAN"; -static const char __pyx_k_TA_CDLHIKKAKEMOD[] = "TA_CDLHIKKAKEMOD"; -static const char __pyx_k_accelerationlong[] = "accelerationlong"; -static const char __pyx_k_outreallowerband[] = "outreallowerband"; -static const char __pyx_k_outrealupperband[] = "outrealupperband"; -static const char __pyx_k_CDL3WHITESOLDIERS[] = "CDL3WHITESOLDIERS"; -static const char __pyx_k_CDLDARKCLOUDCOVER[] = "CDLDARKCLOUDCOVER"; -static const char __pyx_k_CDLGRAVESTONEDOJI[] = "CDLGRAVESTONEDOJI"; -static const char __pyx_k_CDLINVERTEDHAMMER[] = "CDLINVERTEDHAMMER"; -static const char __pyx_k_CDLLONGLEGGEDDOJI[] = "CDLLONGLEGGEDDOJI"; -static const char __pyx_k_CDLSTALLEDPATTERN[] = "CDLSTALLEDPATTERN"; -static const char __pyx_k_TA_CDL3BLACKCROWS[] = "TA_CDL3BLACKCROWS"; -static const char __pyx_k_TA_CDL3LINESTRIKE[] = "TA_CDL3LINESTRIKE"; -static const char __pyx_k_TA_CDLEVENINGSTAR[] = "TA_CDLEVENINGSTAR"; -static const char __pyx_k_TA_CDLHARAMICROSS[] = "TA_CDLHARAMICROSS"; -static const char __pyx_k_TA_CDLMATCHINGLOW[] = "TA_CDLMATCHINGLOW"; -static const char __pyx_k_TA_CDLMORNINGSTAR[] = "TA_CDLMORNINGSTAR"; -static const char __pyx_k_TA_CDLRICKSHAWMAN[] = "TA_CDLRICKSHAWMAN"; -static const char __pyx_k_TA_CDLSPINNINGTOP[] = "TA_CDLSPINNINGTOP"; -static const char __pyx_k_accelerationshort[] = "accelerationshort"; -static const char __pyx_k_low_is_not_double[] = "low is not double"; -static const char __pyx_k_outrealmiddleband[] = "outrealmiddleband"; -static const char __pyx_k_CDLCLOSINGMARUBOZU[] = "CDLCLOSINGMARUBOZU"; -static const char __pyx_k_CDLEVENINGDOJISTAR[] = "CDLEVENINGDOJISTAR"; -static const char __pyx_k_CDLIDENTICAL3CROWS[] = "CDLIDENTICAL3CROWS"; -static const char __pyx_k_CDLKICKINGBYLENGTH[] = "CDLKICKINGBYLENGTH"; -static const char __pyx_k_CDLMORNINGDOJISTAR[] = "CDLMORNINGDOJISTAR"; -static const char __pyx_k_CDLSEPARATINGLINES[] = "CDLSEPARATINGLINES"; -static const char __pyx_k_CDLUPSIDEGAP2CROWS[] = "CDLUPSIDEGAP2CROWS"; -static const char __pyx_k_TA_CDLADVANCEBLOCK[] = "TA_CDLADVANCEBLOCK"; -static const char __pyx_k_TA_CDLHOMINGPIGEON[] = "TA_CDLHOMINGPIGEON"; -static const char __pyx_k_TA_CDLLADDERBOTTOM[] = "TA_CDLLADDERBOTTOM"; -static const char __pyx_k_TA_CDLSHOOTINGSTAR[] = "TA_CDLSHOOTINGSTAR"; -static const char __pyx_k_TA_CDLUNIQUE3RIVER[] = "TA_CDLUNIQUE3RIVER"; -static const char __pyx_k_TA_LINEARREG_ANGLE[] = "TA_LINEARREG_ANGLE"; -static const char __pyx_k_TA_LINEARREG_SLOPE[] = "TA_LINEARREG_SLOPE"; -static const char __pyx_k_high_is_not_double[] = "high is not double"; -static const char __pyx_k_open_is_not_double[] = "open is not double"; -static const char __pyx_k_real_is_not_double[] = "real is not double"; -static const char __pyx_k_CDLCONCEALBABYSWALL[] = "CDLCONCEALBABYSWALL"; -static const char __pyx_k_CDLGAPSIDESIDEWHITE[] = "CDLGAPSIDESIDEWHITE"; -static const char __pyx_k_CDLRISEFALL3METHODS[] = "CDLRISEFALL3METHODS"; -static const char __pyx_k_CDLXSIDEGAP3METHODS[] = "CDLXSIDEGAP3METHODS"; -static const char __pyx_k_LINEARREG_INTERCEPT[] = "LINEARREG_INTERCEPT"; -static const char __pyx_k_TA_CDL3STARSINSOUTH[] = "TA_CDL3STARSINSOUTH"; -static const char __pyx_k_TA_CDLABANDONEDBABY[] = "TA_CDLABANDONEDBABY"; -static const char __pyx_k_TA_CDLCOUNTERATTACK[] = "TA_CDLCOUNTERATTACK"; -static const char __pyx_k_TA_CDLDRAGONFLYDOJI[] = "TA_CDLDRAGONFLYDOJI"; -static const char __pyx_k_TA_CDLSTICKSANDWICH[] = "TA_CDLSTICKSANDWICH"; -static const char __pyx_k_accelerationmaxlong[] = "accelerationmaxlong"; -static const char __pyx_k_close_is_not_double[] = "close is not double"; -static const char __pyx_k_real0_is_not_double[] = "real0 is not double"; -static const char __pyx_k_real1_is_not_double[] = "real1 is not double"; -static const char __pyx_k_TA_CDL3WHITESOLDIERS[] = "TA_CDL3WHITESOLDIERS"; -static const char __pyx_k_TA_CDLDARKCLOUDCOVER[] = "TA_CDLDARKCLOUDCOVER"; -static const char __pyx_k_TA_CDLGRAVESTONEDOJI[] = "TA_CDLGRAVESTONEDOJI"; -static const char __pyx_k_TA_CDLINVERTEDHAMMER[] = "TA_CDLINVERTEDHAMMER"; -static const char __pyx_k_TA_CDLLONGLEGGEDDOJI[] = "TA_CDLLONGLEGGEDDOJI"; -static const char __pyx_k_TA_CDLSTALLEDPATTERN[] = "TA_CDLSTALLEDPATTERN"; -static const char __pyx_k_accelerationinitlong[] = "accelerationinitlong"; -static const char __pyx_k_accelerationmaxshort[] = "accelerationmaxshort"; -static const char __pyx_k_volume_is_not_double[] = "volume is not double"; -static const char __pyx_k_TA_CDLCLOSINGMARUBOZU[] = "TA_CDLCLOSINGMARUBOZU"; -static const char __pyx_k_TA_CDLEVENINGDOJISTAR[] = "TA_CDLEVENINGDOJISTAR"; -static const char __pyx_k_TA_CDLIDENTICAL3CROWS[] = "TA_CDLIDENTICAL3CROWS"; -static const char __pyx_k_TA_CDLKICKINGBYLENGTH[] = "TA_CDLKICKINGBYLENGTH"; -static const char __pyx_k_TA_CDLMORNINGDOJISTAR[] = "TA_CDLMORNINGDOJISTAR"; -static const char __pyx_k_TA_CDLSEPARATINGLINES[] = "TA_CDLSEPARATINGLINES"; -static const char __pyx_k_TA_CDLUPSIDEGAP2CROWS[] = "TA_CDLUPSIDEGAP2CROWS"; -static const char __pyx_k_accelerationinitshort[] = "accelerationinitshort"; -static const char __pyx_k_periods_is_not_double[] = "periods is not double"; -static const char __pyx_k_TA_CDLCONCEALBABYSWALL[] = "TA_CDLCONCEALBABYSWALL"; -static const char __pyx_k_TA_CDLGAPSIDESIDEWHITE[] = "TA_CDLGAPSIDESIDEWHITE"; -static const char __pyx_k_TA_CDLRISEFALL3METHODS[] = "TA_CDLRISEFALL3METHODS"; -static const char __pyx_k_TA_CDLXSIDEGAP3METHODS[] = "TA_CDLXSIDEGAP3METHODS"; -static const char __pyx_k_TA_LINEARREG_INTERCEPT[] = "TA_LINEARREG_INTERCEPT"; -static const char __pyx_k_low_has_wrong_dimensions[] = "low has wrong dimensions"; -static const char __pyx_k_high_has_wrong_dimensions[] = "high has wrong dimensions"; -static const char __pyx_k_open_has_wrong_dimensions[] = "open has wrong dimensions"; -static const char __pyx_k_real_has_wrong_dimensions[] = "real has wrong dimensions"; -static const char __pyx_k_close_has_wrong_dimensions[] = "close has wrong dimensions"; -static const char __pyx_k_real0_has_wrong_dimensions[] = "real0 has wrong dimensions"; -static const char __pyx_k_real1_has_wrong_dimensions[] = "real1 has wrong dimensions"; -static const char __pyx_k_input_lengths_are_different[] = "input lengths are different"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_volume_has_wrong_dimensions[] = "volume has wrong dimensions"; -static const char __pyx_k_periods_has_wrong_dimensions[] = "periods has wrong dimensions"; -static const char __pyx_k_Users_jbenedik_Dev_ta_lib_talib[] = "/Users/jbenedik/Dev/ta-lib/talib/stream.pyx"; -static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; -static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_n_s_ACOS; -static PyObject *__pyx_n_s_AD; -static PyObject *__pyx_n_s_ADD; -static PyObject *__pyx_n_s_ADOSC; -static PyObject *__pyx_n_s_ADX; -static PyObject *__pyx_n_s_ADXR; -static PyObject *__pyx_n_s_APO; -static PyObject *__pyx_n_s_AROON; -static PyObject *__pyx_n_s_AROONOSC; -static PyObject *__pyx_n_s_ASIN; -static PyObject *__pyx_n_s_ATAN; -static PyObject *__pyx_n_s_ATR; -static PyObject *__pyx_n_s_AVGPRICE; -static PyObject *__pyx_n_s_BBANDS; -static PyObject *__pyx_n_s_BETA; -static PyObject *__pyx_n_s_BOP; -static PyObject *__pyx_n_s_CCI; -static PyObject *__pyx_n_s_CDL2CROWS; -static PyObject *__pyx_n_s_CDL3BLACKCROWS; -static PyObject *__pyx_n_s_CDL3INSIDE; -static PyObject *__pyx_n_s_CDL3LINESTRIKE; -static PyObject *__pyx_n_s_CDL3OUTSIDE; -static PyObject *__pyx_n_s_CDL3STARSINSOUTH; -static PyObject *__pyx_n_s_CDL3WHITESOLDIERS; -static PyObject *__pyx_n_s_CDLABANDONEDBABY; -static PyObject *__pyx_n_s_CDLADVANCEBLOCK; -static PyObject *__pyx_n_s_CDLBELTHOLD; -static PyObject *__pyx_n_s_CDLBREAKAWAY; -static PyObject *__pyx_n_s_CDLCLOSINGMARUBOZU; -static PyObject *__pyx_n_s_CDLCONCEALBABYSWALL; -static PyObject *__pyx_n_s_CDLCOUNTERATTACK; -static PyObject *__pyx_n_s_CDLDARKCLOUDCOVER; -static PyObject *__pyx_n_s_CDLDOJI; -static PyObject *__pyx_n_s_CDLDOJISTAR; -static PyObject *__pyx_n_s_CDLDRAGONFLYDOJI; -static PyObject *__pyx_n_s_CDLENGULFING; -static PyObject *__pyx_n_s_CDLEVENINGDOJISTAR; -static PyObject *__pyx_n_s_CDLEVENINGSTAR; -static PyObject *__pyx_n_s_CDLGAPSIDESIDEWHITE; -static PyObject *__pyx_n_s_CDLGRAVESTONEDOJI; -static PyObject *__pyx_n_s_CDLHAMMER; -static PyObject *__pyx_n_s_CDLHANGINGMAN; -static PyObject *__pyx_n_s_CDLHARAMI; -static PyObject *__pyx_n_s_CDLHARAMICROSS; -static PyObject *__pyx_n_s_CDLHIGHWAVE; -static PyObject *__pyx_n_s_CDLHIKKAKE; -static PyObject *__pyx_n_s_CDLHIKKAKEMOD; -static PyObject *__pyx_n_s_CDLHOMINGPIGEON; -static PyObject *__pyx_n_s_CDLIDENTICAL3CROWS; -static PyObject *__pyx_n_s_CDLINNECK; -static PyObject *__pyx_n_s_CDLINVERTEDHAMMER; -static PyObject *__pyx_n_s_CDLKICKING; -static PyObject *__pyx_n_s_CDLKICKINGBYLENGTH; -static PyObject *__pyx_n_s_CDLLADDERBOTTOM; -static PyObject *__pyx_n_s_CDLLONGLEGGEDDOJI; -static PyObject *__pyx_n_s_CDLLONGLINE; -static PyObject *__pyx_n_s_CDLMARUBOZU; -static PyObject *__pyx_n_s_CDLMATCHINGLOW; -static PyObject *__pyx_n_s_CDLMATHOLD; -static PyObject *__pyx_n_s_CDLMORNINGDOJISTAR; -static PyObject *__pyx_n_s_CDLMORNINGSTAR; -static PyObject *__pyx_n_s_CDLONNECK; -static PyObject *__pyx_n_s_CDLPIERCING; -static PyObject *__pyx_n_s_CDLRICKSHAWMAN; -static PyObject *__pyx_n_s_CDLRISEFALL3METHODS; -static PyObject *__pyx_n_s_CDLSEPARATINGLINES; -static PyObject *__pyx_n_s_CDLSHOOTINGSTAR; -static PyObject *__pyx_n_s_CDLSHORTLINE; -static PyObject *__pyx_n_s_CDLSPINNINGTOP; -static PyObject *__pyx_n_s_CDLSTALLEDPATTERN; -static PyObject *__pyx_n_s_CDLSTICKSANDWICH; -static PyObject *__pyx_n_s_CDLTAKURI; -static PyObject *__pyx_n_s_CDLTASUKIGAP; -static PyObject *__pyx_n_s_CDLTHRUSTING; -static PyObject *__pyx_n_s_CDLTRISTAR; -static PyObject *__pyx_n_s_CDLUNIQUE3RIVER; -static PyObject *__pyx_n_s_CDLUPSIDEGAP2CROWS; -static PyObject *__pyx_n_s_CDLXSIDEGAP3METHODS; -static PyObject *__pyx_n_s_CEIL; -static PyObject *__pyx_n_s_CMO; -static PyObject *__pyx_n_s_CORREL; -static PyObject *__pyx_n_s_COS; -static PyObject *__pyx_n_s_COSH; -static PyObject *__pyx_n_s_DEMA; -static PyObject *__pyx_n_s_DIV; -static PyObject *__pyx_n_s_DX; -static PyObject *__pyx_n_s_EMA; -static PyObject *__pyx_n_s_EXP; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_n_s_FLOOR; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_n_s_HT_DCPERIOD; -static PyObject *__pyx_n_s_HT_DCPHASE; -static PyObject *__pyx_n_s_HT_PHASOR; -static PyObject *__pyx_n_s_HT_SINE; -static PyObject *__pyx_n_s_HT_TRENDLINE; -static PyObject *__pyx_n_s_HT_TRENDMODE; -static PyObject *__pyx_n_s_KAMA; -static PyObject *__pyx_n_s_LINEARREG; -static PyObject *__pyx_n_s_LINEARREG_ANGLE; -static PyObject *__pyx_n_s_LINEARREG_INTERCEPT; -static PyObject *__pyx_n_s_LINEARREG_SLOPE; -static PyObject *__pyx_n_s_LN; -static PyObject *__pyx_n_s_LOG10; -static PyObject *__pyx_n_s_MA; -static PyObject *__pyx_n_s_MACD; -static PyObject *__pyx_n_s_MACDEXT; -static PyObject *__pyx_n_s_MACDFIX; -static PyObject *__pyx_n_s_MAMA; -static PyObject *__pyx_n_s_MAVP; -static PyObject *__pyx_n_s_MAX; -static PyObject *__pyx_n_s_MAXINDEX; -static PyObject *__pyx_n_s_MEDPRICE; -static PyObject *__pyx_n_s_MFI; -static PyObject *__pyx_n_s_MIDPOINT; -static PyObject *__pyx_n_s_MIDPRICE; -static PyObject *__pyx_n_s_MIN; -static PyObject *__pyx_n_s_MININDEX; -static PyObject *__pyx_n_s_MINMAX; -static PyObject *__pyx_n_s_MINMAXINDEX; -static PyObject *__pyx_n_s_MINUS_DI; -static PyObject *__pyx_n_s_MINUS_DM; -static PyObject *__pyx_n_s_MOM; -static PyObject *__pyx_n_s_MULT; -static PyObject *__pyx_n_s_NATR; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_OBV; -static PyObject *__pyx_n_s_PLUS_DI; -static PyObject *__pyx_n_s_PLUS_DM; -static PyObject *__pyx_n_s_PPO; -static PyObject *__pyx_n_s_ROC; -static PyObject *__pyx_n_s_ROCP; -static PyObject *__pyx_n_s_ROCR; -static PyObject *__pyx_n_s_ROCR100; -static PyObject *__pyx_n_s_RSI; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_SAR; -static PyObject *__pyx_n_s_SAREXT; -static PyObject *__pyx_n_s_SIN; -static PyObject *__pyx_n_s_SINH; -static PyObject *__pyx_n_s_SMA; -static PyObject *__pyx_n_s_SQRT; -static PyObject *__pyx_n_s_STDDEV; -static PyObject *__pyx_n_s_STOCH; -static PyObject *__pyx_n_s_STOCHF; -static PyObject *__pyx_n_s_STOCHRSI; -static PyObject *__pyx_n_s_SUB; -static PyObject *__pyx_n_s_SUM; -static PyObject *__pyx_n_s_T3; -static PyObject *__pyx_n_s_TAN; -static PyObject *__pyx_n_s_TANH; -static PyObject *__pyx_n_s_TA_ACOS; -static PyObject *__pyx_n_s_TA_AD; -static PyObject *__pyx_n_s_TA_ADD; -static PyObject *__pyx_n_s_TA_ADOSC; -static PyObject *__pyx_n_s_TA_ADX; -static PyObject *__pyx_n_s_TA_ADXR; -static PyObject *__pyx_n_s_TA_APO; -static PyObject *__pyx_n_s_TA_AROON; -static PyObject *__pyx_n_s_TA_AROONOSC; -static PyObject *__pyx_n_s_TA_ASIN; -static PyObject *__pyx_n_s_TA_ATAN; -static PyObject *__pyx_n_s_TA_ATR; -static PyObject *__pyx_n_s_TA_AVGPRICE; -static PyObject *__pyx_n_s_TA_BBANDS; -static PyObject *__pyx_n_s_TA_BETA; -static PyObject *__pyx_n_s_TA_BOP; -static PyObject *__pyx_n_s_TA_CCI; -static PyObject *__pyx_n_s_TA_CDL2CROWS; -static PyObject *__pyx_n_s_TA_CDL3BLACKCROWS; -static PyObject *__pyx_n_s_TA_CDL3INSIDE; -static PyObject *__pyx_n_s_TA_CDL3LINESTRIKE; -static PyObject *__pyx_n_s_TA_CDL3OUTSIDE; -static PyObject *__pyx_n_s_TA_CDL3STARSINSOUTH; -static PyObject *__pyx_n_s_TA_CDL3WHITESOLDIERS; -static PyObject *__pyx_n_s_TA_CDLABANDONEDBABY; -static PyObject *__pyx_n_s_TA_CDLADVANCEBLOCK; -static PyObject *__pyx_n_s_TA_CDLBELTHOLD; -static PyObject *__pyx_n_s_TA_CDLBREAKAWAY; -static PyObject *__pyx_n_s_TA_CDLCLOSINGMARUBOZU; -static PyObject *__pyx_n_s_TA_CDLCONCEALBABYSWALL; -static PyObject *__pyx_n_s_TA_CDLCOUNTERATTACK; -static PyObject *__pyx_n_s_TA_CDLDARKCLOUDCOVER; -static PyObject *__pyx_n_s_TA_CDLDOJI; -static PyObject *__pyx_n_s_TA_CDLDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLDRAGONFLYDOJI; -static PyObject *__pyx_n_s_TA_CDLENGULFING; -static PyObject *__pyx_n_s_TA_CDLEVENINGDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLEVENINGSTAR; -static PyObject *__pyx_n_s_TA_CDLGAPSIDESIDEWHITE; -static PyObject *__pyx_n_s_TA_CDLGRAVESTONEDOJI; -static PyObject *__pyx_n_s_TA_CDLHAMMER; -static PyObject *__pyx_n_s_TA_CDLHANGINGMAN; -static PyObject *__pyx_n_s_TA_CDLHARAMI; -static PyObject *__pyx_n_s_TA_CDLHARAMICROSS; -static PyObject *__pyx_n_s_TA_CDLHIGHWAVE; -static PyObject *__pyx_n_s_TA_CDLHIKKAKE; -static PyObject *__pyx_n_s_TA_CDLHIKKAKEMOD; -static PyObject *__pyx_n_s_TA_CDLHOMINGPIGEON; -static PyObject *__pyx_n_s_TA_CDLIDENTICAL3CROWS; -static PyObject *__pyx_n_s_TA_CDLINNECK; -static PyObject *__pyx_n_s_TA_CDLINVERTEDHAMMER; -static PyObject *__pyx_n_s_TA_CDLKICKING; -static PyObject *__pyx_n_s_TA_CDLKICKINGBYLENGTH; -static PyObject *__pyx_n_s_TA_CDLLADDERBOTTOM; -static PyObject *__pyx_n_s_TA_CDLLONGLEGGEDDOJI; -static PyObject *__pyx_n_s_TA_CDLLONGLINE; -static PyObject *__pyx_n_s_TA_CDLMARUBOZU; -static PyObject *__pyx_n_s_TA_CDLMATCHINGLOW; -static PyObject *__pyx_n_s_TA_CDLMATHOLD; -static PyObject *__pyx_n_s_TA_CDLMORNINGDOJISTAR; -static PyObject *__pyx_n_s_TA_CDLMORNINGSTAR; -static PyObject *__pyx_n_s_TA_CDLONNECK; -static PyObject *__pyx_n_s_TA_CDLPIERCING; -static PyObject *__pyx_n_s_TA_CDLRICKSHAWMAN; -static PyObject *__pyx_n_s_TA_CDLRISEFALL3METHODS; -static PyObject *__pyx_n_s_TA_CDLSEPARATINGLINES; -static PyObject *__pyx_n_s_TA_CDLSHOOTINGSTAR; -static PyObject *__pyx_n_s_TA_CDLSHORTLINE; -static PyObject *__pyx_n_s_TA_CDLSPINNINGTOP; -static PyObject *__pyx_n_s_TA_CDLSTALLEDPATTERN; -static PyObject *__pyx_n_s_TA_CDLSTICKSANDWICH; -static PyObject *__pyx_n_s_TA_CDLTAKURI; -static PyObject *__pyx_n_s_TA_CDLTASUKIGAP; -static PyObject *__pyx_n_s_TA_CDLTHRUSTING; -static PyObject *__pyx_n_s_TA_CDLTRISTAR; -static PyObject *__pyx_n_s_TA_CDLUNIQUE3RIVER; -static PyObject *__pyx_n_s_TA_CDLUPSIDEGAP2CROWS; -static PyObject *__pyx_n_s_TA_CDLXSIDEGAP3METHODS; -static PyObject *__pyx_n_s_TA_CEIL; -static PyObject *__pyx_n_s_TA_CMO; -static PyObject *__pyx_n_s_TA_CORREL; -static PyObject *__pyx_n_s_TA_COS; -static PyObject *__pyx_n_s_TA_COSH; -static PyObject *__pyx_n_s_TA_DEMA; -static PyObject *__pyx_n_s_TA_DIV; -static PyObject *__pyx_n_s_TA_DX; -static PyObject *__pyx_n_s_TA_EMA; -static PyObject *__pyx_n_s_TA_EXP; -static PyObject *__pyx_n_s_TA_FLOOR; -static PyObject *__pyx_n_s_TA_HT_DCPERIOD; -static PyObject *__pyx_n_s_TA_HT_DCPHASE; -static PyObject *__pyx_n_s_TA_HT_PHASOR; -static PyObject *__pyx_n_s_TA_HT_SINE; -static PyObject *__pyx_n_s_TA_HT_TRENDLINE; -static PyObject *__pyx_n_s_TA_HT_TRENDMODE; -static PyObject *__pyx_n_s_TA_KAMA; -static PyObject *__pyx_n_s_TA_LINEARREG; -static PyObject *__pyx_n_s_TA_LINEARREG_ANGLE; -static PyObject *__pyx_n_s_TA_LINEARREG_INTERCEPT; -static PyObject *__pyx_n_s_TA_LINEARREG_SLOPE; -static PyObject *__pyx_n_s_TA_LN; -static PyObject *__pyx_n_s_TA_LOG10; -static PyObject *__pyx_n_s_TA_MA; -static PyObject *__pyx_n_s_TA_MACD; -static PyObject *__pyx_n_s_TA_MACDEXT; -static PyObject *__pyx_n_s_TA_MACDFIX; -static PyObject *__pyx_n_s_TA_MAMA; -static PyObject *__pyx_n_s_TA_MAVP; -static PyObject *__pyx_n_s_TA_MAX; -static PyObject *__pyx_n_s_TA_MAXINDEX; -static PyObject *__pyx_n_s_TA_MEDPRICE; -static PyObject *__pyx_n_s_TA_MFI; -static PyObject *__pyx_n_s_TA_MIDPOINT; -static PyObject *__pyx_n_s_TA_MIDPRICE; -static PyObject *__pyx_n_s_TA_MIN; -static PyObject *__pyx_n_s_TA_MININDEX; -static PyObject *__pyx_n_s_TA_MINMAX; -static PyObject *__pyx_n_s_TA_MINMAXINDEX; -static PyObject *__pyx_n_s_TA_MINUS_DI; -static PyObject *__pyx_n_s_TA_MINUS_DM; -static PyObject *__pyx_n_s_TA_MOM; -static PyObject *__pyx_n_s_TA_MULT; -static PyObject *__pyx_n_s_TA_NATR; -static PyObject *__pyx_n_s_TA_OBV; -static PyObject *__pyx_n_s_TA_PLUS_DI; -static PyObject *__pyx_n_s_TA_PLUS_DM; -static PyObject *__pyx_n_s_TA_PPO; -static PyObject *__pyx_n_s_TA_ROC; -static PyObject *__pyx_n_s_TA_ROCP; -static PyObject *__pyx_n_s_TA_ROCR; -static PyObject *__pyx_n_s_TA_ROCR100; -static PyObject *__pyx_n_s_TA_RSI; -static PyObject *__pyx_n_s_TA_SAR; -static PyObject *__pyx_n_s_TA_SAREXT; -static PyObject *__pyx_n_s_TA_SIN; -static PyObject *__pyx_n_s_TA_SINH; -static PyObject *__pyx_n_s_TA_SMA; -static PyObject *__pyx_n_s_TA_SQRT; -static PyObject *__pyx_n_s_TA_STDDEV; -static PyObject *__pyx_n_s_TA_STOCH; -static PyObject *__pyx_n_s_TA_STOCHF; -static PyObject *__pyx_n_s_TA_STOCHRSI; -static PyObject *__pyx_n_s_TA_SUB; -static PyObject *__pyx_n_s_TA_SUM; -static PyObject *__pyx_n_s_TA_T3; -static PyObject *__pyx_n_s_TA_TAN; -static PyObject *__pyx_n_s_TA_TANH; -static PyObject *__pyx_n_s_TA_TEMA; -static PyObject *__pyx_n_s_TA_TRANGE; -static PyObject *__pyx_n_s_TA_TRIMA; -static PyObject *__pyx_n_s_TA_TRIX; -static PyObject *__pyx_n_s_TA_TSF; -static PyObject *__pyx_n_s_TA_TYPPRICE; -static PyObject *__pyx_n_s_TA_ULTOSC; -static PyObject *__pyx_n_s_TA_VAR; -static PyObject *__pyx_n_s_TA_WCLPRICE; -static PyObject *__pyx_n_s_TA_WILLR; -static PyObject *__pyx_n_s_TA_WMA; -static PyObject *__pyx_n_s_TEMA; -static PyObject *__pyx_n_s_TRANGE; -static PyObject *__pyx_n_s_TRIMA; -static PyObject *__pyx_n_s_TRIX; -static PyObject *__pyx_n_s_TSF; -static PyObject *__pyx_n_s_TYPPRICE; -static PyObject *__pyx_n_s_ULTOSC; -static PyObject *__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib; -static PyObject *__pyx_n_s_VAR; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_WCLPRICE; -static PyObject *__pyx_n_s_WILLR; -static PyObject *__pyx_n_s_WMA; -static PyObject *__pyx_n_s_acceleration; -static PyObject *__pyx_n_s_accelerationinitlong; -static PyObject *__pyx_n_s_accelerationinitshort; -static PyObject *__pyx_n_s_accelerationlong; -static PyObject *__pyx_n_s_accelerationmaxlong; -static PyObject *__pyx_n_s_accelerationmaxshort; -static PyObject *__pyx_n_s_accelerationshort; -static PyObject *__pyx_n_s_all; -static PyObject *__pyx_n_s_begidx; -static PyObject *__pyx_n_s_close; -static PyObject *__pyx_n_s_close_data; -static PyObject *__pyx_kp_s_close_has_wrong_dimensions; -static PyObject *__pyx_kp_s_close_is_not_double; -static PyObject *__pyx_n_s_endidx; -static PyObject *__pyx_n_s_fastd_matype; -static PyObject *__pyx_n_s_fastd_period; -static PyObject *__pyx_n_s_fastk_period; -static PyObject *__pyx_n_s_fastlimit; -static PyObject *__pyx_n_s_fastmatype; -static PyObject *__pyx_n_s_fastperiod; -static PyObject *__pyx_n_s_high; -static PyObject *__pyx_n_s_high_data; -static PyObject *__pyx_kp_s_high_has_wrong_dimensions; -static PyObject *__pyx_kp_s_high_is_not_double; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_kp_s_input_lengths_are_different; -static PyObject *__pyx_n_s_length; -static PyObject *__pyx_n_s_lookback; -static PyObject *__pyx_n_s_low; -static PyObject *__pyx_n_s_low_data; -static PyObject *__pyx_kp_s_low_has_wrong_dimensions; -static PyObject *__pyx_kp_s_low_is_not_double; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_matype; -static PyObject *__pyx_n_s_maximum; -static PyObject *__pyx_n_s_maxperiod; -static PyObject *__pyx_n_s_minperiod; -static PyObject *__pyx_n_s_nan; -static PyObject *__pyx_n_s_nbdev; -static PyObject *__pyx_n_s_nbdevdn; -static PyObject *__pyx_n_s_nbdevup; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_offsetonreverse; -static PyObject *__pyx_n_s_open; -static PyObject *__pyx_n_s_open_data; -static PyObject *__pyx_kp_s_open_has_wrong_dimensions; -static PyObject *__pyx_kp_s_open_is_not_double; -static PyObject *__pyx_n_s_outaroondown; -static PyObject *__pyx_n_s_outaroonup; -static PyObject *__pyx_n_s_outbegidx; -static PyObject *__pyx_n_s_outfama; -static PyObject *__pyx_n_s_outfastd; -static PyObject *__pyx_n_s_outfastk; -static PyObject *__pyx_n_s_outinphase; -static PyObject *__pyx_n_s_outinteger; -static PyObject *__pyx_n_s_outleadsine; -static PyObject *__pyx_n_s_outmacd; -static PyObject *__pyx_n_s_outmacdhist; -static PyObject *__pyx_n_s_outmacdsignal; -static PyObject *__pyx_n_s_outmama; -static PyObject *__pyx_n_s_outmax; -static PyObject *__pyx_n_s_outmaxidx; -static PyObject *__pyx_n_s_outmin; -static PyObject *__pyx_n_s_outminidx; -static PyObject *__pyx_n_s_outnbelement; -static PyObject *__pyx_n_s_outquadrature; -static PyObject *__pyx_n_s_outreal; -static PyObject *__pyx_n_s_outreallowerband; -static PyObject *__pyx_n_s_outrealmiddleband; -static PyObject *__pyx_n_s_outrealupperband; -static PyObject *__pyx_n_s_outsine; -static PyObject *__pyx_n_s_outslowd; -static PyObject *__pyx_n_s_outslowk; -static PyObject *__pyx_n_s_penetration; -static PyObject *__pyx_n_s_periods; -static PyObject *__pyx_n_s_periods_data; -static PyObject *__pyx_kp_s_periods_has_wrong_dimensions; -static PyObject *__pyx_kp_s_periods_is_not_double; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_real; -static PyObject *__pyx_n_s_real0; -static PyObject *__pyx_n_s_real0_data; -static PyObject *__pyx_kp_s_real0_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real0_is_not_double; -static PyObject *__pyx_n_s_real1; -static PyObject *__pyx_n_s_real1_data; -static PyObject *__pyx_kp_s_real1_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real1_is_not_double; -static PyObject *__pyx_n_s_real_data; -static PyObject *__pyx_kp_s_real_has_wrong_dimensions; -static PyObject *__pyx_kp_s_real_is_not_double; -static PyObject *__pyx_n_s_retCode; -static PyObject *__pyx_n_s_signalmatype; -static PyObject *__pyx_n_s_signalperiod; -static PyObject *__pyx_n_s_slowd_matype; -static PyObject *__pyx_n_s_slowd_period; -static PyObject *__pyx_n_s_slowk_matype; -static PyObject *__pyx_n_s_slowk_period; -static PyObject *__pyx_n_s_slowlimit; -static PyObject *__pyx_n_s_slowmatype; -static PyObject *__pyx_n_s_slowperiod; -static PyObject *__pyx_n_s_startvalue; -static PyObject *__pyx_n_s_talib_stream; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_timeperiod; -static PyObject *__pyx_n_s_timeperiod1; -static PyObject *__pyx_n_s_timeperiod2; -static PyObject *__pyx_n_s_timeperiod3; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_val; -static PyObject *__pyx_n_s_vfactor; -static PyObject *__pyx_n_s_volume; -static PyObject *__pyx_n_s_volume_data; -static PyObject *__pyx_kp_s_volume_has_wrong_dimensions; -static PyObject *__pyx_kp_s_volume_is_not_double; -static PyObject *__pyx_pf_5talib_6stream_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_2AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_4ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_6ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_8ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_10ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_12APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_14AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_16AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_18ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_20ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_22ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_24AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_26BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_28BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_30BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_32CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_34CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_36CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_38CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_40CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_42CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_44CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_46CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_48CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_50CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_52CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_54CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_56CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_58CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_60CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_62CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_64CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_66CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_68CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_70CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_72CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_74CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_76CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_78CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_80CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_82CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_84CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_86CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_88CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_90CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_92CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_94CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_96CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_98CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_100CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_102CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_104CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_106CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_108CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_110CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_112CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_114CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_116CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_118CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_120CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_122CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_124CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_126CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_128CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_130CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_132CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_134CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_136CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_138CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_140CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_142CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_144CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_146CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_148CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_150CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_152CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_154CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_156CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_158CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_160CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_162COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_164COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_166DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_168DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_170DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_172EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_174EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_176FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_178HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_180HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_182HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_184HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_186HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_188HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_190KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_192LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_194LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_196LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_198LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_200LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_202LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_204MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_206MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_208MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_210MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_212MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_214MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_216MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_218MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_220MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_222MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_224MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_226MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_228MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_230MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_232MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_234MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_236MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_238MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_240MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_242MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_244NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_246OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_248PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_250PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_252PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_254ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_256ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_258ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_260ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_262RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_264SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_266SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_268SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_270SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_272SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_274SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_276STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_278STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_280STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_282STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_284SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_286SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_288T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_290TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_292TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_294TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_296TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_298TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_300TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_302TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_304TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_306ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_308VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_310WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_312WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod); /* proto */ -static PyObject *__pyx_pf_5talib_6stream_314WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; -static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__15; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__17; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__24; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__28; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__30; -static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__33; -static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__35; -static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__37; -static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__39; -static PyObject *__pyx_tuple__40; -static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__45; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__47; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_tuple__49; -static PyObject *__pyx_tuple__50; -static PyObject *__pyx_tuple__51; -static PyObject *__pyx_tuple__52; -static PyObject *__pyx_tuple__53; -static PyObject *__pyx_tuple__54; -static PyObject *__pyx_tuple__55; -static PyObject *__pyx_tuple__56; -static PyObject *__pyx_tuple__57; -static PyObject *__pyx_tuple__58; -static PyObject *__pyx_tuple__59; -static PyObject *__pyx_tuple__60; -static PyObject *__pyx_tuple__61; -static PyObject *__pyx_tuple__62; -static PyObject *__pyx_tuple__63; -static PyObject *__pyx_tuple__64; -static PyObject *__pyx_tuple__65; -static PyObject *__pyx_tuple__66; -static PyObject *__pyx_tuple__67; -static PyObject *__pyx_tuple__68; -static PyObject *__pyx_tuple__69; -static PyObject *__pyx_tuple__70; -static PyObject *__pyx_tuple__71; -static PyObject *__pyx_tuple__72; -static PyObject *__pyx_tuple__73; -static PyObject *__pyx_tuple__74; -static PyObject *__pyx_tuple__75; -static PyObject *__pyx_tuple__76; -static PyObject *__pyx_tuple__77; -static PyObject *__pyx_tuple__78; -static PyObject *__pyx_tuple__79; -static PyObject *__pyx_tuple__80; -static PyObject *__pyx_tuple__81; -static PyObject *__pyx_tuple__82; -static PyObject *__pyx_tuple__83; -static PyObject *__pyx_tuple__84; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__86; -static PyObject *__pyx_tuple__87; -static PyObject *__pyx_tuple__88; -static PyObject *__pyx_tuple__89; -static PyObject *__pyx_tuple__90; -static PyObject *__pyx_tuple__91; -static PyObject *__pyx_tuple__92; -static PyObject *__pyx_tuple__93; -static PyObject *__pyx_tuple__94; -static PyObject *__pyx_tuple__95; -static PyObject *__pyx_tuple__96; -static PyObject *__pyx_tuple__97; -static PyObject *__pyx_tuple__98; -static PyObject *__pyx_tuple__99; -static PyObject *__pyx_tuple__100; -static PyObject *__pyx_tuple__101; -static PyObject *__pyx_tuple__102; -static PyObject *__pyx_tuple__103; -static PyObject *__pyx_tuple__104; -static PyObject *__pyx_tuple__105; -static PyObject *__pyx_tuple__106; -static PyObject *__pyx_tuple__107; -static PyObject *__pyx_tuple__108; -static PyObject *__pyx_tuple__109; -static PyObject *__pyx_tuple__110; -static PyObject *__pyx_tuple__111; -static PyObject *__pyx_tuple__112; -static PyObject *__pyx_tuple__113; -static PyObject *__pyx_tuple__114; -static PyObject *__pyx_tuple__115; -static PyObject *__pyx_tuple__116; -static PyObject *__pyx_tuple__117; -static PyObject *__pyx_tuple__118; -static PyObject *__pyx_tuple__119; -static PyObject *__pyx_tuple__120; -static PyObject *__pyx_tuple__121; -static PyObject *__pyx_tuple__122; -static PyObject *__pyx_tuple__123; -static PyObject *__pyx_tuple__124; -static PyObject *__pyx_tuple__125; -static PyObject *__pyx_tuple__126; -static PyObject *__pyx_tuple__127; -static PyObject *__pyx_tuple__128; -static PyObject *__pyx_tuple__129; -static PyObject *__pyx_tuple__130; -static PyObject *__pyx_tuple__131; -static PyObject *__pyx_tuple__132; -static PyObject *__pyx_tuple__133; -static PyObject *__pyx_tuple__134; -static PyObject *__pyx_tuple__135; -static PyObject *__pyx_tuple__136; -static PyObject *__pyx_tuple__137; -static PyObject *__pyx_tuple__138; -static PyObject *__pyx_tuple__139; -static PyObject *__pyx_tuple__140; -static PyObject *__pyx_tuple__141; -static PyObject *__pyx_tuple__142; -static PyObject *__pyx_tuple__143; -static PyObject *__pyx_tuple__144; -static PyObject *__pyx_tuple__145; -static PyObject *__pyx_tuple__146; -static PyObject *__pyx_tuple__147; -static PyObject *__pyx_tuple__148; -static PyObject *__pyx_tuple__149; -static PyObject *__pyx_tuple__150; -static PyObject *__pyx_tuple__151; -static PyObject *__pyx_tuple__152; -static PyObject *__pyx_tuple__153; -static PyObject *__pyx_tuple__154; -static PyObject *__pyx_tuple__155; -static PyObject *__pyx_tuple__156; -static PyObject *__pyx_tuple__157; -static PyObject *__pyx_tuple__158; -static PyObject *__pyx_tuple__159; -static PyObject *__pyx_tuple__160; -static PyObject *__pyx_tuple__161; -static PyObject *__pyx_tuple__162; -static PyObject *__pyx_tuple__163; -static PyObject *__pyx_tuple__164; -static PyObject *__pyx_tuple__165; -static PyObject *__pyx_tuple__166; -static PyObject *__pyx_tuple__167; -static PyObject *__pyx_tuple__168; -static PyObject *__pyx_tuple__169; -static PyObject *__pyx_tuple__170; -static PyObject *__pyx_tuple__171; -static PyObject *__pyx_tuple__172; -static PyObject *__pyx_tuple__173; -static PyObject *__pyx_tuple__174; -static PyObject *__pyx_tuple__175; -static PyObject *__pyx_tuple__176; -static PyObject *__pyx_tuple__177; -static PyObject *__pyx_tuple__178; -static PyObject *__pyx_tuple__179; -static PyObject *__pyx_tuple__180; -static PyObject *__pyx_tuple__181; -static PyObject *__pyx_tuple__182; -static PyObject *__pyx_tuple__183; -static PyObject *__pyx_tuple__184; -static PyObject *__pyx_tuple__185; -static PyObject *__pyx_tuple__186; -static PyObject *__pyx_tuple__187; -static PyObject *__pyx_tuple__188; -static PyObject *__pyx_tuple__189; -static PyObject *__pyx_tuple__190; -static PyObject *__pyx_tuple__191; -static PyObject *__pyx_tuple__192; -static PyObject *__pyx_tuple__193; -static PyObject *__pyx_tuple__194; -static PyObject *__pyx_tuple__195; -static PyObject *__pyx_tuple__196; -static PyObject *__pyx_tuple__197; -static PyObject *__pyx_tuple__198; -static PyObject *__pyx_tuple__199; -static PyObject *__pyx_tuple__200; -static PyObject *__pyx_tuple__201; -static PyObject *__pyx_tuple__202; -static PyObject *__pyx_tuple__203; -static PyObject *__pyx_tuple__204; -static PyObject *__pyx_tuple__205; -static PyObject *__pyx_tuple__206; -static PyObject *__pyx_tuple__207; -static PyObject *__pyx_tuple__208; -static PyObject *__pyx_tuple__209; -static PyObject *__pyx_tuple__210; -static PyObject *__pyx_tuple__211; -static PyObject *__pyx_tuple__212; -static PyObject *__pyx_tuple__213; -static PyObject *__pyx_tuple__214; -static PyObject *__pyx_tuple__215; -static PyObject *__pyx_tuple__216; -static PyObject *__pyx_tuple__217; -static PyObject *__pyx_tuple__218; -static PyObject *__pyx_tuple__219; -static PyObject *__pyx_tuple__220; -static PyObject *__pyx_tuple__221; -static PyObject *__pyx_tuple__222; -static PyObject *__pyx_tuple__223; -static PyObject *__pyx_tuple__224; -static PyObject *__pyx_tuple__225; -static PyObject *__pyx_tuple__226; -static PyObject *__pyx_tuple__227; -static PyObject *__pyx_tuple__228; -static PyObject *__pyx_tuple__229; -static PyObject *__pyx_tuple__230; -static PyObject *__pyx_tuple__231; -static PyObject *__pyx_tuple__232; -static PyObject *__pyx_tuple__233; -static PyObject *__pyx_tuple__234; -static PyObject *__pyx_tuple__235; -static PyObject *__pyx_tuple__236; -static PyObject *__pyx_tuple__237; -static PyObject *__pyx_tuple__238; -static PyObject *__pyx_tuple__239; -static PyObject *__pyx_tuple__240; -static PyObject *__pyx_tuple__241; -static PyObject *__pyx_tuple__242; -static PyObject *__pyx_tuple__243; -static PyObject *__pyx_tuple__244; -static PyObject *__pyx_tuple__245; -static PyObject *__pyx_tuple__246; -static PyObject *__pyx_tuple__247; -static PyObject *__pyx_tuple__248; -static PyObject *__pyx_tuple__249; -static PyObject *__pyx_tuple__250; -static PyObject *__pyx_tuple__251; -static PyObject *__pyx_tuple__252; -static PyObject *__pyx_tuple__253; -static PyObject *__pyx_tuple__254; -static PyObject *__pyx_tuple__255; -static PyObject *__pyx_tuple__256; -static PyObject *__pyx_tuple__257; -static PyObject *__pyx_tuple__258; -static PyObject *__pyx_tuple__259; -static PyObject *__pyx_tuple__260; -static PyObject *__pyx_tuple__261; -static PyObject *__pyx_tuple__262; -static PyObject *__pyx_tuple__263; -static PyObject *__pyx_tuple__264; -static PyObject *__pyx_tuple__265; -static PyObject *__pyx_tuple__266; -static PyObject *__pyx_tuple__267; -static PyObject *__pyx_tuple__268; -static PyObject *__pyx_tuple__269; -static PyObject *__pyx_tuple__270; -static PyObject *__pyx_tuple__271; -static PyObject *__pyx_tuple__272; -static PyObject *__pyx_tuple__273; -static PyObject *__pyx_tuple__274; -static PyObject *__pyx_tuple__275; -static PyObject *__pyx_tuple__276; -static PyObject *__pyx_tuple__277; -static PyObject *__pyx_tuple__278; -static PyObject *__pyx_tuple__279; -static PyObject *__pyx_tuple__280; -static PyObject *__pyx_tuple__281; -static PyObject *__pyx_tuple__282; -static PyObject *__pyx_tuple__283; -static PyObject *__pyx_tuple__284; -static PyObject *__pyx_tuple__285; -static PyObject *__pyx_tuple__286; -static PyObject *__pyx_tuple__287; -static PyObject *__pyx_tuple__288; -static PyObject *__pyx_tuple__289; -static PyObject *__pyx_tuple__290; -static PyObject *__pyx_tuple__291; -static PyObject *__pyx_tuple__292; -static PyObject *__pyx_tuple__293; -static PyObject *__pyx_tuple__294; -static PyObject *__pyx_tuple__295; -static PyObject *__pyx_tuple__296; -static PyObject *__pyx_tuple__297; -static PyObject *__pyx_tuple__298; -static PyObject *__pyx_tuple__299; -static PyObject *__pyx_tuple__300; -static PyObject *__pyx_tuple__301; -static PyObject *__pyx_tuple__302; -static PyObject *__pyx_tuple__303; -static PyObject *__pyx_tuple__304; -static PyObject *__pyx_tuple__305; -static PyObject *__pyx_tuple__306; -static PyObject *__pyx_tuple__307; -static PyObject *__pyx_tuple__308; -static PyObject *__pyx_tuple__309; -static PyObject *__pyx_tuple__310; -static PyObject *__pyx_tuple__311; -static PyObject *__pyx_tuple__312; -static PyObject *__pyx_tuple__313; -static PyObject *__pyx_tuple__314; -static PyObject *__pyx_tuple__315; -static PyObject *__pyx_tuple__316; -static PyObject *__pyx_tuple__317; -static PyObject *__pyx_tuple__318; -static PyObject *__pyx_tuple__319; -static PyObject *__pyx_tuple__320; -static PyObject *__pyx_tuple__321; -static PyObject *__pyx_tuple__322; -static PyObject *__pyx_tuple__323; -static PyObject *__pyx_tuple__324; -static PyObject *__pyx_tuple__325; -static PyObject *__pyx_tuple__326; -static PyObject *__pyx_tuple__327; -static PyObject *__pyx_tuple__328; -static PyObject *__pyx_tuple__329; -static PyObject *__pyx_tuple__330; -static PyObject *__pyx_tuple__331; -static PyObject *__pyx_tuple__332; -static PyObject *__pyx_tuple__333; -static PyObject *__pyx_tuple__334; -static PyObject *__pyx_tuple__335; -static PyObject *__pyx_tuple__336; -static PyObject *__pyx_tuple__337; -static PyObject *__pyx_tuple__338; -static PyObject *__pyx_tuple__339; -static PyObject *__pyx_tuple__340; -static PyObject *__pyx_tuple__341; -static PyObject *__pyx_tuple__342; -static PyObject *__pyx_tuple__343; -static PyObject *__pyx_tuple__344; -static PyObject *__pyx_tuple__345; -static PyObject *__pyx_tuple__346; -static PyObject *__pyx_tuple__347; -static PyObject *__pyx_tuple__348; -static PyObject *__pyx_tuple__349; -static PyObject *__pyx_tuple__350; -static PyObject *__pyx_tuple__351; -static PyObject *__pyx_tuple__352; -static PyObject *__pyx_tuple__353; -static PyObject *__pyx_tuple__354; -static PyObject *__pyx_tuple__355; -static PyObject *__pyx_tuple__356; -static PyObject *__pyx_tuple__357; -static PyObject *__pyx_tuple__358; -static PyObject *__pyx_tuple__359; -static PyObject *__pyx_tuple__360; -static PyObject *__pyx_tuple__361; -static PyObject *__pyx_tuple__362; -static PyObject *__pyx_tuple__363; -static PyObject *__pyx_tuple__364; -static PyObject *__pyx_tuple__365; -static PyObject *__pyx_tuple__366; -static PyObject *__pyx_tuple__367; -static PyObject *__pyx_tuple__368; -static PyObject *__pyx_tuple__369; -static PyObject *__pyx_tuple__370; -static PyObject *__pyx_tuple__371; -static PyObject *__pyx_tuple__372; -static PyObject *__pyx_tuple__373; -static PyObject *__pyx_tuple__374; -static PyObject *__pyx_tuple__375; -static PyObject *__pyx_tuple__376; -static PyObject *__pyx_tuple__377; -static PyObject *__pyx_tuple__378; -static PyObject *__pyx_tuple__379; -static PyObject *__pyx_tuple__380; -static PyObject *__pyx_tuple__381; -static PyObject *__pyx_tuple__382; -static PyObject *__pyx_tuple__383; -static PyObject *__pyx_tuple__384; -static PyObject *__pyx_tuple__385; -static PyObject *__pyx_tuple__386; -static PyObject *__pyx_tuple__387; -static PyObject *__pyx_tuple__388; -static PyObject *__pyx_tuple__389; -static PyObject *__pyx_tuple__390; -static PyObject *__pyx_tuple__391; -static PyObject *__pyx_tuple__392; -static PyObject *__pyx_tuple__393; -static PyObject *__pyx_tuple__394; -static PyObject *__pyx_tuple__395; -static PyObject *__pyx_tuple__396; -static PyObject *__pyx_tuple__397; -static PyObject *__pyx_tuple__398; -static PyObject *__pyx_tuple__399; -static PyObject *__pyx_tuple__400; -static PyObject *__pyx_tuple__401; -static PyObject *__pyx_tuple__402; -static PyObject *__pyx_tuple__403; -static PyObject *__pyx_tuple__404; -static PyObject *__pyx_tuple__405; -static PyObject *__pyx_tuple__406; -static PyObject *__pyx_tuple__407; -static PyObject *__pyx_tuple__408; -static PyObject *__pyx_tuple__409; -static PyObject *__pyx_tuple__410; -static PyObject *__pyx_tuple__411; -static PyObject *__pyx_tuple__412; -static PyObject *__pyx_tuple__413; -static PyObject *__pyx_tuple__414; -static PyObject *__pyx_tuple__415; -static PyObject *__pyx_tuple__416; -static PyObject *__pyx_tuple__417; -static PyObject *__pyx_tuple__418; -static PyObject *__pyx_tuple__419; -static PyObject *__pyx_tuple__420; -static PyObject *__pyx_tuple__421; -static PyObject *__pyx_tuple__422; -static PyObject *__pyx_tuple__423; -static PyObject *__pyx_tuple__424; -static PyObject *__pyx_tuple__425; -static PyObject *__pyx_tuple__426; -static PyObject *__pyx_tuple__427; -static PyObject *__pyx_tuple__428; -static PyObject *__pyx_tuple__429; -static PyObject *__pyx_tuple__430; -static PyObject *__pyx_tuple__431; -static PyObject *__pyx_tuple__432; -static PyObject *__pyx_tuple__433; -static PyObject *__pyx_tuple__434; -static PyObject *__pyx_tuple__435; -static PyObject *__pyx_tuple__436; -static PyObject *__pyx_tuple__437; -static PyObject *__pyx_tuple__438; -static PyObject *__pyx_tuple__439; -static PyObject *__pyx_tuple__440; -static PyObject *__pyx_tuple__441; -static PyObject *__pyx_tuple__442; -static PyObject *__pyx_tuple__443; -static PyObject *__pyx_tuple__444; -static PyObject *__pyx_tuple__445; -static PyObject *__pyx_tuple__446; -static PyObject *__pyx_tuple__447; -static PyObject *__pyx_tuple__448; -static PyObject *__pyx_tuple__449; -static PyObject *__pyx_tuple__450; -static PyObject *__pyx_tuple__451; -static PyObject *__pyx_tuple__452; -static PyObject *__pyx_tuple__453; -static PyObject *__pyx_tuple__454; -static PyObject *__pyx_tuple__455; -static PyObject *__pyx_tuple__456; -static PyObject *__pyx_tuple__457; -static PyObject *__pyx_tuple__458; -static PyObject *__pyx_tuple__459; -static PyObject *__pyx_tuple__460; -static PyObject *__pyx_tuple__461; -static PyObject *__pyx_tuple__462; -static PyObject *__pyx_tuple__463; -static PyObject *__pyx_tuple__464; -static PyObject *__pyx_tuple__465; -static PyObject *__pyx_tuple__466; -static PyObject *__pyx_tuple__467; -static PyObject *__pyx_tuple__468; -static PyObject *__pyx_tuple__469; -static PyObject *__pyx_tuple__470; -static PyObject *__pyx_tuple__471; -static PyObject *__pyx_tuple__472; -static PyObject *__pyx_tuple__473; -static PyObject *__pyx_tuple__474; -static PyObject *__pyx_tuple__475; -static PyObject *__pyx_tuple__476; -static PyObject *__pyx_tuple__477; -static PyObject *__pyx_tuple__478; -static PyObject *__pyx_tuple__479; -static PyObject *__pyx_tuple__480; -static PyObject *__pyx_tuple__481; -static PyObject *__pyx_tuple__482; -static PyObject *__pyx_tuple__483; -static PyObject *__pyx_tuple__484; -static PyObject *__pyx_tuple__485; -static PyObject *__pyx_tuple__486; -static PyObject *__pyx_tuple__487; -static PyObject *__pyx_tuple__488; -static PyObject *__pyx_tuple__489; -static PyObject *__pyx_tuple__490; -static PyObject *__pyx_tuple__491; -static PyObject *__pyx_tuple__492; -static PyObject *__pyx_tuple__493; -static PyObject *__pyx_tuple__494; -static PyObject *__pyx_tuple__495; -static PyObject *__pyx_tuple__496; -static PyObject *__pyx_tuple__497; -static PyObject *__pyx_tuple__498; -static PyObject *__pyx_tuple__499; -static PyObject *__pyx_tuple__500; -static PyObject *__pyx_tuple__501; -static PyObject *__pyx_tuple__502; -static PyObject *__pyx_tuple__503; -static PyObject *__pyx_tuple__504; -static PyObject *__pyx_tuple__505; -static PyObject *__pyx_tuple__506; -static PyObject *__pyx_tuple__507; -static PyObject *__pyx_tuple__508; -static PyObject *__pyx_tuple__509; -static PyObject *__pyx_tuple__510; -static PyObject *__pyx_tuple__511; -static PyObject *__pyx_tuple__512; -static PyObject *__pyx_tuple__513; -static PyObject *__pyx_tuple__514; -static PyObject *__pyx_tuple__515; -static PyObject *__pyx_tuple__516; -static PyObject *__pyx_tuple__517; -static PyObject *__pyx_tuple__518; -static PyObject *__pyx_tuple__519; -static PyObject *__pyx_tuple__520; -static PyObject *__pyx_tuple__521; -static PyObject *__pyx_tuple__522; -static PyObject *__pyx_tuple__523; -static PyObject *__pyx_tuple__524; -static PyObject *__pyx_tuple__525; -static PyObject *__pyx_tuple__526; -static PyObject *__pyx_tuple__527; -static PyObject *__pyx_tuple__528; -static PyObject *__pyx_tuple__529; -static PyObject *__pyx_tuple__530; -static PyObject *__pyx_tuple__531; -static PyObject *__pyx_tuple__532; -static PyObject *__pyx_tuple__533; -static PyObject *__pyx_tuple__534; -static PyObject *__pyx_tuple__535; -static PyObject *__pyx_tuple__536; -static PyObject *__pyx_tuple__537; -static PyObject *__pyx_tuple__538; -static PyObject *__pyx_tuple__539; -static PyObject *__pyx_tuple__540; -static PyObject *__pyx_tuple__541; -static PyObject *__pyx_tuple__542; -static PyObject *__pyx_tuple__543; -static PyObject *__pyx_tuple__544; -static PyObject *__pyx_tuple__545; -static PyObject *__pyx_tuple__546; -static PyObject *__pyx_tuple__547; -static PyObject *__pyx_tuple__548; -static PyObject *__pyx_tuple__549; -static PyObject *__pyx_tuple__550; -static PyObject *__pyx_tuple__551; -static PyObject *__pyx_tuple__552; -static PyObject *__pyx_tuple__553; -static PyObject *__pyx_tuple__554; -static PyObject *__pyx_tuple__555; -static PyObject *__pyx_tuple__556; -static PyObject *__pyx_tuple__557; -static PyObject *__pyx_tuple__558; -static PyObject *__pyx_tuple__559; -static PyObject *__pyx_tuple__560; -static PyObject *__pyx_tuple__561; -static PyObject *__pyx_tuple__562; -static PyObject *__pyx_tuple__563; -static PyObject *__pyx_tuple__564; -static PyObject *__pyx_tuple__565; -static PyObject *__pyx_tuple__566; -static PyObject *__pyx_tuple__567; -static PyObject *__pyx_tuple__568; -static PyObject *__pyx_tuple__569; -static PyObject *__pyx_tuple__570; -static PyObject *__pyx_tuple__571; -static PyObject *__pyx_tuple__572; -static PyObject *__pyx_tuple__573; -static PyObject *__pyx_tuple__574; -static PyObject *__pyx_tuple__575; -static PyObject *__pyx_tuple__576; -static PyObject *__pyx_tuple__577; -static PyObject *__pyx_tuple__578; -static PyObject *__pyx_tuple__579; -static PyObject *__pyx_tuple__580; -static PyObject *__pyx_tuple__581; -static PyObject *__pyx_tuple__582; -static PyObject *__pyx_tuple__583; -static PyObject *__pyx_tuple__584; -static PyObject *__pyx_tuple__585; -static PyObject *__pyx_tuple__586; -static PyObject *__pyx_tuple__587; -static PyObject *__pyx_tuple__588; -static PyObject *__pyx_tuple__589; -static PyObject *__pyx_tuple__590; -static PyObject *__pyx_tuple__591; -static PyObject *__pyx_tuple__592; -static PyObject *__pyx_tuple__593; -static PyObject *__pyx_tuple__594; -static PyObject *__pyx_tuple__595; -static PyObject *__pyx_tuple__596; -static PyObject *__pyx_tuple__597; -static PyObject *__pyx_tuple__598; -static PyObject *__pyx_tuple__599; -static PyObject *__pyx_tuple__600; -static PyObject *__pyx_tuple__601; -static PyObject *__pyx_tuple__602; -static PyObject *__pyx_tuple__603; -static PyObject *__pyx_tuple__604; -static PyObject *__pyx_tuple__605; -static PyObject *__pyx_tuple__606; -static PyObject *__pyx_tuple__607; -static PyObject *__pyx_tuple__608; -static PyObject *__pyx_tuple__609; -static PyObject *__pyx_tuple__610; -static PyObject *__pyx_tuple__611; -static PyObject *__pyx_tuple__612; -static PyObject *__pyx_tuple__613; -static PyObject *__pyx_tuple__614; -static PyObject *__pyx_tuple__615; -static PyObject *__pyx_tuple__616; -static PyObject *__pyx_tuple__617; -static PyObject *__pyx_tuple__618; -static PyObject *__pyx_tuple__619; -static PyObject *__pyx_tuple__620; -static PyObject *__pyx_tuple__621; -static PyObject *__pyx_tuple__622; -static PyObject *__pyx_tuple__623; -static PyObject *__pyx_tuple__624; -static PyObject *__pyx_tuple__625; -static PyObject *__pyx_tuple__626; -static PyObject *__pyx_tuple__627; -static PyObject *__pyx_tuple__628; -static PyObject *__pyx_tuple__629; -static PyObject *__pyx_tuple__630; -static PyObject *__pyx_tuple__631; -static PyObject *__pyx_tuple__632; -static PyObject *__pyx_tuple__633; -static PyObject *__pyx_tuple__634; -static PyObject *__pyx_tuple__635; -static PyObject *__pyx_tuple__636; -static PyObject *__pyx_tuple__637; -static PyObject *__pyx_tuple__638; -static PyObject *__pyx_tuple__639; -static PyObject *__pyx_tuple__640; -static PyObject *__pyx_tuple__641; -static PyObject *__pyx_tuple__642; -static PyObject *__pyx_tuple__643; -static PyObject *__pyx_tuple__644; -static PyObject *__pyx_tuple__645; -static PyObject *__pyx_tuple__646; -static PyObject *__pyx_tuple__647; -static PyObject *__pyx_tuple__648; -static PyObject *__pyx_tuple__649; -static PyObject *__pyx_tuple__650; -static PyObject *__pyx_tuple__651; -static PyObject *__pyx_tuple__652; -static PyObject *__pyx_tuple__653; -static PyObject *__pyx_tuple__654; -static PyObject *__pyx_tuple__655; -static PyObject *__pyx_tuple__656; -static PyObject *__pyx_tuple__657; -static PyObject *__pyx_tuple__658; -static PyObject *__pyx_tuple__659; -static PyObject *__pyx_tuple__660; -static PyObject *__pyx_tuple__661; -static PyObject *__pyx_tuple__662; -static PyObject *__pyx_tuple__663; -static PyObject *__pyx_tuple__664; -static PyObject *__pyx_tuple__665; -static PyObject *__pyx_tuple__666; -static PyObject *__pyx_tuple__667; -static PyObject *__pyx_tuple__668; -static PyObject *__pyx_tuple__669; -static PyObject *__pyx_tuple__670; -static PyObject *__pyx_tuple__671; -static PyObject *__pyx_tuple__672; -static PyObject *__pyx_tuple__673; -static PyObject *__pyx_tuple__674; -static PyObject *__pyx_tuple__675; -static PyObject *__pyx_tuple__676; -static PyObject *__pyx_tuple__677; -static PyObject *__pyx_tuple__678; -static PyObject *__pyx_tuple__679; -static PyObject *__pyx_tuple__680; -static PyObject *__pyx_tuple__681; -static PyObject *__pyx_tuple__682; -static PyObject *__pyx_tuple__683; -static PyObject *__pyx_tuple__684; -static PyObject *__pyx_tuple__685; -static PyObject *__pyx_tuple__686; -static PyObject *__pyx_tuple__687; -static PyObject *__pyx_tuple__688; -static PyObject *__pyx_tuple__689; -static PyObject *__pyx_tuple__690; -static PyObject *__pyx_tuple__691; -static PyObject *__pyx_tuple__692; -static PyObject *__pyx_tuple__693; -static PyObject *__pyx_tuple__694; -static PyObject *__pyx_tuple__695; -static PyObject *__pyx_tuple__696; -static PyObject *__pyx_tuple__697; -static PyObject *__pyx_tuple__698; -static PyObject *__pyx_tuple__699; -static PyObject *__pyx_tuple__700; -static PyObject *__pyx_tuple__701; -static PyObject *__pyx_tuple__702; -static PyObject *__pyx_tuple__703; -static PyObject *__pyx_tuple__704; -static PyObject *__pyx_tuple__705; -static PyObject *__pyx_tuple__706; -static PyObject *__pyx_tuple__707; -static PyObject *__pyx_tuple__708; -static PyObject *__pyx_tuple__709; -static PyObject *__pyx_tuple__710; -static PyObject *__pyx_tuple__711; -static PyObject *__pyx_tuple__712; -static PyObject *__pyx_tuple__713; -static PyObject *__pyx_tuple__714; -static PyObject *__pyx_tuple__715; -static PyObject *__pyx_tuple__716; -static PyObject *__pyx_tuple__717; -static PyObject *__pyx_tuple__718; -static PyObject *__pyx_tuple__719; -static PyObject *__pyx_tuple__720; -static PyObject *__pyx_tuple__721; -static PyObject *__pyx_tuple__722; -static PyObject *__pyx_tuple__723; -static PyObject *__pyx_tuple__724; -static PyObject *__pyx_tuple__725; -static PyObject *__pyx_tuple__726; -static PyObject *__pyx_tuple__727; -static PyObject *__pyx_tuple__728; -static PyObject *__pyx_tuple__729; -static PyObject *__pyx_tuple__730; -static PyObject *__pyx_tuple__731; -static PyObject *__pyx_tuple__732; -static PyObject *__pyx_tuple__733; -static PyObject *__pyx_tuple__734; -static PyObject *__pyx_tuple__735; -static PyObject *__pyx_tuple__736; -static PyObject *__pyx_tuple__737; -static PyObject *__pyx_tuple__738; -static PyObject *__pyx_tuple__739; -static PyObject *__pyx_tuple__740; -static PyObject *__pyx_tuple__741; -static PyObject *__pyx_tuple__742; -static PyObject *__pyx_tuple__743; -static PyObject *__pyx_tuple__744; -static PyObject *__pyx_tuple__745; -static PyObject *__pyx_tuple__746; -static PyObject *__pyx_tuple__747; -static PyObject *__pyx_tuple__748; -static PyObject *__pyx_tuple__749; -static PyObject *__pyx_tuple__750; -static PyObject *__pyx_tuple__751; -static PyObject *__pyx_tuple__752; -static PyObject *__pyx_tuple__753; -static PyObject *__pyx_tuple__754; -static PyObject *__pyx_tuple__755; -static PyObject *__pyx_tuple__756; -static PyObject *__pyx_tuple__757; -static PyObject *__pyx_tuple__758; -static PyObject *__pyx_tuple__759; -static PyObject *__pyx_tuple__760; -static PyObject *__pyx_tuple__761; -static PyObject *__pyx_tuple__762; -static PyObject *__pyx_tuple__763; -static PyObject *__pyx_tuple__764; -static PyObject *__pyx_tuple__765; -static PyObject *__pyx_tuple__766; -static PyObject *__pyx_tuple__767; -static PyObject *__pyx_tuple__768; -static PyObject *__pyx_tuple__769; -static PyObject *__pyx_tuple__770; -static PyObject *__pyx_tuple__771; -static PyObject *__pyx_tuple__772; -static PyObject *__pyx_tuple__773; -static PyObject *__pyx_tuple__774; -static PyObject *__pyx_tuple__775; -static PyObject *__pyx_tuple__776; -static PyObject *__pyx_tuple__777; -static PyObject *__pyx_tuple__778; -static PyObject *__pyx_tuple__779; -static PyObject *__pyx_tuple__780; -static PyObject *__pyx_tuple__781; -static PyObject *__pyx_tuple__782; -static PyObject *__pyx_tuple__783; -static PyObject *__pyx_tuple__784; -static PyObject *__pyx_tuple__785; -static PyObject *__pyx_tuple__786; -static PyObject *__pyx_tuple__787; -static PyObject *__pyx_tuple__788; -static PyObject *__pyx_tuple__789; -static PyObject *__pyx_tuple__790; -static PyObject *__pyx_tuple__791; -static PyObject *__pyx_tuple__792; -static PyObject *__pyx_tuple__793; -static PyObject *__pyx_tuple__794; -static PyObject *__pyx_tuple__795; -static PyObject *__pyx_tuple__796; -static PyObject *__pyx_tuple__797; -static PyObject *__pyx_tuple__798; -static PyObject *__pyx_tuple__799; -static PyObject *__pyx_tuple__800; -static PyObject *__pyx_tuple__801; -static PyObject *__pyx_tuple__802; -static PyObject *__pyx_tuple__803; -static PyObject *__pyx_tuple__804; -static PyObject *__pyx_tuple__805; -static PyObject *__pyx_tuple__806; -static PyObject *__pyx_tuple__807; -static PyObject *__pyx_tuple__808; -static PyObject *__pyx_tuple__809; -static PyObject *__pyx_tuple__810; -static PyObject *__pyx_tuple__811; -static PyObject *__pyx_tuple__812; -static PyObject *__pyx_tuple__813; -static PyObject *__pyx_tuple__814; -static PyObject *__pyx_tuple__815; -static PyObject *__pyx_tuple__816; -static PyObject *__pyx_tuple__817; -static PyObject *__pyx_tuple__818; -static PyObject *__pyx_tuple__819; -static PyObject *__pyx_tuple__820; -static PyObject *__pyx_tuple__821; -static PyObject *__pyx_tuple__822; -static PyObject *__pyx_tuple__823; -static PyObject *__pyx_tuple__824; -static PyObject *__pyx_tuple__825; -static PyObject *__pyx_tuple__826; -static PyObject *__pyx_tuple__827; -static PyObject *__pyx_tuple__828; -static PyObject *__pyx_tuple__829; -static PyObject *__pyx_tuple__830; -static PyObject *__pyx_tuple__831; -static PyObject *__pyx_tuple__832; -static PyObject *__pyx_tuple__833; -static PyObject *__pyx_tuple__834; -static PyObject *__pyx_tuple__835; -static PyObject *__pyx_tuple__836; -static PyObject *__pyx_tuple__837; -static PyObject *__pyx_tuple__838; -static PyObject *__pyx_tuple__839; -static PyObject *__pyx_tuple__840; -static PyObject *__pyx_tuple__841; -static PyObject *__pyx_tuple__842; -static PyObject *__pyx_tuple__843; -static PyObject *__pyx_tuple__844; -static PyObject *__pyx_tuple__845; -static PyObject *__pyx_tuple__846; -static PyObject *__pyx_tuple__847; -static PyObject *__pyx_tuple__848; -static PyObject *__pyx_tuple__849; -static PyObject *__pyx_tuple__850; -static PyObject *__pyx_tuple__851; -static PyObject *__pyx_tuple__852; -static PyObject *__pyx_tuple__853; -static PyObject *__pyx_tuple__854; -static PyObject *__pyx_tuple__855; -static PyObject *__pyx_tuple__856; -static PyObject *__pyx_tuple__857; -static PyObject *__pyx_tuple__858; -static PyObject *__pyx_tuple__859; -static PyObject *__pyx_tuple__860; -static PyObject *__pyx_tuple__861; -static PyObject *__pyx_tuple__862; -static PyObject *__pyx_tuple__863; -static PyObject *__pyx_tuple__864; -static PyObject *__pyx_tuple__865; -static PyObject *__pyx_tuple__866; -static PyObject *__pyx_tuple__867; -static PyObject *__pyx_tuple__868; -static PyObject *__pyx_tuple__869; -static PyObject *__pyx_tuple__870; -static PyObject *__pyx_tuple__871; -static PyObject *__pyx_tuple__872; -static PyObject *__pyx_tuple__873; -static PyObject *__pyx_tuple__874; -static PyObject *__pyx_tuple__875; -static PyObject *__pyx_tuple__876; -static PyObject *__pyx_tuple__877; -static PyObject *__pyx_tuple__878; -static PyObject *__pyx_tuple__879; -static PyObject *__pyx_tuple__880; -static PyObject *__pyx_tuple__881; -static PyObject *__pyx_tuple__882; -static PyObject *__pyx_tuple__883; -static PyObject *__pyx_tuple__884; -static PyObject *__pyx_tuple__885; -static PyObject *__pyx_tuple__886; -static PyObject *__pyx_tuple__887; -static PyObject *__pyx_tuple__888; -static PyObject *__pyx_tuple__889; -static PyObject *__pyx_tuple__890; -static PyObject *__pyx_tuple__891; -static PyObject *__pyx_tuple__892; -static PyObject *__pyx_tuple__893; -static PyObject *__pyx_tuple__894; -static PyObject *__pyx_tuple__895; -static PyObject *__pyx_tuple__896; -static PyObject *__pyx_tuple__897; -static PyObject *__pyx_tuple__898; -static PyObject *__pyx_tuple__899; -static PyObject *__pyx_tuple__900; -static PyObject *__pyx_tuple__901; -static PyObject *__pyx_tuple__902; -static PyObject *__pyx_tuple__903; -static PyObject *__pyx_tuple__904; -static PyObject *__pyx_tuple__905; -static PyObject *__pyx_tuple__906; -static PyObject *__pyx_tuple__907; -static PyObject *__pyx_tuple__908; -static PyObject *__pyx_tuple__909; -static PyObject *__pyx_tuple__910; -static PyObject *__pyx_tuple__911; -static PyObject *__pyx_tuple__912; -static PyObject *__pyx_tuple__913; -static PyObject *__pyx_tuple__914; -static PyObject *__pyx_tuple__915; -static PyObject *__pyx_tuple__916; -static PyObject *__pyx_tuple__917; -static PyObject *__pyx_tuple__918; -static PyObject *__pyx_tuple__919; -static PyObject *__pyx_tuple__920; -static PyObject *__pyx_tuple__921; -static PyObject *__pyx_tuple__922; -static PyObject *__pyx_tuple__923; -static PyObject *__pyx_tuple__924; -static PyObject *__pyx_tuple__925; -static PyObject *__pyx_tuple__926; -static PyObject *__pyx_tuple__927; -static PyObject *__pyx_tuple__928; -static PyObject *__pyx_tuple__929; -static PyObject *__pyx_tuple__930; -static PyObject *__pyx_tuple__931; -static PyObject *__pyx_tuple__932; -static PyObject *__pyx_tuple__933; -static PyObject *__pyx_tuple__934; -static PyObject *__pyx_tuple__935; -static PyObject *__pyx_tuple__936; -static PyObject *__pyx_tuple__937; -static PyObject *__pyx_tuple__938; -static PyObject *__pyx_tuple__939; -static PyObject *__pyx_tuple__940; -static PyObject *__pyx_tuple__941; -static PyObject *__pyx_tuple__942; -static PyObject *__pyx_tuple__943; -static PyObject *__pyx_tuple__944; -static PyObject *__pyx_tuple__945; -static PyObject *__pyx_tuple__946; -static PyObject *__pyx_tuple__947; -static PyObject *__pyx_tuple__948; -static PyObject *__pyx_tuple__949; -static PyObject *__pyx_tuple__950; -static PyObject *__pyx_tuple__951; -static PyObject *__pyx_tuple__952; -static PyObject *__pyx_tuple__953; -static PyObject *__pyx_tuple__954; -static PyObject *__pyx_tuple__955; -static PyObject *__pyx_tuple__956; -static PyObject *__pyx_tuple__957; -static PyObject *__pyx_tuple__958; -static PyObject *__pyx_tuple__959; -static PyObject *__pyx_tuple__960; -static PyObject *__pyx_tuple__961; -static PyObject *__pyx_tuple__962; -static PyObject *__pyx_tuple__963; -static PyObject *__pyx_tuple__964; -static PyObject *__pyx_tuple__965; -static PyObject *__pyx_tuple__966; -static PyObject *__pyx_tuple__967; -static PyObject *__pyx_tuple__968; -static PyObject *__pyx_tuple__969; -static PyObject *__pyx_tuple__970; -static PyObject *__pyx_tuple__971; -static PyObject *__pyx_tuple__972; -static PyObject *__pyx_tuple__973; -static PyObject *__pyx_tuple__974; -static PyObject *__pyx_tuple__975; -static PyObject *__pyx_tuple__976; -static PyObject *__pyx_tuple__977; -static PyObject *__pyx_tuple__978; -static PyObject *__pyx_tuple__979; -static PyObject *__pyx_tuple__980; -static PyObject *__pyx_tuple__981; -static PyObject *__pyx_tuple__982; -static PyObject *__pyx_tuple__983; -static PyObject *__pyx_tuple__984; -static PyObject *__pyx_tuple__985; -static PyObject *__pyx_tuple__986; -static PyObject *__pyx_tuple__987; -static PyObject *__pyx_tuple__988; -static PyObject *__pyx_tuple__989; -static PyObject *__pyx_tuple__990; -static PyObject *__pyx_tuple__991; -static PyObject *__pyx_tuple__992; -static PyObject *__pyx_tuple__993; -static PyObject *__pyx_tuple__994; -static PyObject *__pyx_tuple__995; -static PyObject *__pyx_tuple__996; -static PyObject *__pyx_tuple__997; -static PyObject *__pyx_tuple__998; -static PyObject *__pyx_tuple__999; -static PyObject *__pyx_tuple__1000; -static PyObject *__pyx_tuple__1001; -static PyObject *__pyx_tuple__1002; -static PyObject *__pyx_tuple__1003; -static PyObject *__pyx_tuple__1004; -static PyObject *__pyx_tuple__1005; -static PyObject *__pyx_tuple__1006; -static PyObject *__pyx_tuple__1007; -static PyObject *__pyx_tuple__1008; -static PyObject *__pyx_tuple__1009; -static PyObject *__pyx_tuple__1010; -static PyObject *__pyx_tuple__1011; -static PyObject *__pyx_tuple__1012; -static PyObject *__pyx_tuple__1013; -static PyObject *__pyx_tuple__1014; -static PyObject *__pyx_tuple__1015; -static PyObject *__pyx_tuple__1016; -static PyObject *__pyx_tuple__1017; -static PyObject *__pyx_tuple__1018; -static PyObject *__pyx_tuple__1019; -static PyObject *__pyx_tuple__1020; -static PyObject *__pyx_tuple__1021; -static PyObject *__pyx_tuple__1022; -static PyObject *__pyx_tuple__1023; -static PyObject *__pyx_tuple__1024; -static PyObject *__pyx_tuple__1025; -static PyObject *__pyx_tuple__1026; -static PyObject *__pyx_tuple__1027; -static PyObject *__pyx_tuple__1028; -static PyObject *__pyx_tuple__1029; -static PyObject *__pyx_tuple__1030; -static PyObject *__pyx_tuple__1031; -static PyObject *__pyx_tuple__1032; -static PyObject *__pyx_tuple__1033; -static PyObject *__pyx_tuple__1034; -static PyObject *__pyx_tuple__1035; -static PyObject *__pyx_tuple__1036; -static PyObject *__pyx_tuple__1037; -static PyObject *__pyx_tuple__1038; -static PyObject *__pyx_tuple__1039; -static PyObject *__pyx_tuple__1040; -static PyObject *__pyx_tuple__1041; -static PyObject *__pyx_tuple__1042; -static PyObject *__pyx_tuple__1043; -static PyObject *__pyx_tuple__1044; -static PyObject *__pyx_tuple__1045; -static PyObject *__pyx_tuple__1046; -static PyObject *__pyx_tuple__1047; -static PyObject *__pyx_tuple__1048; -static PyObject *__pyx_tuple__1049; -static PyObject *__pyx_tuple__1050; -static PyObject *__pyx_tuple__1051; -static PyObject *__pyx_tuple__1052; -static PyObject *__pyx_tuple__1053; -static PyObject *__pyx_tuple__1054; -static PyObject *__pyx_tuple__1055; -static PyObject *__pyx_tuple__1057; -static PyObject *__pyx_tuple__1059; -static PyObject *__pyx_tuple__1061; -static PyObject *__pyx_tuple__1063; -static PyObject *__pyx_tuple__1065; -static PyObject *__pyx_tuple__1067; -static PyObject *__pyx_tuple__1069; -static PyObject *__pyx_tuple__1071; -static PyObject *__pyx_tuple__1073; -static PyObject *__pyx_tuple__1075; -static PyObject *__pyx_tuple__1077; -static PyObject *__pyx_tuple__1079; -static PyObject *__pyx_tuple__1081; -static PyObject *__pyx_tuple__1083; -static PyObject *__pyx_tuple__1085; -static PyObject *__pyx_tuple__1087; -static PyObject *__pyx_tuple__1089; -static PyObject *__pyx_tuple__1091; -static PyObject *__pyx_tuple__1093; -static PyObject *__pyx_tuple__1095; -static PyObject *__pyx_tuple__1097; -static PyObject *__pyx_tuple__1099; -static PyObject *__pyx_tuple__1101; -static PyObject *__pyx_tuple__1103; -static PyObject *__pyx_tuple__1105; -static PyObject *__pyx_tuple__1107; -static PyObject *__pyx_tuple__1109; -static PyObject *__pyx_tuple__1111; -static PyObject *__pyx_tuple__1113; -static PyObject *__pyx_tuple__1115; -static PyObject *__pyx_tuple__1117; -static PyObject *__pyx_tuple__1119; -static PyObject *__pyx_tuple__1121; -static PyObject *__pyx_tuple__1123; -static PyObject *__pyx_tuple__1125; -static PyObject *__pyx_tuple__1127; -static PyObject *__pyx_tuple__1129; -static PyObject *__pyx_tuple__1131; -static PyObject *__pyx_tuple__1133; -static PyObject *__pyx_tuple__1135; -static PyObject *__pyx_tuple__1137; -static PyObject *__pyx_tuple__1139; -static PyObject *__pyx_tuple__1141; -static PyObject *__pyx_tuple__1143; -static PyObject *__pyx_tuple__1145; -static PyObject *__pyx_tuple__1147; -static PyObject *__pyx_tuple__1149; -static PyObject *__pyx_tuple__1151; -static PyObject *__pyx_tuple__1153; -static PyObject *__pyx_tuple__1155; -static PyObject *__pyx_tuple__1157; -static PyObject *__pyx_tuple__1159; -static PyObject *__pyx_tuple__1161; -static PyObject *__pyx_tuple__1163; -static PyObject *__pyx_tuple__1165; -static PyObject *__pyx_tuple__1167; -static PyObject *__pyx_tuple__1169; -static PyObject *__pyx_tuple__1171; -static PyObject *__pyx_tuple__1173; -static PyObject *__pyx_tuple__1175; -static PyObject *__pyx_tuple__1177; -static PyObject *__pyx_tuple__1179; -static PyObject *__pyx_tuple__1181; -static PyObject *__pyx_tuple__1183; -static PyObject *__pyx_tuple__1185; -static PyObject *__pyx_tuple__1187; -static PyObject *__pyx_tuple__1189; -static PyObject *__pyx_tuple__1191; -static PyObject *__pyx_tuple__1193; -static PyObject *__pyx_tuple__1195; -static PyObject *__pyx_tuple__1197; -static PyObject *__pyx_tuple__1199; -static PyObject *__pyx_tuple__1201; -static PyObject *__pyx_tuple__1203; -static PyObject *__pyx_tuple__1205; -static PyObject *__pyx_tuple__1207; -static PyObject *__pyx_tuple__1209; -static PyObject *__pyx_tuple__1211; -static PyObject *__pyx_tuple__1213; -static PyObject *__pyx_tuple__1215; -static PyObject *__pyx_tuple__1217; -static PyObject *__pyx_tuple__1219; -static PyObject *__pyx_tuple__1221; -static PyObject *__pyx_tuple__1223; -static PyObject *__pyx_tuple__1225; -static PyObject *__pyx_tuple__1227; -static PyObject *__pyx_tuple__1229; -static PyObject *__pyx_tuple__1231; -static PyObject *__pyx_tuple__1233; -static PyObject *__pyx_tuple__1235; -static PyObject *__pyx_tuple__1237; -static PyObject *__pyx_tuple__1239; -static PyObject *__pyx_tuple__1241; -static PyObject *__pyx_tuple__1243; -static PyObject *__pyx_tuple__1245; -static PyObject *__pyx_tuple__1247; -static PyObject *__pyx_tuple__1249; -static PyObject *__pyx_tuple__1251; -static PyObject *__pyx_tuple__1253; -static PyObject *__pyx_tuple__1255; -static PyObject *__pyx_tuple__1257; -static PyObject *__pyx_tuple__1259; -static PyObject *__pyx_tuple__1261; -static PyObject *__pyx_tuple__1263; -static PyObject *__pyx_tuple__1265; -static PyObject *__pyx_tuple__1267; -static PyObject *__pyx_tuple__1269; -static PyObject *__pyx_tuple__1271; -static PyObject *__pyx_tuple__1273; -static PyObject *__pyx_tuple__1275; -static PyObject *__pyx_tuple__1277; -static PyObject *__pyx_tuple__1279; -static PyObject *__pyx_tuple__1281; -static PyObject *__pyx_tuple__1283; -static PyObject *__pyx_tuple__1285; -static PyObject *__pyx_tuple__1287; -static PyObject *__pyx_tuple__1289; -static PyObject *__pyx_tuple__1291; -static PyObject *__pyx_tuple__1293; -static PyObject *__pyx_tuple__1295; -static PyObject *__pyx_tuple__1297; -static PyObject *__pyx_tuple__1299; -static PyObject *__pyx_tuple__1301; -static PyObject *__pyx_tuple__1303; -static PyObject *__pyx_tuple__1305; -static PyObject *__pyx_tuple__1307; -static PyObject *__pyx_tuple__1309; -static PyObject *__pyx_tuple__1311; -static PyObject *__pyx_tuple__1313; -static PyObject *__pyx_tuple__1315; -static PyObject *__pyx_tuple__1317; -static PyObject *__pyx_tuple__1319; -static PyObject *__pyx_tuple__1321; -static PyObject *__pyx_tuple__1323; -static PyObject *__pyx_tuple__1325; -static PyObject *__pyx_tuple__1327; -static PyObject *__pyx_tuple__1329; -static PyObject *__pyx_tuple__1331; -static PyObject *__pyx_tuple__1333; -static PyObject *__pyx_tuple__1335; -static PyObject *__pyx_tuple__1337; -static PyObject *__pyx_tuple__1339; -static PyObject *__pyx_tuple__1341; -static PyObject *__pyx_tuple__1343; -static PyObject *__pyx_tuple__1345; -static PyObject *__pyx_tuple__1347; -static PyObject *__pyx_tuple__1349; -static PyObject *__pyx_tuple__1351; -static PyObject *__pyx_tuple__1353; -static PyObject *__pyx_tuple__1355; -static PyObject *__pyx_tuple__1357; -static PyObject *__pyx_tuple__1359; -static PyObject *__pyx_tuple__1361; -static PyObject *__pyx_tuple__1363; -static PyObject *__pyx_tuple__1365; -static PyObject *__pyx_tuple__1367; -static PyObject *__pyx_tuple__1369; -static PyObject *__pyx_codeobj__1056; -static PyObject *__pyx_codeobj__1058; -static PyObject *__pyx_codeobj__1060; -static PyObject *__pyx_codeobj__1062; -static PyObject *__pyx_codeobj__1064; -static PyObject *__pyx_codeobj__1066; -static PyObject *__pyx_codeobj__1068; -static PyObject *__pyx_codeobj__1070; -static PyObject *__pyx_codeobj__1072; -static PyObject *__pyx_codeobj__1074; -static PyObject *__pyx_codeobj__1076; -static PyObject *__pyx_codeobj__1078; -static PyObject *__pyx_codeobj__1080; -static PyObject *__pyx_codeobj__1082; -static PyObject *__pyx_codeobj__1084; -static PyObject *__pyx_codeobj__1086; -static PyObject *__pyx_codeobj__1088; -static PyObject *__pyx_codeobj__1090; -static PyObject *__pyx_codeobj__1092; -static PyObject *__pyx_codeobj__1094; -static PyObject *__pyx_codeobj__1096; -static PyObject *__pyx_codeobj__1098; -static PyObject *__pyx_codeobj__1100; -static PyObject *__pyx_codeobj__1102; -static PyObject *__pyx_codeobj__1104; -static PyObject *__pyx_codeobj__1106; -static PyObject *__pyx_codeobj__1108; -static PyObject *__pyx_codeobj__1110; -static PyObject *__pyx_codeobj__1112; -static PyObject *__pyx_codeobj__1114; -static PyObject *__pyx_codeobj__1116; -static PyObject *__pyx_codeobj__1118; -static PyObject *__pyx_codeobj__1120; -static PyObject *__pyx_codeobj__1122; -static PyObject *__pyx_codeobj__1124; -static PyObject *__pyx_codeobj__1126; -static PyObject *__pyx_codeobj__1128; -static PyObject *__pyx_codeobj__1130; -static PyObject *__pyx_codeobj__1132; -static PyObject *__pyx_codeobj__1134; -static PyObject *__pyx_codeobj__1136; -static PyObject *__pyx_codeobj__1138; -static PyObject *__pyx_codeobj__1140; -static PyObject *__pyx_codeobj__1142; -static PyObject *__pyx_codeobj__1144; -static PyObject *__pyx_codeobj__1146; -static PyObject *__pyx_codeobj__1148; -static PyObject *__pyx_codeobj__1150; -static PyObject *__pyx_codeobj__1152; -static PyObject *__pyx_codeobj__1154; -static PyObject *__pyx_codeobj__1156; -static PyObject *__pyx_codeobj__1158; -static PyObject *__pyx_codeobj__1160; -static PyObject *__pyx_codeobj__1162; -static PyObject *__pyx_codeobj__1164; -static PyObject *__pyx_codeobj__1166; -static PyObject *__pyx_codeobj__1168; -static PyObject *__pyx_codeobj__1170; -static PyObject *__pyx_codeobj__1172; -static PyObject *__pyx_codeobj__1174; -static PyObject *__pyx_codeobj__1176; -static PyObject *__pyx_codeobj__1178; -static PyObject *__pyx_codeobj__1180; -static PyObject *__pyx_codeobj__1182; -static PyObject *__pyx_codeobj__1184; -static PyObject *__pyx_codeobj__1186; -static PyObject *__pyx_codeobj__1188; -static PyObject *__pyx_codeobj__1190; -static PyObject *__pyx_codeobj__1192; -static PyObject *__pyx_codeobj__1194; -static PyObject *__pyx_codeobj__1196; -static PyObject *__pyx_codeobj__1198; -static PyObject *__pyx_codeobj__1200; -static PyObject *__pyx_codeobj__1202; -static PyObject *__pyx_codeobj__1204; -static PyObject *__pyx_codeobj__1206; -static PyObject *__pyx_codeobj__1208; -static PyObject *__pyx_codeobj__1210; -static PyObject *__pyx_codeobj__1212; -static PyObject *__pyx_codeobj__1214; -static PyObject *__pyx_codeobj__1216; -static PyObject *__pyx_codeobj__1218; -static PyObject *__pyx_codeobj__1220; -static PyObject *__pyx_codeobj__1222; -static PyObject *__pyx_codeobj__1224; -static PyObject *__pyx_codeobj__1226; -static PyObject *__pyx_codeobj__1228; -static PyObject *__pyx_codeobj__1230; -static PyObject *__pyx_codeobj__1232; -static PyObject *__pyx_codeobj__1234; -static PyObject *__pyx_codeobj__1236; -static PyObject *__pyx_codeobj__1238; -static PyObject *__pyx_codeobj__1240; -static PyObject *__pyx_codeobj__1242; -static PyObject *__pyx_codeobj__1244; -static PyObject *__pyx_codeobj__1246; -static PyObject *__pyx_codeobj__1248; -static PyObject *__pyx_codeobj__1250; -static PyObject *__pyx_codeobj__1252; -static PyObject *__pyx_codeobj__1254; -static PyObject *__pyx_codeobj__1256; -static PyObject *__pyx_codeobj__1258; -static PyObject *__pyx_codeobj__1260; -static PyObject *__pyx_codeobj__1262; -static PyObject *__pyx_codeobj__1264; -static PyObject *__pyx_codeobj__1266; -static PyObject *__pyx_codeobj__1268; -static PyObject *__pyx_codeobj__1270; -static PyObject *__pyx_codeobj__1272; -static PyObject *__pyx_codeobj__1274; -static PyObject *__pyx_codeobj__1276; -static PyObject *__pyx_codeobj__1278; -static PyObject *__pyx_codeobj__1280; -static PyObject *__pyx_codeobj__1282; -static PyObject *__pyx_codeobj__1284; -static PyObject *__pyx_codeobj__1286; -static PyObject *__pyx_codeobj__1288; -static PyObject *__pyx_codeobj__1290; -static PyObject *__pyx_codeobj__1292; -static PyObject *__pyx_codeobj__1294; -static PyObject *__pyx_codeobj__1296; -static PyObject *__pyx_codeobj__1298; -static PyObject *__pyx_codeobj__1300; -static PyObject *__pyx_codeobj__1302; -static PyObject *__pyx_codeobj__1304; -static PyObject *__pyx_codeobj__1306; -static PyObject *__pyx_codeobj__1308; -static PyObject *__pyx_codeobj__1310; -static PyObject *__pyx_codeobj__1312; -static PyObject *__pyx_codeobj__1314; -static PyObject *__pyx_codeobj__1316; -static PyObject *__pyx_codeobj__1318; -static PyObject *__pyx_codeobj__1320; -static PyObject *__pyx_codeobj__1322; -static PyObject *__pyx_codeobj__1324; -static PyObject *__pyx_codeobj__1326; -static PyObject *__pyx_codeobj__1328; -static PyObject *__pyx_codeobj__1330; -static PyObject *__pyx_codeobj__1332; -static PyObject *__pyx_codeobj__1334; -static PyObject *__pyx_codeobj__1336; -static PyObject *__pyx_codeobj__1338; -static PyObject *__pyx_codeobj__1340; -static PyObject *__pyx_codeobj__1342; -static PyObject *__pyx_codeobj__1344; -static PyObject *__pyx_codeobj__1346; -static PyObject *__pyx_codeobj__1348; -static PyObject *__pyx_codeobj__1350; -static PyObject *__pyx_codeobj__1352; -static PyObject *__pyx_codeobj__1354; -static PyObject *__pyx_codeobj__1356; -static PyObject *__pyx_codeobj__1358; -static PyObject *__pyx_codeobj__1360; -static PyObject *__pyx_codeobj__1362; -static PyObject *__pyx_codeobj__1364; -static PyObject *__pyx_codeobj__1366; -static PyObject *__pyx_codeobj__1368; -static PyObject *__pyx_codeobj__1370; - -/* "talib/stream.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_1ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_ACOS[] = " ACOS(real)\n\n Vector Trigonometric ACos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_1ACOS = {"ACOS", (PyCFunction)__pyx_pw_5talib_6stream_1ACOS, METH_O, __pyx_doc_5talib_6stream_ACOS}; -static PyObject *__pyx_pw_5talib_6stream_1ACOS(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ACOS (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_ACOS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_ACOS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ACOS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":43 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":44 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 44, __pyx_L1_error) - - /* "talib/stream.pyx":43 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":45 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":46 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 46, __pyx_L1_error) - - /* "talib/stream.pyx":45 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":47 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":48 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":47 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":49 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":50 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":51 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ACOS", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":52 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ACOS", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ACOS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":53 - * outreal = NaN - * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ACOS", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ACOS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":54 - * retCode = lib.TA_ACOS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ACOS", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ACOS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":58 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_3AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_2AD[] = " AD(high, low, close, volume)\n\n Chaikin A/D Line (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_3AD = {"AD", (PyCFunction)__pyx_pw_5talib_6stream_3AD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_2AD}; -static PyObject *__pyx_pw_5talib_6stream_3AD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 1); __PYX_ERR(0, 58, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 2); __PYX_ERR(0, 58, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, 3); __PYX_ERR(0, 58, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AD") < 0)) __PYX_ERR(0, 58, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 58, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_2AD(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_2AD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("AD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/stream.pyx":80 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":81 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 81, __pyx_L1_error) - - /* "talib/stream.pyx":80 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":82 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":83 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 83, __pyx_L1_error) - - /* "talib/stream.pyx":82 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":84 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":85 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":84 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":86 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":87 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":88 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 88, __pyx_L1_error) - - /* "talib/stream.pyx":87 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":89 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":90 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 90, __pyx_L1_error) - - /* "talib/stream.pyx":89 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":91 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":92 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":91 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":93 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":94 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":95 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 95, __pyx_L1_error) - - /* "talib/stream.pyx":94 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":96 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":97 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 97, __pyx_L1_error) - - /* "talib/stream.pyx":96 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":98 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":99 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":98 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":100 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":101 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":102 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 102, __pyx_L1_error) - - /* "talib/stream.pyx":101 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/stream.pyx":103 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":104 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 104, __pyx_L1_error) - - /* "talib/stream.pyx":103 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":105 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":106 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":105 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/stream.pyx":107 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/stream.pyx":108 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":109 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":110 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 110, __pyx_L1_error) - - /* "talib/stream.pyx":109 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":111 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":112 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 112, __pyx_L1_error) - - /* "talib/stream.pyx":111 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/stream.pyx":113 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":114 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 114, __pyx_L1_error) - - /* "talib/stream.pyx":113 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":115 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AD", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":116 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":117 - * outreal = NaN - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":118 - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":58 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.AD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_5ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_4ADD[] = " ADD(real0, real1)\n\n Vector Arithmetic Add (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_5ADD = {"ADD", (PyCFunction)__pyx_pw_5talib_6stream_5ADD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_4ADD}; -static PyObject *__pyx_pw_5talib_6stream_5ADD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, 1); __PYX_ERR(0, 122, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADD") < 0)) __PYX_ERR(0, 122, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADD", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 122, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 122, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_4ADD(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_4ADD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ADD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":143 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":144 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 144, __pyx_L1_error) - - /* "talib/stream.pyx":143 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":145 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":146 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 146, __pyx_L1_error) - - /* "talib/stream.pyx":145 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":147 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":148 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":147 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":149 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":150 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":151 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 151, __pyx_L1_error) - - /* "talib/stream.pyx":150 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":152 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":153 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 153, __pyx_L1_error) - - /* "talib/stream.pyx":152 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":154 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":155 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":154 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":156 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":157 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":158 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":159 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 159, __pyx_L1_error) - - /* "talib/stream.pyx":158 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":160 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADD", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":161 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":162 - * outreal = NaN - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":163 - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ADD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":167 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_7ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_6ADOSC[] = " ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?])\n\n Chaikin A/D Oscillator (Volume Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n fastperiod: 3\n slowperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_7ADOSC = {"ADOSC", (PyCFunction)__pyx_pw_5talib_6stream_7ADOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_6ADOSC}; -static PyObject *__pyx_pw_5talib_6stream_7ADOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 1); __PYX_ERR(0, 167, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 2); __PYX_ERR(0, 167, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, 3); __PYX_ERR(0, 167, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADOSC") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADOSC", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 167, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 167, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 167, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 167, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 167, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_6ADOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_fastperiod, __pyx_v_slowperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_6ADOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_fastperiod, int __pyx_v_slowperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ADOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/stream.pyx":192 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":193 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 193, __pyx_L1_error) - - /* "talib/stream.pyx":192 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":194 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":195 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 195, __pyx_L1_error) - - /* "talib/stream.pyx":194 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":196 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":197 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":196 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":198 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":199 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":200 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 200, __pyx_L1_error) - - /* "talib/stream.pyx":199 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":201 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":202 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 202, __pyx_L1_error) - - /* "talib/stream.pyx":201 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":203 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":204 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":203 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":205 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":206 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":207 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 207, __pyx_L1_error) - - /* "talib/stream.pyx":206 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":208 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":209 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 209, __pyx_L1_error) - - /* "talib/stream.pyx":208 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":210 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":211 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":210 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":212 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":213 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":214 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 214, __pyx_L1_error) - - /* "talib/stream.pyx":213 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/stream.pyx":215 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":216 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 216, __pyx_L1_error) - - /* "talib/stream.pyx":215 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":217 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":218 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":217 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/stream.pyx":219 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/stream.pyx":220 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":221 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":222 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 222, __pyx_L1_error) - - /* "talib/stream.pyx":221 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":223 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":224 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 224, __pyx_L1_error) - - /* "talib/stream.pyx":223 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/stream.pyx":225 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":226 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 226, __pyx_L1_error) - - /* "talib/stream.pyx":225 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":227 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADOSC", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":228 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, __pyx_v_fastperiod, __pyx_v_slowperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":229 - * outreal = NaN - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":230 - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":167 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ADOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":234 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_9ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_8ADX[] = " ADX(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_9ADX = {"ADX", (PyCFunction)__pyx_pw_5talib_6stream_9ADX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_8ADX}; -static PyObject *__pyx_pw_5talib_6stream_9ADX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 1); __PYX_ERR(0, 234, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, 2); __PYX_ERR(0, 234, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADX") < 0)) __PYX_ERR(0, 234, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 234, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 234, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 234, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 234, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_8ADX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_8ADX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ADX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":257 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":258 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 258, __pyx_L1_error) - - /* "talib/stream.pyx":257 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":259 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":260 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 260, __pyx_L1_error) - - /* "talib/stream.pyx":259 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":261 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":262 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":261 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":263 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":264 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":265 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 265, __pyx_L1_error) - - /* "talib/stream.pyx":264 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":266 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":267 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 267, __pyx_L1_error) - - /* "talib/stream.pyx":266 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":268 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":269 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":268 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":270 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":271 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":272 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 272, __pyx_L1_error) - - /* "talib/stream.pyx":271 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":273 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":274 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 274, __pyx_L1_error) - - /* "talib/stream.pyx":273 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":275 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":276 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":275 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":277 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":278 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":279 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":280 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 280, __pyx_L1_error) - - /* "talib/stream.pyx":279 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":281 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":282 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 282, __pyx_L1_error) - - /* "talib/stream.pyx":281 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":283 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADX", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":284 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":285 - * outreal = NaN - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":286 - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":234 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ADX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":290 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_11ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_10ADXR[] = " ADXR(high, low, close[, timeperiod=?])\n\n Average Directional Movement Index Rating (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_11ADXR = {"ADXR", (PyCFunction)__pyx_pw_5talib_6stream_11ADXR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_10ADXR}; -static PyObject *__pyx_pw_5talib_6stream_11ADXR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ADXR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 1); __PYX_ERR(0, 290, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, 2); __PYX_ERR(0, 290, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ADXR") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ADXR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 290, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 290, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 290, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_10ADXR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_10ADXR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ADXR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":313 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":314 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 314, __pyx_L1_error) - - /* "talib/stream.pyx":313 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":315 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":316 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 316, __pyx_L1_error) - - /* "talib/stream.pyx":315 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":317 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":318 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":317 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":319 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":320 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":321 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 321, __pyx_L1_error) - - /* "talib/stream.pyx":320 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":322 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":323 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 323, __pyx_L1_error) - - /* "talib/stream.pyx":322 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":324 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":325 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":324 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":326 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":327 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":328 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 328, __pyx_L1_error) - - /* "talib/stream.pyx":327 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":329 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":330 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 330, __pyx_L1_error) - - /* "talib/stream.pyx":329 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":331 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":332 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":331 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":333 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":334 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":335 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":336 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 336, __pyx_L1_error) - - /* "talib/stream.pyx":335 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":337 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":338 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 338, __pyx_L1_error) - - /* "talib/stream.pyx":337 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":339 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADXR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":340 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ADXR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ADXR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":341 - * outreal = NaN - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADXR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ADXR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":342 - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ADXR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":290 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ADXR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_13APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_12APO[] = " APO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Absolute Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_13APO = {"APO", (PyCFunction)__pyx_pw_5talib_6stream_13APO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_12APO}; -static PyObject *__pyx_pw_5talib_6stream_13APO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("APO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "APO") < 0)) __PYX_ERR(0, 346, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("APO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 346, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 346, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_12APO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_12APO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("APO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":369 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":370 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 370, __pyx_L1_error) - - /* "talib/stream.pyx":369 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":371 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":372 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 372, __pyx_L1_error) - - /* "talib/stream.pyx":371 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":373 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":374 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":373 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":375 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":376 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":377 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_APO", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":378 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_APO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_APO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":379 - * outreal = NaN - * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_APO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_APO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":380 - * retCode = lib.TA_APO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_APO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.APO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":384 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_15AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_14AROON[] = " AROON(high, low[, timeperiod=?])\n\n Aroon (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n aroondown\n aroonup\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_15AROON = {"AROON", (PyCFunction)__pyx_pw_5talib_6stream_15AROON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_14AROON}; -static PyObject *__pyx_pw_5talib_6stream_15AROON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AROON (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, 1); __PYX_ERR(0, 384, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROON") < 0)) __PYX_ERR(0, 384, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AROON", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 384, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 384, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 384, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_14AROON(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_14AROON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outaroondown; - double __pyx_v_outaroonup; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("AROON", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":408 - * double outaroondown - * double outaroonup - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":409 - * double outaroonup - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 409, __pyx_L1_error) - - /* "talib/stream.pyx":408 - * double outaroondown - * double outaroonup - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":410 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":411 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 411, __pyx_L1_error) - - /* "talib/stream.pyx":410 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":412 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":413 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":412 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":414 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":415 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":416 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 416, __pyx_L1_error) - - /* "talib/stream.pyx":415 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":417 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":418 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 418, __pyx_L1_error) - - /* "talib/stream.pyx":417 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":419 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":420 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 420, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":419 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":421 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":422 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":423 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outaroondown = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":424 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outaroondown = NaN - * outaroonup = NaN - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 424, __pyx_L1_error) - - /* "talib/stream.pyx":423 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outaroondown = NaN - */ - } - - /* "talib/stream.pyx":425 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outaroondown = NaN # <<<<<<<<<<<<<< - * outaroonup = NaN - * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) - */ - __pyx_v_outaroondown = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":426 - * raise Exception("input lengths are different") - * outaroondown = NaN - * outaroonup = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) - * _ta_check_success("TA_AROON", retCode) - */ - __pyx_v_outaroonup = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":427 - * outaroondown = NaN - * outaroonup = NaN - * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AROON", retCode) - * return outaroondown , outaroonup - */ - __pyx_v_retCode = TA_AROON((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outaroondown), (&__pyx_v_outaroonup)); - - /* "talib/stream.pyx":428 - * outaroonup = NaN - * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) - * _ta_check_success("TA_AROON", retCode) # <<<<<<<<<<<<<< - * return outaroondown , outaroonup - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AROON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":429 - * retCode = lib.TA_AROON( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outaroondown , &outaroonup ) - * _ta_check_success("TA_AROON", retCode) - * return outaroondown , outaroonup # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outaroondown); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outaroonup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":384 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.AROON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_17AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_16AROONOSC[] = " AROONOSC(high, low[, timeperiod=?])\n\n Aroon Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_17AROONOSC = {"AROONOSC", (PyCFunction)__pyx_pw_5talib_6stream_17AROONOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_16AROONOSC}; -static PyObject *__pyx_pw_5talib_6stream_17AROONOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AROONOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, 1); __PYX_ERR(0, 433, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AROONOSC") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AROONOSC", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 433, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 433, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 433, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_16AROONOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_16AROONOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("AROONOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":455 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":456 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) - - /* "talib/stream.pyx":455 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":457 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":458 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 458, __pyx_L1_error) - - /* "talib/stream.pyx":457 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":459 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":460 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 460, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":459 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":461 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":462 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":463 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 463, __pyx_L1_error) - - /* "talib/stream.pyx":462 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":464 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":465 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 465, __pyx_L1_error) - - /* "talib/stream.pyx":464 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":466 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":467 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":466 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":468 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":469 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":470 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":471 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 471, __pyx_L1_error) - - /* "talib/stream.pyx":470 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":472 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AROONOSC", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":473 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AROONOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AROONOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":474 - * outreal = NaN - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AROONOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AROONOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":475 - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AROONOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.AROONOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":479 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_19ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_18ASIN[] = " ASIN(real)\n\n Vector Trigonometric ASin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_19ASIN = {"ASIN", (PyCFunction)__pyx_pw_5talib_6stream_19ASIN, METH_O, __pyx_doc_5talib_6stream_18ASIN}; -static PyObject *__pyx_pw_5talib_6stream_19ASIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ASIN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_18ASIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_18ASIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ASIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":498 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":499 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 499, __pyx_L1_error) - - /* "talib/stream.pyx":498 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":500 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":501 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 501, __pyx_L1_error) - - /* "talib/stream.pyx":500 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":502 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":503 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":502 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":504 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":505 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":506 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ASIN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":507 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ASIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ASIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":508 - * outreal = NaN - * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ASIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ASIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":509 - * retCode = lib.TA_ASIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ASIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":479 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ASIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":513 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_21ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_20ATAN[] = " ATAN(real)\n\n Vector Trigonometric ATan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_21ATAN = {"ATAN", (PyCFunction)__pyx_pw_5talib_6stream_21ATAN, METH_O, __pyx_doc_5talib_6stream_20ATAN}; -static PyObject *__pyx_pw_5talib_6stream_21ATAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ATAN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_20ATAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_20ATAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ATAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":532 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":533 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 533, __pyx_L1_error) - - /* "talib/stream.pyx":532 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":534 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":535 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 535, __pyx_L1_error) - - /* "talib/stream.pyx":534 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":536 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":537 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":536 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":538 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":539 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":540 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATAN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":541 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ATAN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ATAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":542 - * outreal = NaN - * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATAN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ATAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":543 - * retCode = lib.TA_ATAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATAN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":513 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ATAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":547 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_23ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_22ATR[] = " ATR(high, low, close[, timeperiod=?])\n\n Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_23ATR = {"ATR", (PyCFunction)__pyx_pw_5talib_6stream_23ATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_22ATR}; -static PyObject *__pyx_pw_5talib_6stream_23ATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ATR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, 2); __PYX_ERR(0, 547, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ATR") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 547, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 547, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_22ATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_22ATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ATR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":570 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":571 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 571, __pyx_L1_error) - - /* "talib/stream.pyx":570 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":572 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":573 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 573, __pyx_L1_error) - - /* "talib/stream.pyx":572 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":574 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":575 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":574 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":576 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":577 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":578 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 578, __pyx_L1_error) - - /* "talib/stream.pyx":577 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":579 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":580 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 580, __pyx_L1_error) - - /* "talib/stream.pyx":579 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":581 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":582 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":581 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":583 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":584 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":585 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 585, __pyx_L1_error) - - /* "talib/stream.pyx":584 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":586 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":587 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 587, __pyx_L1_error) - - /* "talib/stream.pyx":586 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":588 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":589 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":588 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":590 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":591 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":592 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":593 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 593, __pyx_L1_error) - - /* "talib/stream.pyx":592 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":594 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":595 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 595, __pyx_L1_error) - - /* "talib/stream.pyx":594 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":596 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":597 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ATR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ATR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":598 - * outreal = NaN - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":599 - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ATR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":547 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":603 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_25AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_24AVGPRICE[] = " AVGPRICE(open, high, low, close)\n\n Average Price (Price Transform)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_25AVGPRICE = {"AVGPRICE", (PyCFunction)__pyx_pw_5talib_6stream_25AVGPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_24AVGPRICE}; -static PyObject *__pyx_pw_5talib_6stream_25AVGPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("AVGPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 1); __PYX_ERR(0, 603, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 2); __PYX_ERR(0, 603, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, 3); __PYX_ERR(0, 603, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AVGPRICE") < 0)) __PYX_ERR(0, 603, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("AVGPRICE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 603, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 603, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_24AVGPRICE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_24AVGPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("AVGPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":625 - * int outnbelement - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":626 - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 626, __pyx_L1_error) - - /* "talib/stream.pyx":625 - * int outnbelement - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":627 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":628 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 628, __pyx_L1_error) - - /* "talib/stream.pyx":627 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":629 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":630 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":629 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":631 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":632 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":633 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 633, __pyx_L1_error) - - /* "talib/stream.pyx":632 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":634 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":635 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 635, __pyx_L1_error) - - /* "talib/stream.pyx":634 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":636 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":637 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":636 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":638 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":639 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":640 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 640, __pyx_L1_error) - - /* "talib/stream.pyx":639 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":641 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":642 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 642, __pyx_L1_error) - - /* "talib/stream.pyx":641 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":643 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":644 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":643 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":645 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":646 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":647 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 647, __pyx_L1_error) - - /* "talib/stream.pyx":646 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":648 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":649 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 649, __pyx_L1_error) - - /* "talib/stream.pyx":648 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":650 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":651 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":650 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":652 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":653 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":654 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":655 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 655, __pyx_L1_error) - - /* "talib/stream.pyx":654 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":656 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":657 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 657, __pyx_L1_error) - - /* "talib/stream.pyx":656 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":658 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":659 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 659, __pyx_L1_error) - - /* "talib/stream.pyx":658 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":660 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AVGPRICE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":661 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_AVGPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_AVGPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":662 - * outreal = NaN - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AVGPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_AVGPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":663 - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_AVGPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":603 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.AVGPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":667 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_27BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_26BBANDS[] = " BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?])\n\n Bollinger Bands (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdevup: 2\n nbdevdn: 2\n matype: 0 (Simple Moving Average)\n Outputs:\n upperband\n middleband\n lowerband\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_27BBANDS = {"BBANDS", (PyCFunction)__pyx_pw_5talib_6stream_27BBANDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_26BBANDS}; -static PyObject *__pyx_pw_5talib_6stream_27BBANDS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdevup; - double __pyx_v_nbdevdn; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BBANDS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdevup,&__pyx_n_s_nbdevdn,&__pyx_n_s_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevup); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdevdn); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BBANDS") < 0)) __PYX_ERR(0, 667, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdevup = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdevup == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) - } else { - __pyx_v_nbdevup = ((double)-4e37); - } - if (values[3]) { - __pyx_v_nbdevdn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_nbdevdn == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) - } else { - __pyx_v_nbdevdn = ((double)-4e37); - } - if (values[4]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BBANDS", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 667, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_26BBANDS(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_26BBANDS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdevup, double __pyx_v_nbdevdn, int __pyx_v_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outrealupperband; - double __pyx_v_outrealmiddleband; - double __pyx_v_outreallowerband; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("BBANDS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":695 - * double outrealmiddleband - * double outreallowerband - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":696 - * double outreallowerband - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 696, __pyx_L1_error) - - /* "talib/stream.pyx":695 - * double outrealmiddleband - * double outreallowerband - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":697 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":698 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 698, __pyx_L1_error) - - /* "talib/stream.pyx":697 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":699 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":700 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":699 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":701 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outrealupperband = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":702 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outrealupperband = NaN - * outrealmiddleband = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":703 - * real_data = real.data - * length = real.shape[0] - * outrealupperband = NaN # <<<<<<<<<<<<<< - * outrealmiddleband = NaN - * outreallowerband = NaN - */ - __pyx_v_outrealupperband = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":704 - * length = real.shape[0] - * outrealupperband = NaN - * outrealmiddleband = NaN # <<<<<<<<<<<<<< - * outreallowerband = NaN - * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) - */ - __pyx_v_outrealmiddleband = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":705 - * outrealupperband = NaN - * outrealmiddleband = NaN - * outreallowerband = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) - * _ta_check_success("TA_BBANDS", retCode) - */ - __pyx_v_outreallowerband = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":706 - * outrealmiddleband = NaN - * outreallowerband = NaN - * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BBANDS", retCode) - * return outrealupperband , outrealmiddleband , outreallowerband - */ - __pyx_v_retCode = TA_BBANDS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdevup, __pyx_v_nbdevdn, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outrealupperband), (&__pyx_v_outrealmiddleband), (&__pyx_v_outreallowerband)); - - /* "talib/stream.pyx":707 - * outreallowerband = NaN - * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) - * _ta_check_success("TA_BBANDS", retCode) # <<<<<<<<<<<<<< - * return outrealupperband , outrealmiddleband , outreallowerband - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BBANDS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":708 - * retCode = lib.TA_BBANDS( length - 1 , length - 1 , real_data , timeperiod , nbdevup , nbdevdn , matype , &outbegidx , &outnbelement , &outrealupperband , &outrealmiddleband , &outreallowerband ) - * _ta_check_success("TA_BBANDS", retCode) - * return outrealupperband , outrealmiddleband , outreallowerband # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outrealupperband); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outrealmiddleband); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outreallowerband); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":667 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.stream.BBANDS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":712 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_29BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_28BETA[] = " BETA(real0, real1[, timeperiod=?])\n\n Beta (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 5\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_29BETA = {"BETA", (PyCFunction)__pyx_pw_5talib_6stream_29BETA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_28BETA}; -static PyObject *__pyx_pw_5talib_6stream_29BETA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BETA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, 1); __PYX_ERR(0, 712, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BETA") < 0)) __PYX_ERR(0, 712, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BETA", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 712, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 712, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 712, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_28BETA(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_28BETA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("BETA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":735 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":736 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 736, __pyx_L1_error) - - /* "talib/stream.pyx":735 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":737 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":738 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 738, __pyx_L1_error) - - /* "talib/stream.pyx":737 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":739 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":740 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":739 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":741 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":742 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":743 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 743, __pyx_L1_error) - - /* "talib/stream.pyx":742 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":744 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":745 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 745, __pyx_L1_error) - - /* "talib/stream.pyx":744 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":746 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":747 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":746 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":748 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":749 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":750 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":751 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 751, __pyx_L1_error) - - /* "talib/stream.pyx":750 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":752 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BETA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":753 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BETA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_BETA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":754 - * outreal = NaN - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BETA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BETA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":755 - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BETA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":712 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.BETA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":759 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_31BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_30BOP[] = " BOP(open, high, low, close)\n\n Balance Of Power (Momentum Indicators)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_31BOP = {"BOP", (PyCFunction)__pyx_pw_5talib_6stream_31BOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_30BOP}; -static PyObject *__pyx_pw_5talib_6stream_31BOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("BOP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 1); __PYX_ERR(0, 759, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 2); __PYX_ERR(0, 759, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, 3); __PYX_ERR(0, 759, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BOP") < 0)) __PYX_ERR(0, 759, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("BOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 759, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 759, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 759, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 759, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 759, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_30BOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_30BOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("BOP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":781 - * int outnbelement - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":782 - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 782, __pyx_L1_error) - - /* "talib/stream.pyx":781 - * int outnbelement - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":783 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":784 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 784, __pyx_L1_error) - - /* "talib/stream.pyx":783 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":785 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":786 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":785 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":787 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":788 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":789 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 789, __pyx_L1_error) - - /* "talib/stream.pyx":788 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":790 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":791 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 791, __pyx_L1_error) - - /* "talib/stream.pyx":790 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":792 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":793 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 793, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":792 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":794 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":795 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":796 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 796, __pyx_L1_error) - - /* "talib/stream.pyx":795 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":797 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":798 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 798, __pyx_L1_error) - - /* "talib/stream.pyx":797 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":799 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":800 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 800, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":799 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":801 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":802 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":803 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 803, __pyx_L1_error) - - /* "talib/stream.pyx":802 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":804 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":805 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 805, __pyx_L1_error) - - /* "talib/stream.pyx":804 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":806 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":807 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":806 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":808 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":809 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":810 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":811 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 811, __pyx_L1_error) - - /* "talib/stream.pyx":810 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":812 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":813 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 813, __pyx_L1_error) - - /* "talib/stream.pyx":812 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":814 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":815 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 815, __pyx_L1_error) - - /* "talib/stream.pyx":814 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":816 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BOP", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":817 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_BOP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_BOP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":818 - * outreal = NaN - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BOP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_BOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":819 - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_BOP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":759 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.BOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":823 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_33CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_32CCI[] = " CCI(high, low, close[, timeperiod=?])\n\n Commodity Channel Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_33CCI = {"CCI", (PyCFunction)__pyx_pw_5talib_6stream_33CCI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_32CCI}; -static PyObject *__pyx_pw_5talib_6stream_33CCI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CCI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 1); __PYX_ERR(0, 823, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, 2); __PYX_ERR(0, 823, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CCI") < 0)) __PYX_ERR(0, 823, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CCI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 823, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 823, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 823, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 823, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_32CCI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_32CCI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CCI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":846 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":847 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 847, __pyx_L1_error) - - /* "talib/stream.pyx":846 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":848 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":849 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 849, __pyx_L1_error) - - /* "talib/stream.pyx":848 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":850 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":851 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":850 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":852 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":853 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":854 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 854, __pyx_L1_error) - - /* "talib/stream.pyx":853 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":855 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":856 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 856, __pyx_L1_error) - - /* "talib/stream.pyx":855 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":857 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":858 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":857 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":859 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":860 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":861 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 861, __pyx_L1_error) - - /* "talib/stream.pyx":860 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":862 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":863 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 863, __pyx_L1_error) - - /* "talib/stream.pyx":862 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":864 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":865 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":864 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":866 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":867 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":868 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":869 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 869, __pyx_L1_error) - - /* "talib/stream.pyx":868 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":870 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":871 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 871, __pyx_L1_error) - - /* "talib/stream.pyx":870 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":872 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CCI", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":873 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CCI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CCI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":874 - * outreal = NaN - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CCI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CCI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":875 - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CCI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":823 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CCI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":879 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_35CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_34CDL2CROWS[] = " CDL2CROWS(open, high, low, close)\n\n Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_35CDL2CROWS = {"CDL2CROWS", (PyCFunction)__pyx_pw_5talib_6stream_35CDL2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_34CDL2CROWS}; -static PyObject *__pyx_pw_5talib_6stream_35CDL2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL2CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 1); __PYX_ERR(0, 879, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 2); __PYX_ERR(0, 879, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, 3); __PYX_ERR(0, 879, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL2CROWS") < 0)) __PYX_ERR(0, 879, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 879, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 879, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 879, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 879, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 879, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_34CDL2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_34CDL2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL2CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":901 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":902 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 902, __pyx_L1_error) - - /* "talib/stream.pyx":901 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":903 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":904 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 904, __pyx_L1_error) - - /* "talib/stream.pyx":903 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":905 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":906 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 906, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":905 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":907 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":908 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":909 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 909, __pyx_L1_error) - - /* "talib/stream.pyx":908 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":910 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":911 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 911, __pyx_L1_error) - - /* "talib/stream.pyx":910 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":912 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":913 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":912 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":914 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":915 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":916 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 916, __pyx_L1_error) - - /* "talib/stream.pyx":915 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":917 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":918 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 918, __pyx_L1_error) - - /* "talib/stream.pyx":917 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":919 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":920 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":919 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":921 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":922 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":923 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 923, __pyx_L1_error) - - /* "talib/stream.pyx":922 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":924 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":925 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 925, __pyx_L1_error) - - /* "talib/stream.pyx":924 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":926 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":927 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 927, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":926 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":928 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":929 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":930 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":931 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 931, __pyx_L1_error) - - /* "talib/stream.pyx":930 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":932 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":933 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 933, __pyx_L1_error) - - /* "talib/stream.pyx":932 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":934 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":935 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 935, __pyx_L1_error) - - /* "talib/stream.pyx":934 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":936 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL2CROWS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":937 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL2CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL2CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":938 - * outinteger = 0 - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL2CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":939 - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL2CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":879 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":943 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_37CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_36CDL3BLACKCROWS[] = " CDL3BLACKCROWS(open, high, low, close)\n\n Three Black Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_37CDL3BLACKCROWS = {"CDL3BLACKCROWS", (PyCFunction)__pyx_pw_5talib_6stream_37CDL3BLACKCROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_36CDL3BLACKCROWS}; -static PyObject *__pyx_pw_5talib_6stream_37CDL3BLACKCROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3BLACKCROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 1); __PYX_ERR(0, 943, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 2); __PYX_ERR(0, 943, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, 3); __PYX_ERR(0, 943, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3BLACKCROWS") < 0)) __PYX_ERR(0, 943, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3BLACKCROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 943, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 943, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 943, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 943, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 943, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_36CDL3BLACKCROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_36CDL3BLACKCROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3BLACKCROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":965 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":966 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 966, __pyx_L1_error) - - /* "talib/stream.pyx":965 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":967 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":968 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 968, __pyx_L1_error) - - /* "talib/stream.pyx":967 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":969 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":970 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":969 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":971 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":972 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":973 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 973, __pyx_L1_error) - - /* "talib/stream.pyx":972 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":974 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":975 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 975, __pyx_L1_error) - - /* "talib/stream.pyx":974 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":976 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":977 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 977, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":976 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":978 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":979 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":980 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 980, __pyx_L1_error) - - /* "talib/stream.pyx":979 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":981 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":982 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 982, __pyx_L1_error) - - /* "talib/stream.pyx":981 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":983 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":984 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":983 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":985 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":986 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":987 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 987, __pyx_L1_error) - - /* "talib/stream.pyx":986 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":988 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":989 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 989, __pyx_L1_error) - - /* "talib/stream.pyx":988 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":990 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":991 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 991, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":990 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":992 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":993 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":994 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":995 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 995, __pyx_L1_error) - - /* "talib/stream.pyx":994 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":996 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":997 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 997, __pyx_L1_error) - - /* "talib/stream.pyx":996 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":998 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":999 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 999, __pyx_L1_error) - - /* "talib/stream.pyx":998 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1000 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1001 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3BLACKCROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1002 - * outinteger = 0 - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1003 - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3BLACKCROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":943 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3BLACKCROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1007 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_39CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_38CDL3INSIDE[] = " CDL3INSIDE(open, high, low, close)\n\n Three Inside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_39CDL3INSIDE = {"CDL3INSIDE", (PyCFunction)__pyx_pw_5talib_6stream_39CDL3INSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_38CDL3INSIDE}; -static PyObject *__pyx_pw_5talib_6stream_39CDL3INSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3INSIDE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 1); __PYX_ERR(0, 1007, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 2); __PYX_ERR(0, 1007, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, 3); __PYX_ERR(0, 1007, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3INSIDE") < 0)) __PYX_ERR(0, 1007, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3INSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1007, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_38CDL3INSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_38CDL3INSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3INSIDE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1029 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1030 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1030, __pyx_L1_error) - - /* "talib/stream.pyx":1029 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1031 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1032 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1032, __pyx_L1_error) - - /* "talib/stream.pyx":1031 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1033 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1034 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1033 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1035 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1036 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1037 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1037, __pyx_L1_error) - - /* "talib/stream.pyx":1036 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1038 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1039 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1039, __pyx_L1_error) - - /* "talib/stream.pyx":1038 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1040 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1041 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1041, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1040 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1042 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1043 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1044 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1044, __pyx_L1_error) - - /* "talib/stream.pyx":1043 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1045 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1046 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1046, __pyx_L1_error) - - /* "talib/stream.pyx":1045 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1047 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1048 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1048, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1047 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1049 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1050 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1051 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1051, __pyx_L1_error) - - /* "talib/stream.pyx":1050 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1052 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1053 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1053, __pyx_L1_error) - - /* "talib/stream.pyx":1052 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1054 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1055 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1055, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1054 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1056 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1057 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1058 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1059 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1059, __pyx_L1_error) - - /* "talib/stream.pyx":1058 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1060 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1061 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1061, __pyx_L1_error) - - /* "talib/stream.pyx":1060 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1062 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1063 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1063, __pyx_L1_error) - - /* "talib/stream.pyx":1062 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1064 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3INSIDE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1065 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3INSIDE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3INSIDE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1066 - * outinteger = 0 - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3INSIDE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3INSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1067 - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3INSIDE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1007 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3INSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1071 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_41CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_40CDL3LINESTRIKE[] = " CDL3LINESTRIKE(open, high, low, close)\n\n Three-Line Strike (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_41CDL3LINESTRIKE = {"CDL3LINESTRIKE", (PyCFunction)__pyx_pw_5talib_6stream_41CDL3LINESTRIKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_40CDL3LINESTRIKE}; -static PyObject *__pyx_pw_5talib_6stream_41CDL3LINESTRIKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3LINESTRIKE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 1); __PYX_ERR(0, 1071, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 2); __PYX_ERR(0, 1071, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, 3); __PYX_ERR(0, 1071, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3LINESTRIKE") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3LINESTRIKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1071, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1071, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1071, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1071, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_40CDL3LINESTRIKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_40CDL3LINESTRIKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3LINESTRIKE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1093 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1094 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1094, __pyx_L1_error) - - /* "talib/stream.pyx":1093 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1095 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1096 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1096, __pyx_L1_error) - - /* "talib/stream.pyx":1095 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1097 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1098 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1098, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1097 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1099 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1100 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1101 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1101, __pyx_L1_error) - - /* "talib/stream.pyx":1100 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1102 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1103 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1103, __pyx_L1_error) - - /* "talib/stream.pyx":1102 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1104 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1105 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1105, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1104 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1106 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1107 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1108 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1108, __pyx_L1_error) - - /* "talib/stream.pyx":1107 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1109 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1110 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1110, __pyx_L1_error) - - /* "talib/stream.pyx":1109 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1111 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1112 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1111 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1113 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1114 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1115 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1115, __pyx_L1_error) - - /* "talib/stream.pyx":1114 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1116 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1117 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1117, __pyx_L1_error) - - /* "talib/stream.pyx":1116 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1118 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1119 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1119, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1118 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1120 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1121 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1122 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1123 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1123, __pyx_L1_error) - - /* "talib/stream.pyx":1122 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1124 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1125 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1125, __pyx_L1_error) - - /* "talib/stream.pyx":1124 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1126 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1127 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1127, __pyx_L1_error) - - /* "talib/stream.pyx":1126 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1128 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1129 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3LINESTRIKE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1130 - * outinteger = 0 - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1131 - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3LINESTRIKE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1071 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3LINESTRIKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1135 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_43CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_42CDL3OUTSIDE[] = " CDL3OUTSIDE(open, high, low, close)\n\n Three Outside Up/Down (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_43CDL3OUTSIDE = {"CDL3OUTSIDE", (PyCFunction)__pyx_pw_5talib_6stream_43CDL3OUTSIDE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_42CDL3OUTSIDE}; -static PyObject *__pyx_pw_5talib_6stream_43CDL3OUTSIDE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3OUTSIDE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 1); __PYX_ERR(0, 1135, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 2); __PYX_ERR(0, 1135, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, 3); __PYX_ERR(0, 1135, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3OUTSIDE") < 0)) __PYX_ERR(0, 1135, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3OUTSIDE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1135, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1135, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1135, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1135, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1135, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_42CDL3OUTSIDE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_42CDL3OUTSIDE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3OUTSIDE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1157 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1158 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1158, __pyx_L1_error) - - /* "talib/stream.pyx":1157 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1159 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1160 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1160, __pyx_L1_error) - - /* "talib/stream.pyx":1159 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1161 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1162 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1162, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1161 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1163 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1164 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1165 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1165, __pyx_L1_error) - - /* "talib/stream.pyx":1164 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1166 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1167 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1167, __pyx_L1_error) - - /* "talib/stream.pyx":1166 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1168 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1169 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1168 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1170 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1171 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1172 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1172, __pyx_L1_error) - - /* "talib/stream.pyx":1171 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1173 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1174 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1174, __pyx_L1_error) - - /* "talib/stream.pyx":1173 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1175 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1176 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1175 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1177 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1178 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1179 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1179, __pyx_L1_error) - - /* "talib/stream.pyx":1178 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1180 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1181 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1181, __pyx_L1_error) - - /* "talib/stream.pyx":1180 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1182 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1183 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1183, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1182 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1184 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1185 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1186 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1187 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1187, __pyx_L1_error) - - /* "talib/stream.pyx":1186 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1188 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1189 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1189, __pyx_L1_error) - - /* "talib/stream.pyx":1188 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1190 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1191 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1191, __pyx_L1_error) - - /* "talib/stream.pyx":1190 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1192 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1193 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3OUTSIDE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1194 - * outinteger = 0 - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3OUTSIDE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1195 - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3OUTSIDE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1135 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3OUTSIDE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1199 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_45CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_44CDL3STARSINSOUTH[] = " CDL3STARSINSOUTH(open, high, low, close)\n\n Three Stars In The South (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_45CDL3STARSINSOUTH = {"CDL3STARSINSOUTH", (PyCFunction)__pyx_pw_5talib_6stream_45CDL3STARSINSOUTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_44CDL3STARSINSOUTH}; -static PyObject *__pyx_pw_5talib_6stream_45CDL3STARSINSOUTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3STARSINSOUTH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 1); __PYX_ERR(0, 1199, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 2); __PYX_ERR(0, 1199, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, 3); __PYX_ERR(0, 1199, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3STARSINSOUTH") < 0)) __PYX_ERR(0, 1199, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3STARSINSOUTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1199, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1199, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_44CDL3STARSINSOUTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_44CDL3STARSINSOUTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3STARSINSOUTH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1221 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1222 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1222, __pyx_L1_error) - - /* "talib/stream.pyx":1221 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1223 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1224 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1224, __pyx_L1_error) - - /* "talib/stream.pyx":1223 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1225 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1226 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1225 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1227 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1228 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1229 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1229, __pyx_L1_error) - - /* "talib/stream.pyx":1228 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1230 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1231 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1231, __pyx_L1_error) - - /* "talib/stream.pyx":1230 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1232 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1233 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1233, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1232 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1234 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1235 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1236 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1236, __pyx_L1_error) - - /* "talib/stream.pyx":1235 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1237 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1238 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1238, __pyx_L1_error) - - /* "talib/stream.pyx":1237 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1239 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1240 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1240, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1239 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1241 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1242 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1243 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1243, __pyx_L1_error) - - /* "talib/stream.pyx":1242 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1244 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1245 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1245, __pyx_L1_error) - - /* "talib/stream.pyx":1244 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1246 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1247 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1247, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1246 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1248 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1249 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1250 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1251 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1251, __pyx_L1_error) - - /* "talib/stream.pyx":1250 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1252 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1253 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1253, __pyx_L1_error) - - /* "talib/stream.pyx":1252 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1254 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1255 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1255, __pyx_L1_error) - - /* "talib/stream.pyx":1254 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1256 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1257 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3STARSINSOUTH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1258 - * outinteger = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1259 - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3STARSINSOUTH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1199 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3STARSINSOUTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1263 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_47CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_46CDL3WHITESOLDIERS[] = " CDL3WHITESOLDIERS(open, high, low, close)\n\n Three Advancing White Soldiers (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_47CDL3WHITESOLDIERS = {"CDL3WHITESOLDIERS", (PyCFunction)__pyx_pw_5talib_6stream_47CDL3WHITESOLDIERS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_46CDL3WHITESOLDIERS}; -static PyObject *__pyx_pw_5talib_6stream_47CDL3WHITESOLDIERS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 1); __PYX_ERR(0, 1263, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 2); __PYX_ERR(0, 1263, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, 3); __PYX_ERR(0, 1263, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDL3WHITESOLDIERS") < 0)) __PYX_ERR(0, 1263, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDL3WHITESOLDIERS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1263, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1263, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1263, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1263, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1263, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_46CDL3WHITESOLDIERS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_46CDL3WHITESOLDIERS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDL3WHITESOLDIERS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1285 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1286 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1286, __pyx_L1_error) - - /* "talib/stream.pyx":1285 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1287 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1288 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1288, __pyx_L1_error) - - /* "talib/stream.pyx":1287 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1289 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1290 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1289 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1291 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1292 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1293 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1293, __pyx_L1_error) - - /* "talib/stream.pyx":1292 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1294 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1295 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1295, __pyx_L1_error) - - /* "talib/stream.pyx":1294 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1296 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1297 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1296 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1298 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1299 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1300 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1300, __pyx_L1_error) - - /* "talib/stream.pyx":1299 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1301 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1302 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1302, __pyx_L1_error) - - /* "talib/stream.pyx":1301 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1303 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1304 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1304, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1303 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1305 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1306 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1307 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1307, __pyx_L1_error) - - /* "talib/stream.pyx":1306 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1308 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1309 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1309, __pyx_L1_error) - - /* "talib/stream.pyx":1308 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1310 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1311 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1311, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1310 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1312 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1313 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1314 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1315 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__181, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1315, __pyx_L1_error) - - /* "talib/stream.pyx":1314 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1316 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1317 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1317, __pyx_L1_error) - - /* "talib/stream.pyx":1316 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1318 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1319 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1319, __pyx_L1_error) - - /* "talib/stream.pyx":1318 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1320 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1321 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDL3WHITESOLDIERS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1322 - * outinteger = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1323 - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDL3WHITESOLDIERS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1263 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDL3WHITESOLDIERS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1327 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_49CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_48CDLABANDONEDBABY[] = " CDLABANDONEDBABY(open, high, low, close[, penetration=?])\n\n Abandoned Baby (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_49CDLABANDONEDBABY = {"CDLABANDONEDBABY", (PyCFunction)__pyx_pw_5talib_6stream_49CDLABANDONEDBABY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_48CDLABANDONEDBABY}; -static PyObject *__pyx_pw_5talib_6stream_49CDLABANDONEDBABY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLABANDONEDBABY (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 1); __PYX_ERR(0, 1327, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 2); __PYX_ERR(0, 1327, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, 3); __PYX_ERR(0, 1327, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLABANDONEDBABY") < 0)) __PYX_ERR(0, 1327, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLABANDONEDBABY", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1327, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1327, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1327, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1327, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1327, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_48CDLABANDONEDBABY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_48CDLABANDONEDBABY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLABANDONEDBABY", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1351 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1352 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1352, __pyx_L1_error) - - /* "talib/stream.pyx":1351 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1353 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1354 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1354, __pyx_L1_error) - - /* "talib/stream.pyx":1353 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1355 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1356 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1355 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1357 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1358 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1359 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1359, __pyx_L1_error) - - /* "talib/stream.pyx":1358 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1360 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1361 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1361, __pyx_L1_error) - - /* "talib/stream.pyx":1360 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1362 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1363 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1362 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1364 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1365 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1366 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1366, __pyx_L1_error) - - /* "talib/stream.pyx":1365 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1367 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1368 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1368, __pyx_L1_error) - - /* "talib/stream.pyx":1367 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1369 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1370 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1370, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1369 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1371 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1372 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1373 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1373, __pyx_L1_error) - - /* "talib/stream.pyx":1372 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1374 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1375 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1375, __pyx_L1_error) - - /* "talib/stream.pyx":1374 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1376 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1377 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1377, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1376 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1378 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1379 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1380 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1381 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1381, __pyx_L1_error) - - /* "talib/stream.pyx":1380 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1382 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1383 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1383, __pyx_L1_error) - - /* "talib/stream.pyx":1382 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1384 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1385 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1385, __pyx_L1_error) - - /* "talib/stream.pyx":1384 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1386 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1387 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLABANDONEDBABY((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1388 - * outinteger = 0 - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1389 - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLABANDONEDBABY", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1327 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLABANDONEDBABY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1393 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_51CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_50CDLADVANCEBLOCK[] = " CDLADVANCEBLOCK(open, high, low, close)\n\n Advance Block (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_51CDLADVANCEBLOCK = {"CDLADVANCEBLOCK", (PyCFunction)__pyx_pw_5talib_6stream_51CDLADVANCEBLOCK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_50CDLADVANCEBLOCK}; -static PyObject *__pyx_pw_5talib_6stream_51CDLADVANCEBLOCK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLADVANCEBLOCK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 1); __PYX_ERR(0, 1393, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 2); __PYX_ERR(0, 1393, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, 3); __PYX_ERR(0, 1393, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLADVANCEBLOCK") < 0)) __PYX_ERR(0, 1393, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLADVANCEBLOCK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1393, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1393, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1393, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1393, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1393, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_50CDLADVANCEBLOCK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_50CDLADVANCEBLOCK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLADVANCEBLOCK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1415 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1416 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1416, __pyx_L1_error) - - /* "talib/stream.pyx":1415 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1417 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1418 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1418, __pyx_L1_error) - - /* "talib/stream.pyx":1417 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1419 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1420 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1419 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1421 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1422 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1423 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1423, __pyx_L1_error) - - /* "talib/stream.pyx":1422 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1424 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1425 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1425, __pyx_L1_error) - - /* "talib/stream.pyx":1424 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1426 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1427 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1426 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1428 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1429 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1430 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1430, __pyx_L1_error) - - /* "talib/stream.pyx":1429 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1431 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1432 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1432, __pyx_L1_error) - - /* "talib/stream.pyx":1431 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1433 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1434 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1433 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1435 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1436 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1437 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1437, __pyx_L1_error) - - /* "talib/stream.pyx":1436 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1438 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1439 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1439, __pyx_L1_error) - - /* "talib/stream.pyx":1438 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1440 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1441 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1440 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1442 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1443 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1444 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1445 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1445, __pyx_L1_error) - - /* "talib/stream.pyx":1444 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1446 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1447 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1447, __pyx_L1_error) - - /* "talib/stream.pyx":1446 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1448 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1449 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1449, __pyx_L1_error) - - /* "talib/stream.pyx":1448 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1450 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1451 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLADVANCEBLOCK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1452 - * outinteger = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1453 - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLADVANCEBLOCK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1393 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLADVANCEBLOCK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1457 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_53CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_52CDLBELTHOLD[] = " CDLBELTHOLD(open, high, low, close)\n\n Belt-hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_53CDLBELTHOLD = {"CDLBELTHOLD", (PyCFunction)__pyx_pw_5talib_6stream_53CDLBELTHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_52CDLBELTHOLD}; -static PyObject *__pyx_pw_5talib_6stream_53CDLBELTHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLBELTHOLD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 1); __PYX_ERR(0, 1457, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 2); __PYX_ERR(0, 1457, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, 3); __PYX_ERR(0, 1457, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBELTHOLD") < 0)) __PYX_ERR(0, 1457, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLBELTHOLD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1457, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1457, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_52CDLBELTHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_52CDLBELTHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLBELTHOLD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1479 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1480 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1480, __pyx_L1_error) - - /* "talib/stream.pyx":1479 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1481 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1482 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1482, __pyx_L1_error) - - /* "talib/stream.pyx":1481 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1483 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1484 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1484, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1483 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1485 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1486 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1487 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1487, __pyx_L1_error) - - /* "talib/stream.pyx":1486 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1488 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1489 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1489, __pyx_L1_error) - - /* "talib/stream.pyx":1488 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1490 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1491 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1491, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1490 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1492 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1493 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1494 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1494, __pyx_L1_error) - - /* "talib/stream.pyx":1493 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1495 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1496 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1496, __pyx_L1_error) - - /* "talib/stream.pyx":1495 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1497 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1498 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1497 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1499 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1500 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1501 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1501, __pyx_L1_error) - - /* "talib/stream.pyx":1500 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1502 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1503 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1503, __pyx_L1_error) - - /* "talib/stream.pyx":1502 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1504 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1505 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1505, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1504 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1506 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1507 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1508 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1509 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1509, __pyx_L1_error) - - /* "talib/stream.pyx":1508 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1510 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1511 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1511, __pyx_L1_error) - - /* "talib/stream.pyx":1510 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1512 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1513 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1513, __pyx_L1_error) - - /* "talib/stream.pyx":1512 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1514 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1515 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLBELTHOLD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLBELTHOLD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1516 - * outinteger = 0 - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLBELTHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1517 - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBELTHOLD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1457 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLBELTHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1521 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_55CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_54CDLBREAKAWAY[] = " CDLBREAKAWAY(open, high, low, close)\n\n Breakaway (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_55CDLBREAKAWAY = {"CDLBREAKAWAY", (PyCFunction)__pyx_pw_5talib_6stream_55CDLBREAKAWAY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_54CDLBREAKAWAY}; -static PyObject *__pyx_pw_5talib_6stream_55CDLBREAKAWAY(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLBREAKAWAY (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 1); __PYX_ERR(0, 1521, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 2); __PYX_ERR(0, 1521, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, 3); __PYX_ERR(0, 1521, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLBREAKAWAY") < 0)) __PYX_ERR(0, 1521, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLBREAKAWAY", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1521, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1521, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1521, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1521, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1521, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_54CDLBREAKAWAY(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_54CDLBREAKAWAY(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLBREAKAWAY", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1543 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1544 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1544, __pyx_L1_error) - - /* "talib/stream.pyx":1543 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1545 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1546 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1546, __pyx_L1_error) - - /* "talib/stream.pyx":1545 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1547 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1548 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1547 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1549 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1550 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1551 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1551, __pyx_L1_error) - - /* "talib/stream.pyx":1550 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1552 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1553 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1553, __pyx_L1_error) - - /* "talib/stream.pyx":1552 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1554 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1555 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1554 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1556 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1557 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1558 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1558, __pyx_L1_error) - - /* "talib/stream.pyx":1557 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1559 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1560 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1560, __pyx_L1_error) - - /* "talib/stream.pyx":1559 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1561 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1562 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1562, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1561 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1563 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1564 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1565 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1565, __pyx_L1_error) - - /* "talib/stream.pyx":1564 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1566 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1567 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1567, __pyx_L1_error) - - /* "talib/stream.pyx":1566 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1568 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1569 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1569, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1568 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1570 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1571 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1572 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1573 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1573, __pyx_L1_error) - - /* "talib/stream.pyx":1572 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1574 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1575 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1575, __pyx_L1_error) - - /* "talib/stream.pyx":1574 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1576 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1577 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1577, __pyx_L1_error) - - /* "talib/stream.pyx":1576 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1578 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1579 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLBREAKAWAY((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1580 - * outinteger = 0 - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLBREAKAWAY, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1581 - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLBREAKAWAY", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1521 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLBREAKAWAY", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_57CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_56CDLCLOSINGMARUBOZU[] = " CDLCLOSINGMARUBOZU(open, high, low, close)\n\n Closing Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_57CDLCLOSINGMARUBOZU = {"CDLCLOSINGMARUBOZU", (PyCFunction)__pyx_pw_5talib_6stream_57CDLCLOSINGMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_56CDLCLOSINGMARUBOZU}; -static PyObject *__pyx_pw_5talib_6stream_57CDLCLOSINGMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 1); __PYX_ERR(0, 1585, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 2); __PYX_ERR(0, 1585, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, 3); __PYX_ERR(0, 1585, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCLOSINGMARUBOZU") < 0)) __PYX_ERR(0, 1585, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCLOSINGMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1585, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1585, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1585, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1585, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1585, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_56CDLCLOSINGMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_56CDLCLOSINGMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLCLOSINGMARUBOZU", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1607 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1608 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1608, __pyx_L1_error) - - /* "talib/stream.pyx":1607 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1609 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1610 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1610, __pyx_L1_error) - - /* "talib/stream.pyx":1609 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1611 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1612 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1611 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1613 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1614 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1615 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1615, __pyx_L1_error) - - /* "talib/stream.pyx":1614 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1616 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1617 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1617, __pyx_L1_error) - - /* "talib/stream.pyx":1616 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1618 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1619 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1618 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1620 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1621 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1622 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1622, __pyx_L1_error) - - /* "talib/stream.pyx":1621 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1623 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1624 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1624, __pyx_L1_error) - - /* "talib/stream.pyx":1623 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1625 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1626 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1625 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1627 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1628 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1629 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__234, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1629, __pyx_L1_error) - - /* "talib/stream.pyx":1628 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1630 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1631 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1631, __pyx_L1_error) - - /* "talib/stream.pyx":1630 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1632 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1633 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1633, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1632 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1634 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1635 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1636 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1637 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1637, __pyx_L1_error) - - /* "talib/stream.pyx":1636 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1638 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1639 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1639, __pyx_L1_error) - - /* "talib/stream.pyx":1638 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1640 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1641 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1641, __pyx_L1_error) - - /* "talib/stream.pyx":1640 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1642 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1643 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCLOSINGMARUBOZU((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1644 - * outinteger = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1645 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCLOSINGMARUBOZU", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLCLOSINGMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_59CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_58CDLCONCEALBABYSWALL[] = " CDLCONCEALBABYSWALL(open, high, low, close)\n\n Concealing Baby Swallow (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_59CDLCONCEALBABYSWALL = {"CDLCONCEALBABYSWALL", (PyCFunction)__pyx_pw_5talib_6stream_59CDLCONCEALBABYSWALL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_58CDLCONCEALBABYSWALL}; -static PyObject *__pyx_pw_5talib_6stream_59CDLCONCEALBABYSWALL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 1); __PYX_ERR(0, 1649, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 2); __PYX_ERR(0, 1649, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, 3); __PYX_ERR(0, 1649, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCONCEALBABYSWALL") < 0)) __PYX_ERR(0, 1649, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCONCEALBABYSWALL", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1649, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1649, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1649, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1649, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1649, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_58CDLCONCEALBABYSWALL(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_58CDLCONCEALBABYSWALL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLCONCEALBABYSWALL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1671 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1672 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1672, __pyx_L1_error) - - /* "talib/stream.pyx":1671 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1673 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1674 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__240, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1674, __pyx_L1_error) - - /* "talib/stream.pyx":1673 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1675 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1676 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1676, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1675 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1677 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1678 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1679 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__241, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1679, __pyx_L1_error) - - /* "talib/stream.pyx":1678 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1680 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1681 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__242, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1681, __pyx_L1_error) - - /* "talib/stream.pyx":1680 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1682 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1683 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1683, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1682 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1684 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1685 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1686 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__243, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1686, __pyx_L1_error) - - /* "talib/stream.pyx":1685 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1687 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1688 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__244, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1688, __pyx_L1_error) - - /* "talib/stream.pyx":1687 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1689 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1690 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1690, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1689 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1691 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1692 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1693 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__245, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1693, __pyx_L1_error) - - /* "talib/stream.pyx":1692 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1694 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1695 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__246, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1695, __pyx_L1_error) - - /* "talib/stream.pyx":1694 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1696 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1697 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1697, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1696 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1698 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1699 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1700 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1701 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__247, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1701, __pyx_L1_error) - - /* "talib/stream.pyx":1700 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1702 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1703 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__248, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1703, __pyx_L1_error) - - /* "talib/stream.pyx":1702 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1704 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1705 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1705, __pyx_L1_error) - - /* "talib/stream.pyx":1704 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1706 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1707 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCONCEALBABYSWALL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1708 - * outinteger = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1709 - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCONCEALBABYSWALL", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLCONCEALBABYSWALL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1713 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_61CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_60CDLCOUNTERATTACK[] = " CDLCOUNTERATTACK(open, high, low, close)\n\n Counterattack (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_61CDLCOUNTERATTACK = {"CDLCOUNTERATTACK", (PyCFunction)__pyx_pw_5talib_6stream_61CDLCOUNTERATTACK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_60CDLCOUNTERATTACK}; -static PyObject *__pyx_pw_5talib_6stream_61CDLCOUNTERATTACK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLCOUNTERATTACK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 1); __PYX_ERR(0, 1713, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 2); __PYX_ERR(0, 1713, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, 3); __PYX_ERR(0, 1713, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLCOUNTERATTACK") < 0)) __PYX_ERR(0, 1713, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLCOUNTERATTACK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1713, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1713, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_60CDLCOUNTERATTACK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_60CDLCOUNTERATTACK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLCOUNTERATTACK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1735 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1736 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__250, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1736, __pyx_L1_error) - - /* "talib/stream.pyx":1735 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1737 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1738 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__251, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1738, __pyx_L1_error) - - /* "talib/stream.pyx":1737 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1739 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1740 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1740, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1739 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1741 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1742 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1743 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__252, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1743, __pyx_L1_error) - - /* "talib/stream.pyx":1742 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1744 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1745 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__253, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1745, __pyx_L1_error) - - /* "talib/stream.pyx":1744 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1746 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1747 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1747, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1746 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1748 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1749 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1750 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1750, __pyx_L1_error) - - /* "talib/stream.pyx":1749 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1751 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1752 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1752, __pyx_L1_error) - - /* "talib/stream.pyx":1751 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1753 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1754 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1753 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1755 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1756 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1757 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1757, __pyx_L1_error) - - /* "talib/stream.pyx":1756 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1758 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1759 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1759, __pyx_L1_error) - - /* "talib/stream.pyx":1758 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1760 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1761 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1760 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1762 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1763 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1764 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1765 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1765, __pyx_L1_error) - - /* "talib/stream.pyx":1764 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1766 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1767 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1767, __pyx_L1_error) - - /* "talib/stream.pyx":1766 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1768 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1769 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1769, __pyx_L1_error) - - /* "talib/stream.pyx":1768 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1770 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1771 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLCOUNTERATTACK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1772 - * outinteger = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1773 - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLCOUNTERATTACK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1713 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLCOUNTERATTACK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1777 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_63CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_62CDLDARKCLOUDCOVER[] = " CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?])\n\n Dark Cloud Cover (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_63CDLDARKCLOUDCOVER = {"CDLDARKCLOUDCOVER", (PyCFunction)__pyx_pw_5talib_6stream_63CDLDARKCLOUDCOVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_62CDLDARKCLOUDCOVER}; -static PyObject *__pyx_pw_5talib_6stream_63CDLDARKCLOUDCOVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 1); __PYX_ERR(0, 1777, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 2); __PYX_ERR(0, 1777, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, 3); __PYX_ERR(0, 1777, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDARKCLOUDCOVER") < 0)) __PYX_ERR(0, 1777, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.5); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDARKCLOUDCOVER", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1777, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1777, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1777, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1777, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1777, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_62CDLDARKCLOUDCOVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_62CDLDARKCLOUDCOVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLDARKCLOUDCOVER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1801 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1802 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1802, __pyx_L1_error) - - /* "talib/stream.pyx":1801 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1803 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1804 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1804, __pyx_L1_error) - - /* "talib/stream.pyx":1803 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1805 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1806 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1806, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1805 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1807 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1808 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1809 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1809, __pyx_L1_error) - - /* "talib/stream.pyx":1808 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1810 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1811 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1811, __pyx_L1_error) - - /* "talib/stream.pyx":1810 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1812 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1813 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1813, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1812 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1814 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1815 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1816 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__265, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1816, __pyx_L1_error) - - /* "talib/stream.pyx":1815 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1817 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1818 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__266, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1818, __pyx_L1_error) - - /* "talib/stream.pyx":1817 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1819 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1820 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1820, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1819 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1821 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1822 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1823 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__267, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1823, __pyx_L1_error) - - /* "talib/stream.pyx":1822 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1824 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1825 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__268, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1825, __pyx_L1_error) - - /* "talib/stream.pyx":1824 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1826 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1827 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1827, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1826 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1828 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1829 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1830 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1831 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__269, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1831, __pyx_L1_error) - - /* "talib/stream.pyx":1830 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1832 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1833 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__270, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1833, __pyx_L1_error) - - /* "talib/stream.pyx":1832 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1834 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1835 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__271, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1835, __pyx_L1_error) - - /* "talib/stream.pyx":1834 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1836 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1837 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDARKCLOUDCOVER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1838 - * outinteger = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1839 - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDARKCLOUDCOVER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1777 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLDARKCLOUDCOVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1843 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_65CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_64CDLDOJI[] = " CDLDOJI(open, high, low, close)\n\n Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_65CDLDOJI = {"CDLDOJI", (PyCFunction)__pyx_pw_5talib_6stream_65CDLDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_64CDLDOJI}; -static PyObject *__pyx_pw_5talib_6stream_65CDLDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 1); __PYX_ERR(0, 1843, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 2); __PYX_ERR(0, 1843, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, 3); __PYX_ERR(0, 1843, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJI") < 0)) __PYX_ERR(0, 1843, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1843, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1843, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1843, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1843, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1843, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_64CDLDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_64CDLDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1865 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1866 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__272, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1866, __pyx_L1_error) - - /* "talib/stream.pyx":1865 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1867 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1868 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__273, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1868, __pyx_L1_error) - - /* "talib/stream.pyx":1867 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1869 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1870 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1870, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1869 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1871 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1872 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1873 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__274, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1873, __pyx_L1_error) - - /* "talib/stream.pyx":1872 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1874 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1875 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__275, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1875, __pyx_L1_error) - - /* "talib/stream.pyx":1874 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1876 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1877 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1876 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1878 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1879 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1880 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__276, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1880, __pyx_L1_error) - - /* "talib/stream.pyx":1879 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1881 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1882 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__277, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1882, __pyx_L1_error) - - /* "talib/stream.pyx":1881 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1883 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1884 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1884, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1883 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1885 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1886 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1887 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__278, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1887, __pyx_L1_error) - - /* "talib/stream.pyx":1886 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1888 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1889 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__279, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1889, __pyx_L1_error) - - /* "talib/stream.pyx":1888 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1890 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1891 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1891, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1890 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1892 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1893 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1894 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1895 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__280, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1895, __pyx_L1_error) - - /* "talib/stream.pyx":1894 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1896 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1897 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__281, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1897, __pyx_L1_error) - - /* "talib/stream.pyx":1896 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1898 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1899 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__282, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1899, __pyx_L1_error) - - /* "talib/stream.pyx":1898 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1900 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1901 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1902 - * outinteger = 0 - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1903 - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1843 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1907 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_67CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_66CDLDOJISTAR[] = " CDLDOJISTAR(open, high, low, close)\n\n Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_67CDLDOJISTAR = {"CDLDOJISTAR", (PyCFunction)__pyx_pw_5talib_6stream_67CDLDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_66CDLDOJISTAR}; -static PyObject *__pyx_pw_5talib_6stream_67CDLDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 1); __PYX_ERR(0, 1907, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 2); __PYX_ERR(0, 1907, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, 3); __PYX_ERR(0, 1907, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDOJISTAR") < 0)) __PYX_ERR(0, 1907, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDOJISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1907, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1907, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1907, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1907, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1907, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_66CDLDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_66CDLDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1929 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1930 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__283, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1930, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1930, __pyx_L1_error) - - /* "talib/stream.pyx":1929 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1931 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1932 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1932, __pyx_L1_error) - - /* "talib/stream.pyx":1931 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1933 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1934 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1934, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1933 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1935 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":1936 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1937 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__285, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1937, __pyx_L1_error) - - /* "talib/stream.pyx":1936 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":1938 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1939 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__286, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1939, __pyx_L1_error) - - /* "talib/stream.pyx":1938 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1940 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1941 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1941, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1940 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":1942 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":1943 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1944 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__287, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1944, __pyx_L1_error) - - /* "talib/stream.pyx":1943 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":1945 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1946 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1946, __pyx_L1_error) - - /* "talib/stream.pyx":1945 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1947 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1948 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1948, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1947 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":1949 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":1950 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1951 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1951, __pyx_L1_error) - - /* "talib/stream.pyx":1950 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":1952 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1953 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__290, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1953, __pyx_L1_error) - - /* "talib/stream.pyx":1952 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1954 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1955 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1955, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1954 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":1956 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":1957 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":1958 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1959 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1959, __pyx_L1_error) - - /* "talib/stream.pyx":1958 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":1960 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1961 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__292, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1961, __pyx_L1_error) - - /* "talib/stream.pyx":1960 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":1962 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1963 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__293, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1963, __pyx_L1_error) - - /* "talib/stream.pyx":1962 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":1964 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":1965 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":1966 - * outinteger = 0 - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":1967 - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1907 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":1971 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_69CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_68CDLDRAGONFLYDOJI[] = " CDLDRAGONFLYDOJI(open, high, low, close)\n\n Dragonfly Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_69CDLDRAGONFLYDOJI = {"CDLDRAGONFLYDOJI", (PyCFunction)__pyx_pw_5talib_6stream_69CDLDRAGONFLYDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_68CDLDRAGONFLYDOJI}; -static PyObject *__pyx_pw_5talib_6stream_69CDLDRAGONFLYDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 1); __PYX_ERR(0, 1971, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 2); __PYX_ERR(0, 1971, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, 3); __PYX_ERR(0, 1971, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLDRAGONFLYDOJI") < 0)) __PYX_ERR(0, 1971, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLDRAGONFLYDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1971, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 1971, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 1971, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 1971, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 1971, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_68CDLDRAGONFLYDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_68CDLDRAGONFLYDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLDRAGONFLYDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":1993 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1994 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__294, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1994, __pyx_L1_error) - - /* "talib/stream.pyx":1993 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":1995 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1996 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__295, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1996, __pyx_L1_error) - - /* "talib/stream.pyx":1995 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":1997 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":1998 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1998, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":1997 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":1999 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2000 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2001 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__296, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2001, __pyx_L1_error) - - /* "talib/stream.pyx":2000 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2002 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2003 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__297, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2003, __pyx_L1_error) - - /* "talib/stream.pyx":2002 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2004 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2005 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2005, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2004 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2006 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2007 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2008 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__298, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2008, __pyx_L1_error) - - /* "talib/stream.pyx":2007 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2009 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2010 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__299, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2010, __pyx_L1_error) - - /* "talib/stream.pyx":2009 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2011 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2012 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2011 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2013 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2014 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2015 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__300, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2015, __pyx_L1_error) - - /* "talib/stream.pyx":2014 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2016 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2017 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2017, __pyx_L1_error) - - /* "talib/stream.pyx":2016 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2018 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2019 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2019, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2018 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2020 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2021 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2022 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2023 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__302, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2023, __pyx_L1_error) - - /* "talib/stream.pyx":2022 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2024 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2025 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__303, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2025, __pyx_L1_error) - - /* "talib/stream.pyx":2024 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2026 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2027 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__304, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2027, __pyx_L1_error) - - /* "talib/stream.pyx":2026 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2028 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2029 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLDRAGONFLYDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2030 - * outinteger = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2031 - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLDRAGONFLYDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":1971 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLDRAGONFLYDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2035 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_71CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_70CDLENGULFING[] = " CDLENGULFING(open, high, low, close)\n\n Engulfing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_71CDLENGULFING = {"CDLENGULFING", (PyCFunction)__pyx_pw_5talib_6stream_71CDLENGULFING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_70CDLENGULFING}; -static PyObject *__pyx_pw_5talib_6stream_71CDLENGULFING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLENGULFING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 1); __PYX_ERR(0, 2035, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 2); __PYX_ERR(0, 2035, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, 3); __PYX_ERR(0, 2035, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLENGULFING") < 0)) __PYX_ERR(0, 2035, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLENGULFING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2035, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2035, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2035, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2035, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2035, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_70CDLENGULFING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_70CDLENGULFING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLENGULFING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2057 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2058 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__305, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2058, __pyx_L1_error) - - /* "talib/stream.pyx":2057 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2059 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2060 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__306, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2060, __pyx_L1_error) - - /* "talib/stream.pyx":2059 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2061 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2062 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2062, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2062, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2061 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2063 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2064 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2065 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__307, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2065, __pyx_L1_error) - - /* "talib/stream.pyx":2064 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2066 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2067 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__308, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2067, __pyx_L1_error) - - /* "talib/stream.pyx":2066 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2068 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2069 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2069, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2068 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2070 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2071 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2072 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__309, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2072, __pyx_L1_error) - - /* "talib/stream.pyx":2071 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2073 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2074 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__310, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2074, __pyx_L1_error) - - /* "talib/stream.pyx":2073 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2075 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2076 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2076, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2075 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2077 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2078 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2079 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__311, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2079, __pyx_L1_error) - - /* "talib/stream.pyx":2078 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2080 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2081 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__312, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2081, __pyx_L1_error) - - /* "talib/stream.pyx":2080 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2082 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2083 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2083, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2082 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2084 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2085 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2086 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2087 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__313, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2087, __pyx_L1_error) - - /* "talib/stream.pyx":2086 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2088 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2089 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__314, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2089, __pyx_L1_error) - - /* "talib/stream.pyx":2088 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2090 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2091 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__315, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2091, __pyx_L1_error) - - /* "talib/stream.pyx":2090 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2092 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLENGULFING", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2093 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLENGULFING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLENGULFING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2094 - * outinteger = 0 - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLENGULFING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLENGULFING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2095 - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLENGULFING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2035 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLENGULFING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2099 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_73CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_72CDLEVENINGDOJISTAR[] = " CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Evening Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_73CDLEVENINGDOJISTAR = {"CDLEVENINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_6stream_73CDLEVENINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_72CDLEVENINGDOJISTAR}; -static PyObject *__pyx_pw_5talib_6stream_73CDLEVENINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(0, 2099, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(0, 2099, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(0, 2099, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGDOJISTAR") < 0)) __PYX_ERR(0, 2099, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLEVENINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2099, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2099, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2099, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2099, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2099, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_72CDLEVENINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_72CDLEVENINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLEVENINGDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2123 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2124 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__316, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2124, __pyx_L1_error) - - /* "talib/stream.pyx":2123 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2125 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2126 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__317, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2126, __pyx_L1_error) - - /* "talib/stream.pyx":2125 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2127 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2128 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2128, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2127 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2129 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2130 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2131 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__318, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2131, __pyx_L1_error) - - /* "talib/stream.pyx":2130 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2132 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2133 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__319, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2133, __pyx_L1_error) - - /* "talib/stream.pyx":2132 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2134 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2135 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2135, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2134 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2136 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2137 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2138 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__320, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2138, __pyx_L1_error) - - /* "talib/stream.pyx":2137 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2139 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2140 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__321, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2140, __pyx_L1_error) - - /* "talib/stream.pyx":2139 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2141 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2142 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2142, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2141 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2143 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2144 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2145 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__322, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2145, __pyx_L1_error) - - /* "talib/stream.pyx":2144 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2146 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2147 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__323, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2147, __pyx_L1_error) - - /* "talib/stream.pyx":2146 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2148 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2149 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2149, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2148 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2150 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2151 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2152 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2153 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__324, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2153, __pyx_L1_error) - - /* "talib/stream.pyx":2152 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2154 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2155 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__325, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2155, __pyx_L1_error) - - /* "talib/stream.pyx":2154 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2156 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2157 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__326, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2157, __pyx_L1_error) - - /* "talib/stream.pyx":2156 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2158 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2159 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLEVENINGDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2160 - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2161 - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2099 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLEVENINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2165 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_75CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_74CDLEVENINGSTAR[] = " CDLEVENINGSTAR(open, high, low, close[, penetration=?])\n\n Evening Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_75CDLEVENINGSTAR = {"CDLEVENINGSTAR", (PyCFunction)__pyx_pw_5talib_6stream_75CDLEVENINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_74CDLEVENINGSTAR}; -static PyObject *__pyx_pw_5talib_6stream_75CDLEVENINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLEVENINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 1); __PYX_ERR(0, 2165, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 2); __PYX_ERR(0, 2165, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, 3); __PYX_ERR(0, 2165, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLEVENINGSTAR") < 0)) __PYX_ERR(0, 2165, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2165, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLEVENINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2165, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2165, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2165, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2165, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2165, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_74CDLEVENINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_74CDLEVENINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLEVENINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2189 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2190 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__327, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2190, __pyx_L1_error) - - /* "talib/stream.pyx":2189 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2191 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2192 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__328, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2192, __pyx_L1_error) - - /* "talib/stream.pyx":2191 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2193 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2194 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2194, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2193 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2195 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2196 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2197 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__329, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2197, __pyx_L1_error) - - /* "talib/stream.pyx":2196 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2198 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2199 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__330, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2199, __pyx_L1_error) - - /* "talib/stream.pyx":2198 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2200 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2201 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2201, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2200 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2202 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2203 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2204 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__331, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2204, __pyx_L1_error) - - /* "talib/stream.pyx":2203 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2205 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2206 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__332, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2206, __pyx_L1_error) - - /* "talib/stream.pyx":2205 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2207 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2208 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2208, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2207 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2209 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2210 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2211 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__333, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2211, __pyx_L1_error) - - /* "talib/stream.pyx":2210 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2212 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2213 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__334, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2213, __pyx_L1_error) - - /* "talib/stream.pyx":2212 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2214 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2215 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2214 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2216 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2217 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2218 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2219 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__335, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2219, __pyx_L1_error) - - /* "talib/stream.pyx":2218 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2220 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2221 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__336, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2221, __pyx_L1_error) - - /* "talib/stream.pyx":2220 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2222 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2223 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__337, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2223, __pyx_L1_error) - - /* "talib/stream.pyx":2222 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2224 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2225 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLEVENINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2226 - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2227 - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLEVENINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2165 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLEVENINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2231 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_77CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_76CDLGAPSIDESIDEWHITE[] = " CDLGAPSIDESIDEWHITE(open, high, low, close)\n\n Up/Down-gap side-by-side white lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_77CDLGAPSIDESIDEWHITE = {"CDLGAPSIDESIDEWHITE", (PyCFunction)__pyx_pw_5talib_6stream_77CDLGAPSIDESIDEWHITE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_76CDLGAPSIDESIDEWHITE}; -static PyObject *__pyx_pw_5talib_6stream_77CDLGAPSIDESIDEWHITE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 1); __PYX_ERR(0, 2231, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 2); __PYX_ERR(0, 2231, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, 3); __PYX_ERR(0, 2231, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGAPSIDESIDEWHITE") < 0)) __PYX_ERR(0, 2231, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLGAPSIDESIDEWHITE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2231, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2231, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2231, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2231, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2231, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_76CDLGAPSIDESIDEWHITE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_76CDLGAPSIDESIDEWHITE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLGAPSIDESIDEWHITE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2253 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2254 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__338, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2254, __pyx_L1_error) - - /* "talib/stream.pyx":2253 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2255 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2256 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__339, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2256, __pyx_L1_error) - - /* "talib/stream.pyx":2255 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2257 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2258 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2258, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2257 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2259 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2260 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2261 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__340, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2261, __pyx_L1_error) - - /* "talib/stream.pyx":2260 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2262 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2263 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__341, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2263, __pyx_L1_error) - - /* "talib/stream.pyx":2262 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2264 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2265 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2265, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2264 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2266 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2267 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2268 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__342, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2268, __pyx_L1_error) - - /* "talib/stream.pyx":2267 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2269 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2270 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__343, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2270, __pyx_L1_error) - - /* "talib/stream.pyx":2269 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2271 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2272 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2272, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2271 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2273 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2274 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2275 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__344, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2275, __pyx_L1_error) - - /* "talib/stream.pyx":2274 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2276 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2277 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__345, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2277, __pyx_L1_error) - - /* "talib/stream.pyx":2276 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2278 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2279 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2279, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2278 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2280 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2281 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2282 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2283 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__346, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2283, __pyx_L1_error) - - /* "talib/stream.pyx":2282 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2284 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2285 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__347, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2285, __pyx_L1_error) - - /* "talib/stream.pyx":2284 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2286 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2287 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__348, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2287, __pyx_L1_error) - - /* "talib/stream.pyx":2286 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2288 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2289 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLGAPSIDESIDEWHITE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2290 - * outinteger = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2291 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGAPSIDESIDEWHITE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2231 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLGAPSIDESIDEWHITE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_79CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_78CDLGRAVESTONEDOJI[] = " CDLGRAVESTONEDOJI(open, high, low, close)\n\n Gravestone Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_79CDLGRAVESTONEDOJI = {"CDLGRAVESTONEDOJI", (PyCFunction)__pyx_pw_5talib_6stream_79CDLGRAVESTONEDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_78CDLGRAVESTONEDOJI}; -static PyObject *__pyx_pw_5talib_6stream_79CDLGRAVESTONEDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 1); __PYX_ERR(0, 2295, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 2); __PYX_ERR(0, 2295, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, 3); __PYX_ERR(0, 2295, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLGRAVESTONEDOJI") < 0)) __PYX_ERR(0, 2295, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLGRAVESTONEDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2295, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2295, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2295, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2295, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2295, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_78CDLGRAVESTONEDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_78CDLGRAVESTONEDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLGRAVESTONEDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2317 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2318 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__349, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2318, __pyx_L1_error) - - /* "talib/stream.pyx":2317 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2319 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2320 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__350, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2320, __pyx_L1_error) - - /* "talib/stream.pyx":2319 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2321 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2322 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2322, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2321 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2323 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2324 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2325 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__351, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2325, __pyx_L1_error) - - /* "talib/stream.pyx":2324 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2326 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2327 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2327, __pyx_L1_error) - - /* "talib/stream.pyx":2326 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2328 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2329 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2329, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2328 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2330 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2331 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2332 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2332, __pyx_L1_error) - - /* "talib/stream.pyx":2331 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2333 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2334 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2334, __pyx_L1_error) - - /* "talib/stream.pyx":2333 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2335 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2336 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2336, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2335 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2337 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2338 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2339 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2339, __pyx_L1_error) - - /* "talib/stream.pyx":2338 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2340 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2341 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__356, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2341, __pyx_L1_error) - - /* "talib/stream.pyx":2340 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2342 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2343 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2342 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2344 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2345 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2346 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2347 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__357, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2347, __pyx_L1_error) - - /* "talib/stream.pyx":2346 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2348 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2349 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__358, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2349, __pyx_L1_error) - - /* "talib/stream.pyx":2348 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2350 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2351 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__359, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2351, __pyx_L1_error) - - /* "talib/stream.pyx":2350 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2352 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2353 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLGRAVESTONEDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2354 - * outinteger = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2355 - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLGRAVESTONEDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLGRAVESTONEDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_81CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_80CDLHAMMER[] = " CDLHAMMER(open, high, low, close)\n\n Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_81CDLHAMMER = {"CDLHAMMER", (PyCFunction)__pyx_pw_5talib_6stream_81CDLHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_80CDLHAMMER}; -static PyObject *__pyx_pw_5talib_6stream_81CDLHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHAMMER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 1); __PYX_ERR(0, 2359, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 2); __PYX_ERR(0, 2359, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, 3); __PYX_ERR(0, 2359, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHAMMER") < 0)) __PYX_ERR(0, 2359, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2359, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_80CDLHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_80CDLHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHAMMER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2381 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2382 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__360, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2382, __pyx_L1_error) - - /* "talib/stream.pyx":2381 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2383 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2384 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__361, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2384, __pyx_L1_error) - - /* "talib/stream.pyx":2383 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2385 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2386 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2385 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2387 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2388 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2389 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__362, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2389, __pyx_L1_error) - - /* "talib/stream.pyx":2388 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2390 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2391 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__363, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2391, __pyx_L1_error) - - /* "talib/stream.pyx":2390 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2392 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2393 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2393, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2392 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2394 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2395 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2396 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__364, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2396, __pyx_L1_error) - - /* "talib/stream.pyx":2395 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2397 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2398 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__365, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2398, __pyx_L1_error) - - /* "talib/stream.pyx":2397 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2399 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2400 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2399 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2401 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2402 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2403 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__366, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2403, __pyx_L1_error) - - /* "talib/stream.pyx":2402 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2404 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2405 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__367, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2405, __pyx_L1_error) - - /* "talib/stream.pyx":2404 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2406 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2407 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2407, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2406 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2408 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2409 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2410 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2411 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__368, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2411, __pyx_L1_error) - - /* "talib/stream.pyx":2410 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2412 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2413 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__369, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2413, __pyx_L1_error) - - /* "talib/stream.pyx":2412 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2414 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2415 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__370, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2415, __pyx_L1_error) - - /* "talib/stream.pyx":2414 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2416 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHAMMER", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2417 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHAMMER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHAMMER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2418 - * outinteger = 0 - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHAMMER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2419 - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHAMMER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2423 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_83CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_82CDLHANGINGMAN[] = " CDLHANGINGMAN(open, high, low, close)\n\n Hanging Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_83CDLHANGINGMAN = {"CDLHANGINGMAN", (PyCFunction)__pyx_pw_5talib_6stream_83CDLHANGINGMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_82CDLHANGINGMAN}; -static PyObject *__pyx_pw_5talib_6stream_83CDLHANGINGMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHANGINGMAN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 1); __PYX_ERR(0, 2423, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 2); __PYX_ERR(0, 2423, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, 3); __PYX_ERR(0, 2423, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHANGINGMAN") < 0)) __PYX_ERR(0, 2423, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHANGINGMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2423, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2423, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2423, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2423, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2423, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_82CDLHANGINGMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_82CDLHANGINGMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHANGINGMAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2445 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2446 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__371, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2446, __pyx_L1_error) - - /* "talib/stream.pyx":2445 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2447 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2448 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__372, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2448, __pyx_L1_error) - - /* "talib/stream.pyx":2447 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2449 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2450 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2450, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2449 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2451 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2452 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2453 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__373, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2453, __pyx_L1_error) - - /* "talib/stream.pyx":2452 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2454 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2455 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__374, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2455, __pyx_L1_error) - - /* "talib/stream.pyx":2454 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2456 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2457 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2457, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2456 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2458 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2459 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2460 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__375, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2460, __pyx_L1_error) - - /* "talib/stream.pyx":2459 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2461 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2462 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__376, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2462, __pyx_L1_error) - - /* "talib/stream.pyx":2461 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2463 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2464 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2464, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2463 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2465 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2466 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2467 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__377, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2467, __pyx_L1_error) - - /* "talib/stream.pyx":2466 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2468 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2469 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__378, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2469, __pyx_L1_error) - - /* "talib/stream.pyx":2468 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2470 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2471 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2471, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2470 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2472 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2473 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2474 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2475 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__379, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2475, __pyx_L1_error) - - /* "talib/stream.pyx":2474 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2476 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2477 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__380, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2477, __pyx_L1_error) - - /* "talib/stream.pyx":2476 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2478 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2479 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__381, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2479, __pyx_L1_error) - - /* "talib/stream.pyx":2478 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2480 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2481 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHANGINGMAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2482 - * outinteger = 0 - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHANGINGMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2483 - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHANGINGMAN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2423 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHANGINGMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2487 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_85CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_84CDLHARAMI[] = " CDLHARAMI(open, high, low, close)\n\n Harami Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_85CDLHARAMI = {"CDLHARAMI", (PyCFunction)__pyx_pw_5talib_6stream_85CDLHARAMI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_84CDLHARAMI}; -static PyObject *__pyx_pw_5talib_6stream_85CDLHARAMI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHARAMI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 1); __PYX_ERR(0, 2487, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 2); __PYX_ERR(0, 2487, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, 3); __PYX_ERR(0, 2487, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMI") < 0)) __PYX_ERR(0, 2487, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHARAMI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2487, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2487, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2487, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2487, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2487, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_84CDLHARAMI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_84CDLHARAMI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHARAMI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2509 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2510 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__382, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2510, __pyx_L1_error) - - /* "talib/stream.pyx":2509 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2511 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2512 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__383, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2512, __pyx_L1_error) - - /* "talib/stream.pyx":2511 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2513 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2514 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2514, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2513 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2515 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2516 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2517 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__384, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2517, __pyx_L1_error) - - /* "talib/stream.pyx":2516 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2518 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2519 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__385, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2519, __pyx_L1_error) - - /* "talib/stream.pyx":2518 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2520 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2521 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2521, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2520 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2522 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2523 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2524 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__386, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2524, __pyx_L1_error) - - /* "talib/stream.pyx":2523 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2525 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2526 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__387, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2526, __pyx_L1_error) - - /* "talib/stream.pyx":2525 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2527 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2528 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2528, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2527 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2529 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2530 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2531 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__388, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2531, __pyx_L1_error) - - /* "talib/stream.pyx":2530 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2532 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2533 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__389, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2533, __pyx_L1_error) - - /* "talib/stream.pyx":2532 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2534 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2535 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2534 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2536 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2537 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2538 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2539 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__390, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2539, __pyx_L1_error) - - /* "talib/stream.pyx":2538 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2540 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2541 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__391, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2541, __pyx_L1_error) - - /* "talib/stream.pyx":2540 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2542 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2543 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__392, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2543, __pyx_L1_error) - - /* "talib/stream.pyx":2542 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2544 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2545 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHARAMI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHARAMI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2546 - * outinteger = 0 - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHARAMI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2547 - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2487 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHARAMI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_87CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_86CDLHARAMICROSS[] = " CDLHARAMICROSS(open, high, low, close)\n\n Harami Cross Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_87CDLHARAMICROSS = {"CDLHARAMICROSS", (PyCFunction)__pyx_pw_5talib_6stream_87CDLHARAMICROSS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_86CDLHARAMICROSS}; -static PyObject *__pyx_pw_5talib_6stream_87CDLHARAMICROSS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHARAMICROSS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 1); __PYX_ERR(0, 2551, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 2); __PYX_ERR(0, 2551, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, 3); __PYX_ERR(0, 2551, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHARAMICROSS") < 0)) __PYX_ERR(0, 2551, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHARAMICROSS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2551, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2551, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2551, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2551, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2551, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_86CDLHARAMICROSS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_86CDLHARAMICROSS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHARAMICROSS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2573 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2574 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__393, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2574, __pyx_L1_error) - - /* "talib/stream.pyx":2573 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2575 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2576 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__394, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2576, __pyx_L1_error) - - /* "talib/stream.pyx":2575 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2577 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2578 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2578, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2577 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2579 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2580 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2581 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__395, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2581, __pyx_L1_error) - - /* "talib/stream.pyx":2580 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2582 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2583 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__396, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2583, __pyx_L1_error) - - /* "talib/stream.pyx":2582 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2584 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2585 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2585, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2584 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2586 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2587 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2588 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__397, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2588, __pyx_L1_error) - - /* "talib/stream.pyx":2587 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2589 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2590 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__398, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2590, __pyx_L1_error) - - /* "talib/stream.pyx":2589 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2591 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2592 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2592, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2591 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2593 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2594 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2595 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__399, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2595, __pyx_L1_error) - - /* "talib/stream.pyx":2594 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2596 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2597 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__400, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2597, __pyx_L1_error) - - /* "talib/stream.pyx":2596 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2598 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2599 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2599, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2598 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2600 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2601 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2602 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2603 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__401, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2603, __pyx_L1_error) - - /* "talib/stream.pyx":2602 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2604 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2605 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__402, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2605, __pyx_L1_error) - - /* "talib/stream.pyx":2604 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2606 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2607 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__403, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2607, __pyx_L1_error) - - /* "talib/stream.pyx":2606 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2608 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2609 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHARAMICROSS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2610 - * outinteger = 0 - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHARAMICROSS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2611 - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHARAMICROSS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHARAMICROSS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2615 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_89CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_88CDLHIGHWAVE[] = " CDLHIGHWAVE(open, high, low, close)\n\n High-Wave Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_89CDLHIGHWAVE = {"CDLHIGHWAVE", (PyCFunction)__pyx_pw_5talib_6stream_89CDLHIGHWAVE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_88CDLHIGHWAVE}; -static PyObject *__pyx_pw_5talib_6stream_89CDLHIGHWAVE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIGHWAVE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 1); __PYX_ERR(0, 2615, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 2); __PYX_ERR(0, 2615, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, 3); __PYX_ERR(0, 2615, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIGHWAVE") < 0)) __PYX_ERR(0, 2615, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIGHWAVE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2615, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2615, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2615, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2615, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2615, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_88CDLHIGHWAVE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_88CDLHIGHWAVE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHIGHWAVE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2637 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2638 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__404, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2638, __pyx_L1_error) - - /* "talib/stream.pyx":2637 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2639 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2640 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__405, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2640, __pyx_L1_error) - - /* "talib/stream.pyx":2639 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2641 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2642 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2642, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2641 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2643 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2644 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2645 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__406, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2645, __pyx_L1_error) - - /* "talib/stream.pyx":2644 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2646 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2647 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__407, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2647, __pyx_L1_error) - - /* "talib/stream.pyx":2646 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2648 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2649 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2649, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2648 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2650 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2651 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2652 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__408, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2652, __pyx_L1_error) - - /* "talib/stream.pyx":2651 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2653 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2654 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__409, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2654, __pyx_L1_error) - - /* "talib/stream.pyx":2653 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2655 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2656 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2655 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2657 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2658 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2659 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__410, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2659, __pyx_L1_error) - - /* "talib/stream.pyx":2658 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2660 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2661 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__411, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2661, __pyx_L1_error) - - /* "talib/stream.pyx":2660 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2662 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2663 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2662 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2664 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2665 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2666 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2667 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__412, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2667, __pyx_L1_error) - - /* "talib/stream.pyx":2666 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2668 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2669 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__413, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2669, __pyx_L1_error) - - /* "talib/stream.pyx":2668 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2670 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2671 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__414, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2671, __pyx_L1_error) - - /* "talib/stream.pyx":2670 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2672 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2673 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIGHWAVE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2674 - * outinteger = 0 - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIGHWAVE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2675 - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIGHWAVE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2615 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHIGHWAVE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2679 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_91CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_90CDLHIKKAKE[] = " CDLHIKKAKE(open, high, low, close)\n\n Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_91CDLHIKKAKE = {"CDLHIKKAKE", (PyCFunction)__pyx_pw_5talib_6stream_91CDLHIKKAKE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_90CDLHIKKAKE}; -static PyObject *__pyx_pw_5talib_6stream_91CDLHIKKAKE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIKKAKE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 1); __PYX_ERR(0, 2679, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 2); __PYX_ERR(0, 2679, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, 3); __PYX_ERR(0, 2679, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKE") < 0)) __PYX_ERR(0, 2679, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2679, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2679, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2679, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2679, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2679, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_90CDLHIKKAKE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_90CDLHIKKAKE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHIKKAKE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2701 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2702 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__415, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2702, __pyx_L1_error) - - /* "talib/stream.pyx":2701 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2703 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2704 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__416, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2704, __pyx_L1_error) - - /* "talib/stream.pyx":2703 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2705 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2706 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2706, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2705 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2707 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2708 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2709 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__417, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2709, __pyx_L1_error) - - /* "talib/stream.pyx":2708 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2710 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2711 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__418, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2711, __pyx_L1_error) - - /* "talib/stream.pyx":2710 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2712 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2713 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2713, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2712 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2714 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2715 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2716 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__419, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2716, __pyx_L1_error) - - /* "talib/stream.pyx":2715 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2717 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2718 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__420, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2718, __pyx_L1_error) - - /* "talib/stream.pyx":2717 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2719 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2720 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2720, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2719 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2721 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2722 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2723 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__421, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2723, __pyx_L1_error) - - /* "talib/stream.pyx":2722 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2724 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2725 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__422, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2725, __pyx_L1_error) - - /* "talib/stream.pyx":2724 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2726 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2727 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2726 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2728 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2729 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2730 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2731 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__423, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2731, __pyx_L1_error) - - /* "talib/stream.pyx":2730 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2732 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2733 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__424, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2733, __pyx_L1_error) - - /* "talib/stream.pyx":2732 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2734 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2735 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__425, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2735, __pyx_L1_error) - - /* "talib/stream.pyx":2734 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2736 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2737 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIKKAKE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIKKAKE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2738 - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIKKAKE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2739 - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2679 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHIKKAKE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2743 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_93CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_92CDLHIKKAKEMOD[] = " CDLHIKKAKEMOD(open, high, low, close)\n\n Modified Hikkake Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_93CDLHIKKAKEMOD = {"CDLHIKKAKEMOD", (PyCFunction)__pyx_pw_5talib_6stream_93CDLHIKKAKEMOD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_92CDLHIKKAKEMOD}; -static PyObject *__pyx_pw_5talib_6stream_93CDLHIKKAKEMOD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHIKKAKEMOD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 1); __PYX_ERR(0, 2743, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 2); __PYX_ERR(0, 2743, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, 3); __PYX_ERR(0, 2743, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHIKKAKEMOD") < 0)) __PYX_ERR(0, 2743, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHIKKAKEMOD", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2743, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2743, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2743, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2743, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2743, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_92CDLHIKKAKEMOD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_92CDLHIKKAKEMOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHIKKAKEMOD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2765 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2766 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__426, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2766, __pyx_L1_error) - - /* "talib/stream.pyx":2765 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2767 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2768 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__427, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2768, __pyx_L1_error) - - /* "talib/stream.pyx":2767 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2769 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2770 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2770, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2769 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2771 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2772 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2773 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__428, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2773, __pyx_L1_error) - - /* "talib/stream.pyx":2772 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2774 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2775 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__429, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2775, __pyx_L1_error) - - /* "talib/stream.pyx":2774 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2776 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2777 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2777, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2776 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2778 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2779 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2780 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__430, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2780, __pyx_L1_error) - - /* "talib/stream.pyx":2779 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2781 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2782 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__431, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2782, __pyx_L1_error) - - /* "talib/stream.pyx":2781 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2783 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2784 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2784, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2783 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2785 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2786 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2787 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__432, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2787, __pyx_L1_error) - - /* "talib/stream.pyx":2786 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2788 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2789 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__433, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2789, __pyx_L1_error) - - /* "talib/stream.pyx":2788 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2790 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2791 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2791, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2790 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2792 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2793 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2794 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2795 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__434, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2795, __pyx_L1_error) - - /* "talib/stream.pyx":2794 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2796 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2797 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__435, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2797, __pyx_L1_error) - - /* "talib/stream.pyx":2796 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2798 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2799 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__436, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2799, __pyx_L1_error) - - /* "talib/stream.pyx":2798 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2800 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2801 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHIKKAKEMOD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2802 - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2803 - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHIKKAKEMOD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2743 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHIKKAKEMOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2807 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_95CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_94CDLHOMINGPIGEON[] = " CDLHOMINGPIGEON(open, high, low, close)\n\n Homing Pigeon (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_95CDLHOMINGPIGEON = {"CDLHOMINGPIGEON", (PyCFunction)__pyx_pw_5talib_6stream_95CDLHOMINGPIGEON, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_94CDLHOMINGPIGEON}; -static PyObject *__pyx_pw_5talib_6stream_95CDLHOMINGPIGEON(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLHOMINGPIGEON (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 1); __PYX_ERR(0, 2807, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 2); __PYX_ERR(0, 2807, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, 3); __PYX_ERR(0, 2807, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLHOMINGPIGEON") < 0)) __PYX_ERR(0, 2807, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLHOMINGPIGEON", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2807, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2807, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2807, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2807, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2807, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_94CDLHOMINGPIGEON(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_94CDLHOMINGPIGEON(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLHOMINGPIGEON", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2829 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2830 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__437, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2830, __pyx_L1_error) - - /* "talib/stream.pyx":2829 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2831 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2832 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__438, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2832, __pyx_L1_error) - - /* "talib/stream.pyx":2831 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2833 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2834 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2834, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2833 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2835 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2836 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2837 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__439, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2837, __pyx_L1_error) - - /* "talib/stream.pyx":2836 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2838 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2839 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__440, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2839, __pyx_L1_error) - - /* "talib/stream.pyx":2838 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2840 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2841 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2841, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2840 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2842 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2843 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2844 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__441, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2844, __pyx_L1_error) - - /* "talib/stream.pyx":2843 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2845 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2846 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__442, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2846, __pyx_L1_error) - - /* "talib/stream.pyx":2845 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2847 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2848 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2848, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2847 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2849 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2850 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2851 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__443, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2851, __pyx_L1_error) - - /* "talib/stream.pyx":2850 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2852 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2853 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__444, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2853, __pyx_L1_error) - - /* "talib/stream.pyx":2852 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2854 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2855 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2855, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2854 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2856 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2857 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2858 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2859 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__445, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2859, __pyx_L1_error) - - /* "talib/stream.pyx":2858 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2860 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2861 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__446, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2861, __pyx_L1_error) - - /* "talib/stream.pyx":2860 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2862 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2863 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__447, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2863, __pyx_L1_error) - - /* "talib/stream.pyx":2862 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2864 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2865 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLHOMINGPIGEON((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2866 - * outinteger = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2867 - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLHOMINGPIGEON", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2807 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLHOMINGPIGEON", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2871 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_97CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_96CDLIDENTICAL3CROWS[] = " CDLIDENTICAL3CROWS(open, high, low, close)\n\n Identical Three Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_97CDLIDENTICAL3CROWS = {"CDLIDENTICAL3CROWS", (PyCFunction)__pyx_pw_5talib_6stream_97CDLIDENTICAL3CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_96CDLIDENTICAL3CROWS}; -static PyObject *__pyx_pw_5talib_6stream_97CDLIDENTICAL3CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 1); __PYX_ERR(0, 2871, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 2); __PYX_ERR(0, 2871, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, 3); __PYX_ERR(0, 2871, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLIDENTICAL3CROWS") < 0)) __PYX_ERR(0, 2871, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLIDENTICAL3CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2871, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2871, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2871, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2871, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2871, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_96CDLIDENTICAL3CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_96CDLIDENTICAL3CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLIDENTICAL3CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2893 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2894 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__448, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2894, __pyx_L1_error) - - /* "talib/stream.pyx":2893 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2895 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2896 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__449, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2896, __pyx_L1_error) - - /* "talib/stream.pyx":2895 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2897 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2898 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2898, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2897 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2899 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2900 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2901 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__450, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2901, __pyx_L1_error) - - /* "talib/stream.pyx":2900 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2902 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2903 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__451, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2903, __pyx_L1_error) - - /* "talib/stream.pyx":2902 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2904 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2905 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2905, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2905, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2904 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2906 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2907 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2908 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__452, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2908, __pyx_L1_error) - - /* "talib/stream.pyx":2907 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2909 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2910 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__453, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2910, __pyx_L1_error) - - /* "talib/stream.pyx":2909 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2911 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2912 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2912, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2912, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2911 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2913 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2914 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2915 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__454, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2915, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2915, __pyx_L1_error) - - /* "talib/stream.pyx":2914 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2916 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2917 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__455, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2917, __pyx_L1_error) - - /* "talib/stream.pyx":2916 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2918 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2919 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2919, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2918 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2920 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2921 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2922 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2923 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__456, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2923, __pyx_L1_error) - - /* "talib/stream.pyx":2922 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2924 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2925 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__457, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2925, __pyx_L1_error) - - /* "talib/stream.pyx":2924 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2926 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2927 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__458, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2927, __pyx_L1_error) - - /* "talib/stream.pyx":2926 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2928 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2929 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLIDENTICAL3CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2930 - * outinteger = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2930, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2931 - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLIDENTICAL3CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2871 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLIDENTICAL3CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2935 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_99CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_98CDLINNECK[] = " CDLINNECK(open, high, low, close)\n\n In-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_99CDLINNECK = {"CDLINNECK", (PyCFunction)__pyx_pw_5talib_6stream_99CDLINNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_98CDLINNECK}; -static PyObject *__pyx_pw_5talib_6stream_99CDLINNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLINNECK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 1); __PYX_ERR(0, 2935, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 2); __PYX_ERR(0, 2935, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, 3); __PYX_ERR(0, 2935, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINNECK") < 0)) __PYX_ERR(0, 2935, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLINNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2935, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2935, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2935, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2935, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2935, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_98CDLINNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_98CDLINNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLINNECK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":2957 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2958 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__459, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2958, __pyx_L1_error) - - /* "talib/stream.pyx":2957 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":2959 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2960 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__460, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2960, __pyx_L1_error) - - /* "talib/stream.pyx":2959 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2961 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2962 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2962, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2961 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":2963 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":2964 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2965 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__461, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2965, __pyx_L1_error) - - /* "talib/stream.pyx":2964 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":2966 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2967 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__462, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2967, __pyx_L1_error) - - /* "talib/stream.pyx":2966 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2968 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2969 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2969, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2968 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":2970 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":2971 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2972 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__463, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2972, __pyx_L1_error) - - /* "talib/stream.pyx":2971 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":2973 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2974 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__464, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2974, __pyx_L1_error) - - /* "talib/stream.pyx":2973 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2975 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2976 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2976, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2975 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":2977 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":2978 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2979 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__465, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2979, __pyx_L1_error) - - /* "talib/stream.pyx":2978 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":2980 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2981 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__466, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2981, __pyx_L1_error) - - /* "talib/stream.pyx":2980 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":2982 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2983 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2983, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":2982 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":2984 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":2985 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":2986 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2987 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__467, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2987, __pyx_L1_error) - - /* "talib/stream.pyx":2986 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":2988 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2989 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__468, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2989, __pyx_L1_error) - - /* "talib/stream.pyx":2988 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":2990 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":2991 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__469, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2991, __pyx_L1_error) - - /* "talib/stream.pyx":2990 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":2992 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINNECK", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":2993 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLINNECK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLINNECK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":2994 - * outinteger = 0 - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINNECK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLINNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":2995 - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINNECK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2935 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLINNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":2999 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_101CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_100CDLINVERTEDHAMMER[] = " CDLINVERTEDHAMMER(open, high, low, close)\n\n Inverted Hammer (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_101CDLINVERTEDHAMMER = {"CDLINVERTEDHAMMER", (PyCFunction)__pyx_pw_5talib_6stream_101CDLINVERTEDHAMMER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_100CDLINVERTEDHAMMER}; -static PyObject *__pyx_pw_5talib_6stream_101CDLINVERTEDHAMMER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 1); __PYX_ERR(0, 2999, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 2); __PYX_ERR(0, 2999, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, 3); __PYX_ERR(0, 2999, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLINVERTEDHAMMER") < 0)) __PYX_ERR(0, 2999, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLINVERTEDHAMMER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2999, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 2999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 2999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 2999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 2999, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_100CDLINVERTEDHAMMER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_100CDLINVERTEDHAMMER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLINVERTEDHAMMER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3021 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3022 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__470, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3022, __pyx_L1_error) - - /* "talib/stream.pyx":3021 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3023 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3024 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__471, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3024, __pyx_L1_error) - - /* "talib/stream.pyx":3023 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3025 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3026 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3026, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3025 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3027 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3028 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3029 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__472, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3029, __pyx_L1_error) - - /* "talib/stream.pyx":3028 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3030 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3031 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__473, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3031, __pyx_L1_error) - - /* "talib/stream.pyx":3030 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3032 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3033 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3032 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3034 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3035 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3036 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__474, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3036, __pyx_L1_error) - - /* "talib/stream.pyx":3035 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3037 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3038 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__475, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3038, __pyx_L1_error) - - /* "talib/stream.pyx":3037 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3039 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3040 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3040, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3039 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3041 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3042 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3043 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__476, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3043, __pyx_L1_error) - - /* "talib/stream.pyx":3042 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3044 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3045 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__477, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3045, __pyx_L1_error) - - /* "talib/stream.pyx":3044 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3046 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3047 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3047, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3046 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3048 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3049 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3050 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3051 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__478, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3051, __pyx_L1_error) - - /* "talib/stream.pyx":3050 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3052 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3053 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__479, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3053, __pyx_L1_error) - - /* "talib/stream.pyx":3052 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3054 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3055 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__480, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3055, __pyx_L1_error) - - /* "talib/stream.pyx":3054 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3056 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3057 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLINVERTEDHAMMER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3058 - * outinteger = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3059 - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLINVERTEDHAMMER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":2999 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLINVERTEDHAMMER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_103CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_102CDLKICKING[] = " CDLKICKING(open, high, low, close)\n\n Kicking (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_103CDLKICKING = {"CDLKICKING", (PyCFunction)__pyx_pw_5talib_6stream_103CDLKICKING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_102CDLKICKING}; -static PyObject *__pyx_pw_5talib_6stream_103CDLKICKING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLKICKING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 1); __PYX_ERR(0, 3063, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 2); __PYX_ERR(0, 3063, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, 3); __PYX_ERR(0, 3063, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKING") < 0)) __PYX_ERR(0, 3063, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLKICKING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3063, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3063, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3063, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3063, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3063, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_102CDLKICKING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_102CDLKICKING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLKICKING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3085 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3086 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__481, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3086, __pyx_L1_error) - - /* "talib/stream.pyx":3085 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3087 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3088 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__482, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3088, __pyx_L1_error) - - /* "talib/stream.pyx":3087 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3089 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3090 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3090, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3089 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3091 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3092 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3093 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__483, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3093, __pyx_L1_error) - - /* "talib/stream.pyx":3092 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3094 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3095 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__484, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3095, __pyx_L1_error) - - /* "talib/stream.pyx":3094 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3096 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3097 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3097, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3096 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3098 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3099 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3100 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__485, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3100, __pyx_L1_error) - - /* "talib/stream.pyx":3099 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3101 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3102 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__486, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3102, __pyx_L1_error) - - /* "talib/stream.pyx":3101 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3103 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3104 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3104, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3103 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3105 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3106 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3107 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__487, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3107, __pyx_L1_error) - - /* "talib/stream.pyx":3106 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3108 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3109 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__488, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3109, __pyx_L1_error) - - /* "talib/stream.pyx":3108 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3110 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3111 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3111, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3110 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3112 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3113 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3114 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3115 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__489, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3115, __pyx_L1_error) - - /* "talib/stream.pyx":3114 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3116 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3117 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__490, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3117, __pyx_L1_error) - - /* "talib/stream.pyx":3116 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3118 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3119 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__491, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3119, __pyx_L1_error) - - /* "talib/stream.pyx":3118 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3120 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKING", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3121 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLKICKING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLKICKING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3122 - * outinteger = 0 - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLKICKING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3123 - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLKICKING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3127 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_105CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_104CDLKICKINGBYLENGTH[] = " CDLKICKINGBYLENGTH(open, high, low, close)\n\n Kicking - bull/bear determined by the longer marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_105CDLKICKINGBYLENGTH = {"CDLKICKINGBYLENGTH", (PyCFunction)__pyx_pw_5talib_6stream_105CDLKICKINGBYLENGTH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_104CDLKICKINGBYLENGTH}; -static PyObject *__pyx_pw_5talib_6stream_105CDLKICKINGBYLENGTH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 1); __PYX_ERR(0, 3127, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 2); __PYX_ERR(0, 3127, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, 3); __PYX_ERR(0, 3127, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLKICKINGBYLENGTH") < 0)) __PYX_ERR(0, 3127, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLKICKINGBYLENGTH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3127, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3127, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3127, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3127, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3127, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_104CDLKICKINGBYLENGTH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_104CDLKICKINGBYLENGTH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLKICKINGBYLENGTH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3149 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3150 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__492, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3150, __pyx_L1_error) - - /* "talib/stream.pyx":3149 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3151 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3152 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__493, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3152, __pyx_L1_error) - - /* "talib/stream.pyx":3151 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3153 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3154 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3154, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3153 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3155 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3156 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3157 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__494, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3157, __pyx_L1_error) - - /* "talib/stream.pyx":3156 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3158 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3159 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__495, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3159, __pyx_L1_error) - - /* "talib/stream.pyx":3158 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3160 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3161 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3161, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3160 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3162 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3163 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3164 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__496, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3164, __pyx_L1_error) - - /* "talib/stream.pyx":3163 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3165 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3166 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__497, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3166, __pyx_L1_error) - - /* "talib/stream.pyx":3165 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3167 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3168 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3167 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3169 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3170 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3171 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__498, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3171, __pyx_L1_error) - - /* "talib/stream.pyx":3170 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3172 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3173 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__499, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3173, __pyx_L1_error) - - /* "talib/stream.pyx":3172 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3174 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3175 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3174 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3176 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3177 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3178 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3179 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__500, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3179, __pyx_L1_error) - - /* "talib/stream.pyx":3178 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3180 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3181 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__501, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3181, __pyx_L1_error) - - /* "talib/stream.pyx":3180 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3182 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3183 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__502, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3183, __pyx_L1_error) - - /* "talib/stream.pyx":3182 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3184 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3185 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLKICKINGBYLENGTH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3186 - * outinteger = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3187 - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLKICKINGBYLENGTH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3127 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLKICKINGBYLENGTH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3191 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_107CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_106CDLLADDERBOTTOM[] = " CDLLADDERBOTTOM(open, high, low, close)\n\n Ladder Bottom (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_107CDLLADDERBOTTOM = {"CDLLADDERBOTTOM", (PyCFunction)__pyx_pw_5talib_6stream_107CDLLADDERBOTTOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_106CDLLADDERBOTTOM}; -static PyObject *__pyx_pw_5talib_6stream_107CDLLADDERBOTTOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLADDERBOTTOM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 1); __PYX_ERR(0, 3191, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 2); __PYX_ERR(0, 3191, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, 3); __PYX_ERR(0, 3191, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLADDERBOTTOM") < 0)) __PYX_ERR(0, 3191, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLADDERBOTTOM", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3191, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3191, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3191, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3191, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3191, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_106CDLLADDERBOTTOM(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_106CDLLADDERBOTTOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLLADDERBOTTOM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3213 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3214 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__503, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3214, __pyx_L1_error) - - /* "talib/stream.pyx":3213 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3215 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3216 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__504, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3216, __pyx_L1_error) - - /* "talib/stream.pyx":3215 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3217 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3218 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3218, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3217 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3219 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3220 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3221 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__505, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3221, __pyx_L1_error) - - /* "talib/stream.pyx":3220 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3222 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3223 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__506, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3223, __pyx_L1_error) - - /* "talib/stream.pyx":3222 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3224 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3225 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3225, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3224 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3226 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3227 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3228 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__507, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3228, __pyx_L1_error) - - /* "talib/stream.pyx":3227 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3229 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3230 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__508, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3230, __pyx_L1_error) - - /* "talib/stream.pyx":3229 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3231 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3232 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3232, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3231 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3233 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3234 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3235 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__509, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3235, __pyx_L1_error) - - /* "talib/stream.pyx":3234 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3236 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3237 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__510, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3237, __pyx_L1_error) - - /* "talib/stream.pyx":3236 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3238 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3239 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3239, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3238 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3240 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3241 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3242 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3243 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__511, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3243, __pyx_L1_error) - - /* "talib/stream.pyx":3242 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3244 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3245 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__512, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3245, __pyx_L1_error) - - /* "talib/stream.pyx":3244 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3246 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3247 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__513, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3247, __pyx_L1_error) - - /* "talib/stream.pyx":3246 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3248 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3249 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLADDERBOTTOM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3250 - * outinteger = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3251 - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLADDERBOTTOM", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3191 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLLADDERBOTTOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3255 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_109CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_108CDLLONGLEGGEDDOJI[] = " CDLLONGLEGGEDDOJI(open, high, low, close)\n\n Long Legged Doji (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_109CDLLONGLEGGEDDOJI = {"CDLLONGLEGGEDDOJI", (PyCFunction)__pyx_pw_5talib_6stream_109CDLLONGLEGGEDDOJI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_108CDLLONGLEGGEDDOJI}; -static PyObject *__pyx_pw_5talib_6stream_109CDLLONGLEGGEDDOJI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 1); __PYX_ERR(0, 3255, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 2); __PYX_ERR(0, 3255, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, 3); __PYX_ERR(0, 3255, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLEGGEDDOJI") < 0)) __PYX_ERR(0, 3255, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLONGLEGGEDDOJI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3255, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3255, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3255, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3255, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3255, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_108CDLLONGLEGGEDDOJI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_108CDLLONGLEGGEDDOJI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLLONGLEGGEDDOJI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3277 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3278 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__514, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3278, __pyx_L1_error) - - /* "talib/stream.pyx":3277 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3279 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3280 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__515, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3280, __pyx_L1_error) - - /* "talib/stream.pyx":3279 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3281 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3282 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3282, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3281 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3283 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3284 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3285 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__516, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3285, __pyx_L1_error) - - /* "talib/stream.pyx":3284 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3286 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3287 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__517, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3287, __pyx_L1_error) - - /* "talib/stream.pyx":3286 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3288 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3289 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3289, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3288 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3290 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3291 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3292 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__518, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3292, __pyx_L1_error) - - /* "talib/stream.pyx":3291 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3293 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3294 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__519, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3294, __pyx_L1_error) - - /* "talib/stream.pyx":3293 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3295 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3296 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3296, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3295 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3297 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3298 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3299 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__520, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3299, __pyx_L1_error) - - /* "talib/stream.pyx":3298 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3300 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3301 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__521, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3301, __pyx_L1_error) - - /* "talib/stream.pyx":3300 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3302 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3303 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3303, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3302 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3304 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3305 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3306 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3307 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__522, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3307, __pyx_L1_error) - - /* "talib/stream.pyx":3306 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3308 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3309 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__523, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3309, __pyx_L1_error) - - /* "talib/stream.pyx":3308 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3310 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3311 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__524, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3311, __pyx_L1_error) - - /* "talib/stream.pyx":3310 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3312 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3313 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLONGLEGGEDDOJI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3314 - * outinteger = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3315 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLEGGEDDOJI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3255 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLLONGLEGGEDDOJI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3319 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_111CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_110CDLLONGLINE[] = " CDLLONGLINE(open, high, low, close)\n\n Long Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_111CDLLONGLINE = {"CDLLONGLINE", (PyCFunction)__pyx_pw_5talib_6stream_111CDLLONGLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_110CDLLONGLINE}; -static PyObject *__pyx_pw_5talib_6stream_111CDLLONGLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLLONGLINE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 1); __PYX_ERR(0, 3319, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 2); __PYX_ERR(0, 3319, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, 3); __PYX_ERR(0, 3319, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLLONGLINE") < 0)) __PYX_ERR(0, 3319, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLLONGLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3319, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3319, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_110CDLLONGLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_110CDLLONGLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLLONGLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3341 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3342 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__525, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3342, __pyx_L1_error) - - /* "talib/stream.pyx":3341 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3343 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3344 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__526, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3344, __pyx_L1_error) - - /* "talib/stream.pyx":3343 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3345 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3346 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3346, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3345 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3347 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3348 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3349 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__527, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3349, __pyx_L1_error) - - /* "talib/stream.pyx":3348 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3350 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3351 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__528, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3351, __pyx_L1_error) - - /* "talib/stream.pyx":3350 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3352 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3353 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3353, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3352 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3354 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3355 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3356 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__529, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3356, __pyx_L1_error) - - /* "talib/stream.pyx":3355 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3357 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3358 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__530, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3358, __pyx_L1_error) - - /* "talib/stream.pyx":3357 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3359 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3360 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3360, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3359 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3361 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3362 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3363 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__531, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3363, __pyx_L1_error) - - /* "talib/stream.pyx":3362 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3364 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3365 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__532, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3365, __pyx_L1_error) - - /* "talib/stream.pyx":3364 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3366 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3367 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3367, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3366 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3368 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3369 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3370 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3371 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__533, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3371, __pyx_L1_error) - - /* "talib/stream.pyx":3370 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3372 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3373 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__534, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3373, __pyx_L1_error) - - /* "talib/stream.pyx":3372 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3374 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3375 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__535, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3375, __pyx_L1_error) - - /* "talib/stream.pyx":3374 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3376 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLINE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3377 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLLONGLINE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLLONGLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3378 - * outinteger = 0 - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLINE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLLONGLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3379 - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLLONGLINE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3319 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLLONGLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3383 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_113CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_112CDLMARUBOZU[] = " CDLMARUBOZU(open, high, low, close)\n\n Marubozu (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_113CDLMARUBOZU = {"CDLMARUBOZU", (PyCFunction)__pyx_pw_5talib_6stream_113CDLMARUBOZU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_112CDLMARUBOZU}; -static PyObject *__pyx_pw_5talib_6stream_113CDLMARUBOZU(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMARUBOZU (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 1); __PYX_ERR(0, 3383, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 2); __PYX_ERR(0, 3383, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, 3); __PYX_ERR(0, 3383, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMARUBOZU") < 0)) __PYX_ERR(0, 3383, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMARUBOZU", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3383, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3383, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3383, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3383, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3383, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_112CDLMARUBOZU(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_112CDLMARUBOZU(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLMARUBOZU", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3405 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3406 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__536, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3406, __pyx_L1_error) - - /* "talib/stream.pyx":3405 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3407 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3408 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__537, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3408, __pyx_L1_error) - - /* "talib/stream.pyx":3407 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3409 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3410 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3410, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3409 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3411 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3412 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3413 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__538, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3413, __pyx_L1_error) - - /* "talib/stream.pyx":3412 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3414 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3415 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__539, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3415, __pyx_L1_error) - - /* "talib/stream.pyx":3414 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3416 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3417 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3417, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3416 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3418 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3419 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3420 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__540, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3420, __pyx_L1_error) - - /* "talib/stream.pyx":3419 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3421 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3422 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__541, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3422, __pyx_L1_error) - - /* "talib/stream.pyx":3421 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3423 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3424 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3424, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3423 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3425 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3426 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3427 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__542, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3427, __pyx_L1_error) - - /* "talib/stream.pyx":3426 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3428 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3429 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__543, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3429, __pyx_L1_error) - - /* "talib/stream.pyx":3428 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3430 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3431 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3431, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3430 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3432 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3433 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3434 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3435 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__544, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3435, __pyx_L1_error) - - /* "talib/stream.pyx":3434 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3436 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3437 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__545, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3437, __pyx_L1_error) - - /* "talib/stream.pyx":3436 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3438 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3439 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__546, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3439, __pyx_L1_error) - - /* "talib/stream.pyx":3438 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3440 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3441 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMARUBOZU", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMARUBOZU((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3442 - * outinteger = 0 - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMARUBOZU, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3443 - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMARUBOZU", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3383 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLMARUBOZU", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3447 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_115CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_114CDLMATCHINGLOW[] = " CDLMATCHINGLOW(open, high, low, close)\n\n Matching Low (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_115CDLMATCHINGLOW = {"CDLMATCHINGLOW", (PyCFunction)__pyx_pw_5talib_6stream_115CDLMATCHINGLOW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_114CDLMATCHINGLOW}; -static PyObject *__pyx_pw_5talib_6stream_115CDLMATCHINGLOW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMATCHINGLOW (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 1); __PYX_ERR(0, 3447, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 2); __PYX_ERR(0, 3447, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, 3); __PYX_ERR(0, 3447, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATCHINGLOW") < 0)) __PYX_ERR(0, 3447, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMATCHINGLOW", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3447, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3447, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3447, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3447, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3447, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_114CDLMATCHINGLOW(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_114CDLMATCHINGLOW(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLMATCHINGLOW", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3469 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3470 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__547, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3470, __pyx_L1_error) - - /* "talib/stream.pyx":3469 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3471 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3472 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__548, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3472, __pyx_L1_error) - - /* "talib/stream.pyx":3471 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3473 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3474 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3474, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3473 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3475 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3476 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3477 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__549, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3477, __pyx_L1_error) - - /* "talib/stream.pyx":3476 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3478 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3479 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__550, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3479, __pyx_L1_error) - - /* "talib/stream.pyx":3478 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3480 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3481 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3481, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3480 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3482 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3483 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3484 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__551, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3484, __pyx_L1_error) - - /* "talib/stream.pyx":3483 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3485 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3486 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__552, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3486, __pyx_L1_error) - - /* "talib/stream.pyx":3485 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3487 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3488 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3488, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3487 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3489 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3490 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3491 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__553, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3491, __pyx_L1_error) - - /* "talib/stream.pyx":3490 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3492 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3493 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__554, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3493, __pyx_L1_error) - - /* "talib/stream.pyx":3492 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3494 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3495 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3495, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3494 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3496 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3497 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3498 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3499 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__555, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3499, __pyx_L1_error) - - /* "talib/stream.pyx":3498 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3500 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3501 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__556, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3501, __pyx_L1_error) - - /* "talib/stream.pyx":3500 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3502 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3503 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__557, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3503, __pyx_L1_error) - - /* "talib/stream.pyx":3502 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3504 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3505 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMATCHINGLOW((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3506 - * outinteger = 0 - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3507 - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATCHINGLOW", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3447 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLMATCHINGLOW", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_117CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_116CDLMATHOLD[] = " CDLMATHOLD(open, high, low, close[, penetration=?])\n\n Mat Hold (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.5\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_117CDLMATHOLD = {"CDLMATHOLD", (PyCFunction)__pyx_pw_5talib_6stream_117CDLMATHOLD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_116CDLMATHOLD}; -static PyObject *__pyx_pw_5talib_6stream_117CDLMATHOLD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMATHOLD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 1); __PYX_ERR(0, 3511, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 2); __PYX_ERR(0, 3511, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, 3); __PYX_ERR(0, 3511, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMATHOLD") < 0)) __PYX_ERR(0, 3511, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3511, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.5); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMATHOLD", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3511, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3511, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3511, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3511, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3511, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_116CDLMATHOLD(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_116CDLMATHOLD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLMATHOLD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3535 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3536 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__558, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3536, __pyx_L1_error) - - /* "talib/stream.pyx":3535 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3537 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3538 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__559, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3538, __pyx_L1_error) - - /* "talib/stream.pyx":3537 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3539 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3540 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3540, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3539 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3541 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3542 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3543 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__560, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3543, __pyx_L1_error) - - /* "talib/stream.pyx":3542 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3544 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3545 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__561, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3545, __pyx_L1_error) - - /* "talib/stream.pyx":3544 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3546 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3547 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3547, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3546 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3548 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3549 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3550 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__562, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3550, __pyx_L1_error) - - /* "talib/stream.pyx":3549 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3551 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3552 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__563, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3552, __pyx_L1_error) - - /* "talib/stream.pyx":3551 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3553 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3554 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3554, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3553 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3555 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3556 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3557 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__564, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3557, __pyx_L1_error) - - /* "talib/stream.pyx":3556 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3558 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3559 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__565, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3559, __pyx_L1_error) - - /* "talib/stream.pyx":3558 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3560 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3561 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3561, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3560 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3562 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3563 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3564 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3565 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__566, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3565, __pyx_L1_error) - - /* "talib/stream.pyx":3564 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3566 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3567 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__567, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3567, __pyx_L1_error) - - /* "talib/stream.pyx":3566 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3568 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3569 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__568, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3569, __pyx_L1_error) - - /* "talib/stream.pyx":3568 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3570 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATHOLD", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3571 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMATHOLD", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMATHOLD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3572 - * outinteger = 0 - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATHOLD", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMATHOLD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3573 - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMATHOLD", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLMATHOLD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_119CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_118CDLMORNINGDOJISTAR[] = " CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?])\n\n Morning Doji Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_119CDLMORNINGDOJISTAR = {"CDLMORNINGDOJISTAR", (PyCFunction)__pyx_pw_5talib_6stream_119CDLMORNINGDOJISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_118CDLMORNINGDOJISTAR}; -static PyObject *__pyx_pw_5talib_6stream_119CDLMORNINGDOJISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 1); __PYX_ERR(0, 3577, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 2); __PYX_ERR(0, 3577, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, 3); __PYX_ERR(0, 3577, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGDOJISTAR") < 0)) __PYX_ERR(0, 3577, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3577, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMORNINGDOJISTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3577, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3577, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3577, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3577, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3577, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_118CDLMORNINGDOJISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_118CDLMORNINGDOJISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLMORNINGDOJISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3601 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3602 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__569, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3602, __pyx_L1_error) - - /* "talib/stream.pyx":3601 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3603 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3604 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__570, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3604, __pyx_L1_error) - - /* "talib/stream.pyx":3603 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3605 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3606 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3606, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3605 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3607 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3608 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3609 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__571, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3609, __pyx_L1_error) - - /* "talib/stream.pyx":3608 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3610 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3611 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__572, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3611, __pyx_L1_error) - - /* "talib/stream.pyx":3610 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3612 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3613 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3613, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3612 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3614 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3615 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3616 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__573, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3616, __pyx_L1_error) - - /* "talib/stream.pyx":3615 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3617 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3618 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__574, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3618, __pyx_L1_error) - - /* "talib/stream.pyx":3617 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3619 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3620 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3620, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3619 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3621 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3622 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3623 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__575, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3623, __pyx_L1_error) - - /* "talib/stream.pyx":3622 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3624 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3625 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__576, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3625, __pyx_L1_error) - - /* "talib/stream.pyx":3624 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3626 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3627 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3627, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3626 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3628 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3629 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3630 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3631 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__577, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3631, __pyx_L1_error) - - /* "talib/stream.pyx":3630 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3632 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3633 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__578, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3633, __pyx_L1_error) - - /* "talib/stream.pyx":3632 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3634 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3635 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__579, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3635, __pyx_L1_error) - - /* "talib/stream.pyx":3634 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3636 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3637 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMORNINGDOJISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3638 - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3639 - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGDOJISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLMORNINGDOJISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3643 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_121CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_120CDLMORNINGSTAR[] = " CDLMORNINGSTAR(open, high, low, close[, penetration=?])\n\n Morning Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Parameters:\n penetration: 0.3\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_121CDLMORNINGSTAR = {"CDLMORNINGSTAR", (PyCFunction)__pyx_pw_5talib_6stream_121CDLMORNINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_120CDLMORNINGSTAR}; -static PyObject *__pyx_pw_5talib_6stream_121CDLMORNINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - double __pyx_v_penetration; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLMORNINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_penetration,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 1); __PYX_ERR(0, 3643, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 2); __PYX_ERR(0, 3643, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, 3); __PYX_ERR(0, 3643, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_penetration); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLMORNINGSTAR") < 0)) __PYX_ERR(0, 3643, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_penetration = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_penetration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3643, __pyx_L3_error) - } else { - __pyx_v_penetration = ((double)0.3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLMORNINGSTAR", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3643, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3643, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3643, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3643, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3643, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_120CDLMORNINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_penetration); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_120CDLMORNINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, double __pyx_v_penetration) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLMORNINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3667 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3668 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__580, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3668, __pyx_L1_error) - - /* "talib/stream.pyx":3667 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3669 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3670 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__581, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3670, __pyx_L1_error) - - /* "talib/stream.pyx":3669 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3671 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3672 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3672, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3671 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3673 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3674 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3675 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__582, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3675, __pyx_L1_error) - - /* "talib/stream.pyx":3674 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3676 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3677 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__583, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3677, __pyx_L1_error) - - /* "talib/stream.pyx":3676 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3678 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3679 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3679, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3678 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3680 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3681 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3682 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__584, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3682, __pyx_L1_error) - - /* "talib/stream.pyx":3681 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3683 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3684 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__585, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3684, __pyx_L1_error) - - /* "talib/stream.pyx":3683 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3685 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3686 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3686, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3685 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3687 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3688 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3689 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__586, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3689, __pyx_L1_error) - - /* "talib/stream.pyx":3688 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3690 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3691 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__587, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3691, __pyx_L1_error) - - /* "talib/stream.pyx":3690 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3692 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3693 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3693, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3692 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3694 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3695 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3696 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3697 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__588, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3697, __pyx_L1_error) - - /* "talib/stream.pyx":3696 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3698 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3699 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__589, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3699, __pyx_L1_error) - - /* "talib/stream.pyx":3698 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3700 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3701 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__590, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3701, __pyx_L1_error) - - /* "talib/stream.pyx":3700 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3702 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3703 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLMORNINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_penetration, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3704 - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3705 - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLMORNINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3643 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLMORNINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3709 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_123CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_122CDLONNECK[] = " CDLONNECK(open, high, low, close)\n\n On-Neck Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_123CDLONNECK = {"CDLONNECK", (PyCFunction)__pyx_pw_5talib_6stream_123CDLONNECK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_122CDLONNECK}; -static PyObject *__pyx_pw_5talib_6stream_123CDLONNECK(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLONNECK (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 1); __PYX_ERR(0, 3709, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 2); __PYX_ERR(0, 3709, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, 3); __PYX_ERR(0, 3709, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLONNECK") < 0)) __PYX_ERR(0, 3709, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLONNECK", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3709, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3709, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3709, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3709, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3709, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_122CDLONNECK(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_122CDLONNECK(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLONNECK", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3731 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3732 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__591, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3732, __pyx_L1_error) - - /* "talib/stream.pyx":3731 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3733 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3734 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__592, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3734, __pyx_L1_error) - - /* "talib/stream.pyx":3733 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3735 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3736 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3736, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3735 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3737 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3738 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3739 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__593, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3739, __pyx_L1_error) - - /* "talib/stream.pyx":3738 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3740 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3741 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__594, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3741, __pyx_L1_error) - - /* "talib/stream.pyx":3740 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3742 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3743 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3743, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3742 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3744 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3745 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3746 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__595, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3746, __pyx_L1_error) - - /* "talib/stream.pyx":3745 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3747 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3748 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__596, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3748, __pyx_L1_error) - - /* "talib/stream.pyx":3747 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3749 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3750 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3750, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3749 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3751 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3752 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3753 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__597, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3753, __pyx_L1_error) - - /* "talib/stream.pyx":3752 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3754 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3755 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__598, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3755, __pyx_L1_error) - - /* "talib/stream.pyx":3754 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3756 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3757 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3757, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3756 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3758 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3759 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3760 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3761 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__599, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3761, __pyx_L1_error) - - /* "talib/stream.pyx":3760 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3762 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3763 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__600, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3763, __pyx_L1_error) - - /* "talib/stream.pyx":3762 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3764 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3765 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__601, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3765, __pyx_L1_error) - - /* "talib/stream.pyx":3764 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3766 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLONNECK", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3767 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLONNECK", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLONNECK((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3768 - * outinteger = 0 - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLONNECK", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLONNECK, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3769 - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLONNECK", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3709 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLONNECK", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_125CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_124CDLPIERCING[] = " CDLPIERCING(open, high, low, close)\n\n Piercing Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_125CDLPIERCING = {"CDLPIERCING", (PyCFunction)__pyx_pw_5talib_6stream_125CDLPIERCING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_124CDLPIERCING}; -static PyObject *__pyx_pw_5talib_6stream_125CDLPIERCING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLPIERCING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 1); __PYX_ERR(0, 3773, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 2); __PYX_ERR(0, 3773, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, 3); __PYX_ERR(0, 3773, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLPIERCING") < 0)) __PYX_ERR(0, 3773, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLPIERCING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3773, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3773, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_124CDLPIERCING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_124CDLPIERCING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLPIERCING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3795 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3796 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__602, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3796, __pyx_L1_error) - - /* "talib/stream.pyx":3795 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3797 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3798 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__603, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3798, __pyx_L1_error) - - /* "talib/stream.pyx":3797 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3799 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3800 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3800, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3799 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3801 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3802 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3803 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__604, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3803, __pyx_L1_error) - - /* "talib/stream.pyx":3802 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3804 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3805 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__605, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3805, __pyx_L1_error) - - /* "talib/stream.pyx":3804 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3806 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3807 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3807, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3806 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3808 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3809 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3810 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__606, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3810, __pyx_L1_error) - - /* "talib/stream.pyx":3809 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3811 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3812 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__607, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3812, __pyx_L1_error) - - /* "talib/stream.pyx":3811 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3813 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3814 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3814, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3813 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3815 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3816 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3817 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__608, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3817, __pyx_L1_error) - - /* "talib/stream.pyx":3816 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3818 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3819 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__609, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3819, __pyx_L1_error) - - /* "talib/stream.pyx":3818 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3820 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3821 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3821, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3820 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3822 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3823 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3824 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3825 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__610, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3825, __pyx_L1_error) - - /* "talib/stream.pyx":3824 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3826 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3827 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__611, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3827, __pyx_L1_error) - - /* "talib/stream.pyx":3826 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3828 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3829 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__612, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3829, __pyx_L1_error) - - /* "talib/stream.pyx":3828 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3830 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLPIERCING", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3831 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLPIERCING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLPIERCING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3832 - * outinteger = 0 - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLPIERCING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLPIERCING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3833 - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLPIERCING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLPIERCING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_127CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_126CDLRICKSHAWMAN[] = " CDLRICKSHAWMAN(open, high, low, close)\n\n Rickshaw Man (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_127CDLRICKSHAWMAN = {"CDLRICKSHAWMAN", (PyCFunction)__pyx_pw_5talib_6stream_127CDLRICKSHAWMAN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_126CDLRICKSHAWMAN}; -static PyObject *__pyx_pw_5talib_6stream_127CDLRICKSHAWMAN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLRICKSHAWMAN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 1); __PYX_ERR(0, 3837, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 2); __PYX_ERR(0, 3837, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, 3); __PYX_ERR(0, 3837, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRICKSHAWMAN") < 0)) __PYX_ERR(0, 3837, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLRICKSHAWMAN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3837, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3837, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3837, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3837, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3837, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_126CDLRICKSHAWMAN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_126CDLRICKSHAWMAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLRICKSHAWMAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3859 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3860 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__613, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3860, __pyx_L1_error) - - /* "talib/stream.pyx":3859 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__614, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3862, __pyx_L1_error) - - /* "talib/stream.pyx":3861 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3864 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3864, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3863 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3865 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__615, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3867, __pyx_L1_error) - - /* "talib/stream.pyx":3866 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__616, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3869, __pyx_L1_error) - - /* "talib/stream.pyx":3868 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3871 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3871, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3870 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3872 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__617, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3874, __pyx_L1_error) - - /* "talib/stream.pyx":3873 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__618, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3876, __pyx_L1_error) - - /* "talib/stream.pyx":3875 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3878 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3878, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3877 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3879 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__619, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3881, __pyx_L1_error) - - /* "talib/stream.pyx":3880 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__620, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3883, __pyx_L1_error) - - /* "talib/stream.pyx":3882 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3885 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3885, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3884 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3886 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3887 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__621, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3889, __pyx_L1_error) - - /* "talib/stream.pyx":3888 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__622, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3891, __pyx_L1_error) - - /* "talib/stream.pyx":3890 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__623, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3893, __pyx_L1_error) - - /* "talib/stream.pyx":3892 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3894 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3895 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLRICKSHAWMAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3896 - * outinteger = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3897 - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRICKSHAWMAN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLRICKSHAWMAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3901 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_129CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_128CDLRISEFALL3METHODS[] = " CDLRISEFALL3METHODS(open, high, low, close)\n\n Rising/Falling Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_129CDLRISEFALL3METHODS = {"CDLRISEFALL3METHODS", (PyCFunction)__pyx_pw_5talib_6stream_129CDLRISEFALL3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_128CDLRISEFALL3METHODS}; -static PyObject *__pyx_pw_5talib_6stream_129CDLRISEFALL3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 1); __PYX_ERR(0, 3901, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 2); __PYX_ERR(0, 3901, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, 3); __PYX_ERR(0, 3901, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLRISEFALL3METHODS") < 0)) __PYX_ERR(0, 3901, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLRISEFALL3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3901, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3901, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3901, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3901, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3901, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_128CDLRISEFALL3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_128CDLRISEFALL3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLRISEFALL3METHODS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3923 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3924 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__624, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3924, __pyx_L1_error) - - /* "talib/stream.pyx":3923 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3925 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3926 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__625, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3926, __pyx_L1_error) - - /* "talib/stream.pyx":3925 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3927 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3928 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3928, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3927 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3929 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3930 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3931 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__626, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3931, __pyx_L1_error) - - /* "talib/stream.pyx":3930 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3932 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3933 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__627, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3933, __pyx_L1_error) - - /* "talib/stream.pyx":3932 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3934 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3935 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3935, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3934 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":3936 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":3937 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3938 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__628, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3938, __pyx_L1_error) - - /* "talib/stream.pyx":3937 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":3939 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3940 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__629, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3940, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3940, __pyx_L1_error) - - /* "talib/stream.pyx":3939 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3941 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3942 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3942, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3941 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":3943 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":3944 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3945 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__630, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3945, __pyx_L1_error) - - /* "talib/stream.pyx":3944 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":3946 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3947 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__631, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3947, __pyx_L1_error) - - /* "talib/stream.pyx":3946 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3948 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3949 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3949, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3948 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":3950 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":3951 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":3952 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3953 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__632, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3953, __pyx_L1_error) - - /* "talib/stream.pyx":3952 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":3954 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3955 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__633, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3955, __pyx_L1_error) - - /* "talib/stream.pyx":3954 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":3956 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3957 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__634, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3957, __pyx_L1_error) - - /* "talib/stream.pyx":3956 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":3958 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":3959 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLRISEFALL3METHODS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":3960 - * outinteger = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":3961 - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLRISEFALL3METHODS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3901 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLRISEFALL3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":3965 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_131CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_130CDLSEPARATINGLINES[] = " CDLSEPARATINGLINES(open, high, low, close)\n\n Separating Lines (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_131CDLSEPARATINGLINES = {"CDLSEPARATINGLINES", (PyCFunction)__pyx_pw_5talib_6stream_131CDLSEPARATINGLINES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_130CDLSEPARATINGLINES}; -static PyObject *__pyx_pw_5talib_6stream_131CDLSEPARATINGLINES(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSEPARATINGLINES (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 1); __PYX_ERR(0, 3965, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 2); __PYX_ERR(0, 3965, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, 3); __PYX_ERR(0, 3965, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSEPARATINGLINES") < 0)) __PYX_ERR(0, 3965, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSEPARATINGLINES", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3965, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 3965, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 3965, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 3965, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 3965, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_130CDLSEPARATINGLINES(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_130CDLSEPARATINGLINES(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSEPARATINGLINES", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":3987 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3988 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__635, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3988, __pyx_L1_error) - - /* "talib/stream.pyx":3987 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":3989 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3990 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__636, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3990, __pyx_L1_error) - - /* "talib/stream.pyx":3989 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3991 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3992 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3992, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3991 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":3993 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":3994 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3995 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__637, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3995, __pyx_L1_error) - - /* "talib/stream.pyx":3994 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":3996 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3997 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__638, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 3997, __pyx_L1_error) - - /* "talib/stream.pyx":3996 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":3998 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":3999 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3999, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":3998 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4000 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4001 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4002 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__639, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4002, __pyx_L1_error) - - /* "talib/stream.pyx":4001 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4003 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4004 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__640, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4004, __pyx_L1_error) - - /* "talib/stream.pyx":4003 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4005 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4006 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4006, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4005 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4007 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4008 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4009 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__641, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4009, __pyx_L1_error) - - /* "talib/stream.pyx":4008 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4010 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4011 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__642, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4011, __pyx_L1_error) - - /* "talib/stream.pyx":4010 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4012 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4013 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4013, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4012 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4014 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4015 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4016 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4017 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__643, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4017, __pyx_L1_error) - - /* "talib/stream.pyx":4016 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4018 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4019 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__644, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4019, __pyx_L1_error) - - /* "talib/stream.pyx":4018 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4020 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4021 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__645, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4021, __pyx_L1_error) - - /* "talib/stream.pyx":4020 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4022 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4023 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSEPARATINGLINES((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4024 - * outinteger = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4025 - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSEPARATINGLINES", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":3965 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSEPARATINGLINES", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4029 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_133CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_132CDLSHOOTINGSTAR[] = " CDLSHOOTINGSTAR(open, high, low, close)\n\n Shooting Star (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_133CDLSHOOTINGSTAR = {"CDLSHOOTINGSTAR", (PyCFunction)__pyx_pw_5talib_6stream_133CDLSHOOTINGSTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_132CDLSHOOTINGSTAR}; -static PyObject *__pyx_pw_5talib_6stream_133CDLSHOOTINGSTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 1); __PYX_ERR(0, 4029, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 2); __PYX_ERR(0, 4029, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, 3); __PYX_ERR(0, 4029, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHOOTINGSTAR") < 0)) __PYX_ERR(0, 4029, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSHOOTINGSTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4029, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4029, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4029, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4029, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4029, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_132CDLSHOOTINGSTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_132CDLSHOOTINGSTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSHOOTINGSTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4051 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4052 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__646, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4052, __pyx_L1_error) - - /* "talib/stream.pyx":4051 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4053 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4054 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__647, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4054, __pyx_L1_error) - - /* "talib/stream.pyx":4053 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4055 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4056 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4056, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4055 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4057 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4058 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4059 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__648, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4059, __pyx_L1_error) - - /* "talib/stream.pyx":4058 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4060 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4061 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__649, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4061, __pyx_L1_error) - - /* "talib/stream.pyx":4060 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4062 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4063 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4063, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4062 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4064 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4065 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4066 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__650, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4066, __pyx_L1_error) - - /* "talib/stream.pyx":4065 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4067 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4068 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__651, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4068, __pyx_L1_error) - - /* "talib/stream.pyx":4067 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4069 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4070 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4070, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4069 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4071 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4072 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4073 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__652, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4073, __pyx_L1_error) - - /* "talib/stream.pyx":4072 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4074 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4075 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__653, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4075, __pyx_L1_error) - - /* "talib/stream.pyx":4074 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4076 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4077 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4077, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4076 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4078 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4079 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4080 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4081 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__654, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4081, __pyx_L1_error) - - /* "talib/stream.pyx":4080 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4082 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4083 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__655, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4083, __pyx_L1_error) - - /* "talib/stream.pyx":4082 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4084 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4085 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__656, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4085, __pyx_L1_error) - - /* "talib/stream.pyx":4084 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4086 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4087 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSHOOTINGSTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4088 - * outinteger = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4089 - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHOOTINGSTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4029 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSHOOTINGSTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4093 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_135CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_134CDLSHORTLINE[] = " CDLSHORTLINE(open, high, low, close)\n\n Short Line Candle (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_135CDLSHORTLINE = {"CDLSHORTLINE", (PyCFunction)__pyx_pw_5talib_6stream_135CDLSHORTLINE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_134CDLSHORTLINE}; -static PyObject *__pyx_pw_5talib_6stream_135CDLSHORTLINE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSHORTLINE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 1); __PYX_ERR(0, 4093, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 2); __PYX_ERR(0, 4093, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, 3); __PYX_ERR(0, 4093, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSHORTLINE") < 0)) __PYX_ERR(0, 4093, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSHORTLINE", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4093, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4093, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4093, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4093, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4093, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_134CDLSHORTLINE(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_134CDLSHORTLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSHORTLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4115 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4116 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__657, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4116, __pyx_L1_error) - - /* "talib/stream.pyx":4115 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4117 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4118 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__658, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4118, __pyx_L1_error) - - /* "talib/stream.pyx":4117 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4119 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4120 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4120, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4119 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4121 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4122 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4123 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__659, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4123, __pyx_L1_error) - - /* "talib/stream.pyx":4122 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4124 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4125 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__660, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4125, __pyx_L1_error) - - /* "talib/stream.pyx":4124 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4126 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4127 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4127, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4126 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4128 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4129 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4130 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__661, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4130, __pyx_L1_error) - - /* "talib/stream.pyx":4129 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4131 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4132 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__662, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4132, __pyx_L1_error) - - /* "talib/stream.pyx":4131 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4133 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4134 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4134, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4133 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4135 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4136 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4137 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__663, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4137, __pyx_L1_error) - - /* "talib/stream.pyx":4136 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4138 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4139 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__664, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4139, __pyx_L1_error) - - /* "talib/stream.pyx":4138 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4140 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4141 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4141, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4140 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4142 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4143 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4144 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4145 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__665, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4145, __pyx_L1_error) - - /* "talib/stream.pyx":4144 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4146 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4147 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__666, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4147, __pyx_L1_error) - - /* "talib/stream.pyx":4146 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4148 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4149 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__667, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4149, __pyx_L1_error) - - /* "talib/stream.pyx":4148 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4150 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4151 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSHORTLINE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSHORTLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4152 - * outinteger = 0 - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSHORTLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4153 - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSHORTLINE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4093 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSHORTLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4157 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_137CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_136CDLSPINNINGTOP[] = " CDLSPINNINGTOP(open, high, low, close)\n\n Spinning Top (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_137CDLSPINNINGTOP = {"CDLSPINNINGTOP", (PyCFunction)__pyx_pw_5talib_6stream_137CDLSPINNINGTOP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_136CDLSPINNINGTOP}; -static PyObject *__pyx_pw_5talib_6stream_137CDLSPINNINGTOP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSPINNINGTOP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 1); __PYX_ERR(0, 4157, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 2); __PYX_ERR(0, 4157, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, 3); __PYX_ERR(0, 4157, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSPINNINGTOP") < 0)) __PYX_ERR(0, 4157, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSPINNINGTOP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4157, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4157, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4157, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4157, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4157, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_136CDLSPINNINGTOP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_136CDLSPINNINGTOP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSPINNINGTOP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4179 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4180 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__668, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4180, __pyx_L1_error) - - /* "talib/stream.pyx":4179 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4181 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4182 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__669, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4182, __pyx_L1_error) - - /* "talib/stream.pyx":4181 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4183 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4184 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4184, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4183 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4185 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4186 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4187 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__670, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4187, __pyx_L1_error) - - /* "talib/stream.pyx":4186 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4188 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4189 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__671, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4189, __pyx_L1_error) - - /* "talib/stream.pyx":4188 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4190 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4191 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4191, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4190 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4192 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4193 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4194 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__672, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4194, __pyx_L1_error) - - /* "talib/stream.pyx":4193 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4195 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4196 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__673, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4196, __pyx_L1_error) - - /* "talib/stream.pyx":4195 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4197 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4198 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4198, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4197 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4199 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4200 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4201 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__674, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4201, __pyx_L1_error) - - /* "talib/stream.pyx":4200 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4202 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4203 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__675, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4203, __pyx_L1_error) - - /* "talib/stream.pyx":4202 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4204 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4205 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4205, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4204 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4206 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4207 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4208 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4209 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__676, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4209, __pyx_L1_error) - - /* "talib/stream.pyx":4208 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4210 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4211 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__677, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4211, __pyx_L1_error) - - /* "talib/stream.pyx":4210 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4212 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4213 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__678, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4213, __pyx_L1_error) - - /* "talib/stream.pyx":4212 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4214 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4215 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSPINNINGTOP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4216 - * outinteger = 0 - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4217 - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSPINNINGTOP", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4157 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSPINNINGTOP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4221 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_139CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_138CDLSTALLEDPATTERN[] = " CDLSTALLEDPATTERN(open, high, low, close)\n\n Stalled Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_139CDLSTALLEDPATTERN = {"CDLSTALLEDPATTERN", (PyCFunction)__pyx_pw_5talib_6stream_139CDLSTALLEDPATTERN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_138CDLSTALLEDPATTERN}; -static PyObject *__pyx_pw_5talib_6stream_139CDLSTALLEDPATTERN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 1); __PYX_ERR(0, 4221, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 2); __PYX_ERR(0, 4221, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, 3); __PYX_ERR(0, 4221, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTALLEDPATTERN") < 0)) __PYX_ERR(0, 4221, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSTALLEDPATTERN", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4221, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4221, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4221, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4221, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4221, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_138CDLSTALLEDPATTERN(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_138CDLSTALLEDPATTERN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSTALLEDPATTERN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4243 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4244 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__679, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4244, __pyx_L1_error) - - /* "talib/stream.pyx":4243 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4245 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4246 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__680, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4246, __pyx_L1_error) - - /* "talib/stream.pyx":4245 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4247 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4248 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4248, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4247 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4249 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4250 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4251 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__681, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4251, __pyx_L1_error) - - /* "talib/stream.pyx":4250 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__682, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4253, __pyx_L1_error) - - /* "talib/stream.pyx":4252 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4255 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4255, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4254 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4256 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__683, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4258, __pyx_L1_error) - - /* "talib/stream.pyx":4257 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__684, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4260, __pyx_L1_error) - - /* "talib/stream.pyx":4259 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4262 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4262, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4261 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4263 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__685, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4265, __pyx_L1_error) - - /* "talib/stream.pyx":4264 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__686, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4267, __pyx_L1_error) - - /* "talib/stream.pyx":4266 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4269 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4269, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4268 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4270 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4271 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4272 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4273 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__687, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4273, __pyx_L1_error) - - /* "talib/stream.pyx":4272 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4274 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4275 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__688, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4275, __pyx_L1_error) - - /* "talib/stream.pyx":4274 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4276 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4277 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__689, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4277, __pyx_L1_error) - - /* "talib/stream.pyx":4276 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4278 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4279 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSTALLEDPATTERN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4280 - * outinteger = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4281 - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTALLEDPATTERN", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4221 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSTALLEDPATTERN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4285 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_141CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_140CDLSTICKSANDWICH[] = " CDLSTICKSANDWICH(open, high, low, close)\n\n Stick Sandwich (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_141CDLSTICKSANDWICH = {"CDLSTICKSANDWICH", (PyCFunction)__pyx_pw_5talib_6stream_141CDLSTICKSANDWICH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_140CDLSTICKSANDWICH}; -static PyObject *__pyx_pw_5talib_6stream_141CDLSTICKSANDWICH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLSTICKSANDWICH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 1); __PYX_ERR(0, 4285, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 2); __PYX_ERR(0, 4285, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, 3); __PYX_ERR(0, 4285, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLSTICKSANDWICH") < 0)) __PYX_ERR(0, 4285, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLSTICKSANDWICH", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4285, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4285, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4285, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4285, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4285, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_140CDLSTICKSANDWICH(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_140CDLSTICKSANDWICH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLSTICKSANDWICH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4307 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4308 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__690, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4308, __pyx_L1_error) - - /* "talib/stream.pyx":4307 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4309 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4310 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__691, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4310, __pyx_L1_error) - - /* "talib/stream.pyx":4309 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4311 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4312 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4312, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4311 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4313 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4314 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4315 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__692, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4315, __pyx_L1_error) - - /* "talib/stream.pyx":4314 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4316 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4317 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__693, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4317, __pyx_L1_error) - - /* "talib/stream.pyx":4316 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4318 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4319 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4319, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4318 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4320 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4321 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4322 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__694, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4322, __pyx_L1_error) - - /* "talib/stream.pyx":4321 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4323 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4324 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__695, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4324, __pyx_L1_error) - - /* "talib/stream.pyx":4323 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4325 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4326 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4326, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4325 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4327 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4328 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4329 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__696, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4329, __pyx_L1_error) - - /* "talib/stream.pyx":4328 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4330 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4331 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__697, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4331, __pyx_L1_error) - - /* "talib/stream.pyx":4330 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4332 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4333 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4333, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4332 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4334 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4335 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4336 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4337 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__698, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4337, __pyx_L1_error) - - /* "talib/stream.pyx":4336 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4338 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4339 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__699, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4339, __pyx_L1_error) - - /* "talib/stream.pyx":4338 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4340 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4341 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__700, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4341, __pyx_L1_error) - - /* "talib/stream.pyx":4340 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4342 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4343 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLSTICKSANDWICH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4344 - * outinteger = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4345 - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLSTICKSANDWICH", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4285 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLSTICKSANDWICH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4349 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_143CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_142CDLTAKURI[] = " CDLTAKURI(open, high, low, close)\n\n Takuri (Dragonfly Doji with very long lower shadow) (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_143CDLTAKURI = {"CDLTAKURI", (PyCFunction)__pyx_pw_5talib_6stream_143CDLTAKURI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_142CDLTAKURI}; -static PyObject *__pyx_pw_5talib_6stream_143CDLTAKURI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTAKURI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 1); __PYX_ERR(0, 4349, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 2); __PYX_ERR(0, 4349, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, 3); __PYX_ERR(0, 4349, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTAKURI") < 0)) __PYX_ERR(0, 4349, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTAKURI", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4349, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4349, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4349, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4349, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4349, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_142CDLTAKURI(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_142CDLTAKURI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLTAKURI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4371 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4372 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__701, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4372, __pyx_L1_error) - - /* "talib/stream.pyx":4371 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4373 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4374 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__702, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4374, __pyx_L1_error) - - /* "talib/stream.pyx":4373 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4375 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4376 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4376, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4375 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4377 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4378 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4379 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__703, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4379, __pyx_L1_error) - - /* "talib/stream.pyx":4378 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4380 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4381 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__704, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4381, __pyx_L1_error) - - /* "talib/stream.pyx":4380 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4382 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4383 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4383, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4382 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4384 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4385 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4386 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__705, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4386, __pyx_L1_error) - - /* "talib/stream.pyx":4385 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4387 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4388 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__706, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4388, __pyx_L1_error) - - /* "talib/stream.pyx":4387 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4389 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4390 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4390, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4389 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4391 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4392 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4393 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__707, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4393, __pyx_L1_error) - - /* "talib/stream.pyx":4392 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4394 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4395 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__708, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4395, __pyx_L1_error) - - /* "talib/stream.pyx":4394 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4396 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4397 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4397, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4396 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4398 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4399 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4400 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4401 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__709, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4401, __pyx_L1_error) - - /* "talib/stream.pyx":4400 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4402 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4403 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__710, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4403, __pyx_L1_error) - - /* "talib/stream.pyx":4402 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4404 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4405 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__711, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4405, __pyx_L1_error) - - /* "talib/stream.pyx":4404 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4406 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTAKURI", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4407 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTAKURI", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTAKURI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4408 - * outinteger = 0 - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTAKURI", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTAKURI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4409 - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTAKURI", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4349 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLTAKURI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_145CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_144CDLTASUKIGAP[] = " CDLTASUKIGAP(open, high, low, close)\n\n Tasuki Gap (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_145CDLTASUKIGAP = {"CDLTASUKIGAP", (PyCFunction)__pyx_pw_5talib_6stream_145CDLTASUKIGAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_144CDLTASUKIGAP}; -static PyObject *__pyx_pw_5talib_6stream_145CDLTASUKIGAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTASUKIGAP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 1); __PYX_ERR(0, 4413, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 2); __PYX_ERR(0, 4413, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, 3); __PYX_ERR(0, 4413, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTASUKIGAP") < 0)) __PYX_ERR(0, 4413, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTASUKIGAP", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4413, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4413, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_144CDLTASUKIGAP(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_144CDLTASUKIGAP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLTASUKIGAP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4435 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4436 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__712, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4436, __pyx_L1_error) - - /* "talib/stream.pyx":4435 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4437 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4438 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__713, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4438, __pyx_L1_error) - - /* "talib/stream.pyx":4437 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4439 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4440 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4440, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4439 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4441 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4442 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4443 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__714, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4443, __pyx_L1_error) - - /* "talib/stream.pyx":4442 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4444 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4445 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__715, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4445, __pyx_L1_error) - - /* "talib/stream.pyx":4444 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4446 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4447 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4447, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4446 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4448 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4449 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4450 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4450, __pyx_L1_error) - - /* "talib/stream.pyx":4449 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4451 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4452 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4452, __pyx_L1_error) - - /* "talib/stream.pyx":4451 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4453 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4454 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4454, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4453 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4455 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4456 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4457 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4457, __pyx_L1_error) - - /* "talib/stream.pyx":4456 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4458 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4459 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4459, __pyx_L1_error) - - /* "talib/stream.pyx":4458 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4460 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4461 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4461, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4460 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4462 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4463 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4464 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4465 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4465, __pyx_L1_error) - - /* "talib/stream.pyx":4464 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4466 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4467 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__721, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4467, __pyx_L1_error) - - /* "talib/stream.pyx":4466 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4468 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4469 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__722, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4469, __pyx_L1_error) - - /* "talib/stream.pyx":4468 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4470 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4471 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTASUKIGAP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4472 - * outinteger = 0 - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTASUKIGAP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4473 - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTASUKIGAP", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLTASUKIGAP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4477 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_147CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_146CDLTHRUSTING[] = " CDLTHRUSTING(open, high, low, close)\n\n Thrusting Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_147CDLTHRUSTING = {"CDLTHRUSTING", (PyCFunction)__pyx_pw_5talib_6stream_147CDLTHRUSTING, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_146CDLTHRUSTING}; -static PyObject *__pyx_pw_5talib_6stream_147CDLTHRUSTING(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTHRUSTING (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 1); __PYX_ERR(0, 4477, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 2); __PYX_ERR(0, 4477, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, 3); __PYX_ERR(0, 4477, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTHRUSTING") < 0)) __PYX_ERR(0, 4477, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTHRUSTING", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4477, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4477, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4477, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4477, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4477, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_146CDLTHRUSTING(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_146CDLTHRUSTING(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLTHRUSTING", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4499 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4500 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__723, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4500, __pyx_L1_error) - - /* "talib/stream.pyx":4499 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4501 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4502 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__724, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4502, __pyx_L1_error) - - /* "talib/stream.pyx":4501 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4503 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4504 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4504, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4503 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4505 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4506 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4507 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__725, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4507, __pyx_L1_error) - - /* "talib/stream.pyx":4506 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4508 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4509 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__726, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4509, __pyx_L1_error) - - /* "talib/stream.pyx":4508 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4510 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4511 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4511, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4510 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4512 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4513 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4514 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__727, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4514, __pyx_L1_error) - - /* "talib/stream.pyx":4513 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4515 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4516 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__728, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4516, __pyx_L1_error) - - /* "talib/stream.pyx":4515 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4517 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4518 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4518, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4517 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4519 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4520 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4521 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__729, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4521, __pyx_L1_error) - - /* "talib/stream.pyx":4520 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4522 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4523 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__730, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4523, __pyx_L1_error) - - /* "talib/stream.pyx":4522 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4524 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4525 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4525, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4524 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4526 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4527 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4528 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4529 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__731, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4529, __pyx_L1_error) - - /* "talib/stream.pyx":4528 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4530 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4531 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__732, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4531, __pyx_L1_error) - - /* "talib/stream.pyx":4530 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4532 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4533 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__733, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4533, __pyx_L1_error) - - /* "talib/stream.pyx":4532 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4534 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4535 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTHRUSTING", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTHRUSTING((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4536 - * outinteger = 0 - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTHRUSTING, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4537 - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTHRUSTING", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4477 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLTHRUSTING", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_149CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_148CDLTRISTAR[] = " CDLTRISTAR(open, high, low, close)\n\n Tristar Pattern (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_149CDLTRISTAR = {"CDLTRISTAR", (PyCFunction)__pyx_pw_5talib_6stream_149CDLTRISTAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_148CDLTRISTAR}; -static PyObject *__pyx_pw_5talib_6stream_149CDLTRISTAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLTRISTAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 1); __PYX_ERR(0, 4541, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 2); __PYX_ERR(0, 4541, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, 3); __PYX_ERR(0, 4541, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLTRISTAR") < 0)) __PYX_ERR(0, 4541, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLTRISTAR", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4541, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4541, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4541, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4541, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4541, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_148CDLTRISTAR(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_148CDLTRISTAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLTRISTAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4563 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4564 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__734, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4564, __pyx_L1_error) - - /* "talib/stream.pyx":4563 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4565 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4566 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__735, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4566, __pyx_L1_error) - - /* "talib/stream.pyx":4565 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4567 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4568 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4568, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4567 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4569 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4570 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4571 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__736, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4571, __pyx_L1_error) - - /* "talib/stream.pyx":4570 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4572 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4573 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__737, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4573, __pyx_L1_error) - - /* "talib/stream.pyx":4572 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4574 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4575 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4575, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4574 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4576 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4577 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4578 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__738, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4578, __pyx_L1_error) - - /* "talib/stream.pyx":4577 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4579 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4580 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__739, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4580, __pyx_L1_error) - - /* "talib/stream.pyx":4579 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4581 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4582 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4582, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4581 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4583 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4584 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4585 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__740, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4585, __pyx_L1_error) - - /* "talib/stream.pyx":4584 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4586 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4587 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__741, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4587, __pyx_L1_error) - - /* "talib/stream.pyx":4586 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4588 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4589 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4589, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4588 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4590 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4591 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4592 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4593 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__742, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4593, __pyx_L1_error) - - /* "talib/stream.pyx":4592 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4594 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4595 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__743, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4595, __pyx_L1_error) - - /* "talib/stream.pyx":4594 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4596 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4597 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__744, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4597, __pyx_L1_error) - - /* "talib/stream.pyx":4596 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4598 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTRISTAR", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4599 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLTRISTAR", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLTRISTAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4600 - * outinteger = 0 - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTRISTAR", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLTRISTAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4601 - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLTRISTAR", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLTRISTAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4605 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_151CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_150CDLUNIQUE3RIVER[] = " CDLUNIQUE3RIVER(open, high, low, close)\n\n Unique 3 River (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_151CDLUNIQUE3RIVER = {"CDLUNIQUE3RIVER", (PyCFunction)__pyx_pw_5talib_6stream_151CDLUNIQUE3RIVER, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_150CDLUNIQUE3RIVER}; -static PyObject *__pyx_pw_5talib_6stream_151CDLUNIQUE3RIVER(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 1); __PYX_ERR(0, 4605, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 2); __PYX_ERR(0, 4605, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, 3); __PYX_ERR(0, 4605, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUNIQUE3RIVER") < 0)) __PYX_ERR(0, 4605, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLUNIQUE3RIVER", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4605, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4605, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4605, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4605, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4605, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_150CDLUNIQUE3RIVER(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_150CDLUNIQUE3RIVER(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLUNIQUE3RIVER", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4627 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4628 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__745, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4628, __pyx_L1_error) - - /* "talib/stream.pyx":4627 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4629 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4630 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__746, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4630, __pyx_L1_error) - - /* "talib/stream.pyx":4629 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4631 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4632 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4632, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4631 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4633 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4634 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4635 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__747, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4635, __pyx_L1_error) - - /* "talib/stream.pyx":4634 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4636 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4637 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__748, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4637, __pyx_L1_error) - - /* "talib/stream.pyx":4636 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4638 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4639 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4639, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4638 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4640 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4641 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4642 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__749, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4642, __pyx_L1_error) - - /* "talib/stream.pyx":4641 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4643 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4644 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__750, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4644, __pyx_L1_error) - - /* "talib/stream.pyx":4643 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4645 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4646 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4646, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4645 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4647 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4648 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4649 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__751, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4649, __pyx_L1_error) - - /* "talib/stream.pyx":4648 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4650 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4651 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__752, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4651, __pyx_L1_error) - - /* "talib/stream.pyx":4650 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4652 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4653 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4653, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4652 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4654 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4655 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4656 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4657 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__753, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4657, __pyx_L1_error) - - /* "talib/stream.pyx":4656 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4658 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4659 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__754, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4659, __pyx_L1_error) - - /* "talib/stream.pyx":4658 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4660 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4661 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__755, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4661, __pyx_L1_error) - - /* "talib/stream.pyx":4660 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4662 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4663 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLUNIQUE3RIVER((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4664 - * outinteger = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4665 - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUNIQUE3RIVER", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4605 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLUNIQUE3RIVER", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4669 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_153CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_152CDLUPSIDEGAP2CROWS[] = " CDLUPSIDEGAP2CROWS(open, high, low, close)\n\n Upside Gap Two Crows (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_153CDLUPSIDEGAP2CROWS = {"CDLUPSIDEGAP2CROWS", (PyCFunction)__pyx_pw_5talib_6stream_153CDLUPSIDEGAP2CROWS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_152CDLUPSIDEGAP2CROWS}; -static PyObject *__pyx_pw_5talib_6stream_153CDLUPSIDEGAP2CROWS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 1); __PYX_ERR(0, 4669, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 2); __PYX_ERR(0, 4669, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, 3); __PYX_ERR(0, 4669, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLUPSIDEGAP2CROWS") < 0)) __PYX_ERR(0, 4669, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLUPSIDEGAP2CROWS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4669, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4669, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4669, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4669, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4669, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_152CDLUPSIDEGAP2CROWS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_152CDLUPSIDEGAP2CROWS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLUPSIDEGAP2CROWS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4691 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4692 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__756, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4692, __pyx_L1_error) - - /* "talib/stream.pyx":4691 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4693 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4694 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__757, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4694, __pyx_L1_error) - - /* "talib/stream.pyx":4693 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4695 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4696 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4696, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4695 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4697 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4698 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4699 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__758, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4699, __pyx_L1_error) - - /* "talib/stream.pyx":4698 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4700 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4701 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__759, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4701, __pyx_L1_error) - - /* "talib/stream.pyx":4700 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4702 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4703 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4703, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4702 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4704 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4705 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4706 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__760, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4706, __pyx_L1_error) - - /* "talib/stream.pyx":4705 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4707 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4708 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__761, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4708, __pyx_L1_error) - - /* "talib/stream.pyx":4707 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4709 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4710 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4710, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4709 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4711 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4712 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4713 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__762, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4713, __pyx_L1_error) - - /* "talib/stream.pyx":4712 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4714 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4715 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__763, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4715, __pyx_L1_error) - - /* "talib/stream.pyx":4714 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4716 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4717 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4717, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4716 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4718 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4719 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4720 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4721 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__764, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4721, __pyx_L1_error) - - /* "talib/stream.pyx":4720 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4722 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4723 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__765, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4723, __pyx_L1_error) - - /* "talib/stream.pyx":4722 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4724 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4725 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__766, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4725, __pyx_L1_error) - - /* "talib/stream.pyx":4724 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4726 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4727 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLUPSIDEGAP2CROWS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4728 - * outinteger = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4729 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLUPSIDEGAP2CROWS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4669 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLUPSIDEGAP2CROWS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4733 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_155CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_154CDLXSIDEGAP3METHODS[] = " CDLXSIDEGAP3METHODS(open, high, low, close)\n\n Upside/Downside Gap Three Methods (Pattern Recognition)\n\n Inputs:\n prices: ['open', 'high', 'low', 'close']\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_155CDLXSIDEGAP3METHODS = {"CDLXSIDEGAP3METHODS", (PyCFunction)__pyx_pw_5talib_6stream_155CDLXSIDEGAP3METHODS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_154CDLXSIDEGAP3METHODS}; -static PyObject *__pyx_pw_5talib_6stream_155CDLXSIDEGAP3METHODS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_open = 0; - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_open,&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 1); __PYX_ERR(0, 4733, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 2); __PYX_ERR(0, 4733, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, 3); __PYX_ERR(0, 4733, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CDLXSIDEGAP3METHODS") < 0)) __PYX_ERR(0, 4733, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_open = ((PyArrayObject *)values[0]); - __pyx_v_high = ((PyArrayObject *)values[1]); - __pyx_v_low = ((PyArrayObject *)values[2]); - __pyx_v_close = ((PyArrayObject *)values[3]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CDLXSIDEGAP3METHODS", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4733, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_open), __pyx_ptype_5numpy_ndarray, 0, "open", 0))) __PYX_ERR(0, 4733, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 4733, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 4733, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 4733, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_154CDLXSIDEGAP3METHODS(__pyx_self, __pyx_v_open, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_154CDLXSIDEGAP3METHODS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_open, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_open_data; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CDLXSIDEGAP3METHODS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_open); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":4755 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_open) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4756 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__767, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4756, __pyx_L1_error) - - /* "talib/stream.pyx":4755 - * int outnbelement - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("open is not double") - * if open.ndim != 1: - */ - } - - /* "talib/stream.pyx":4757 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_open->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4758 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__768, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4758, __pyx_L1_error) - - /* "talib/stream.pyx":4757 - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") - * if open.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4759 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_open) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4760 - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) # <<<<<<<<<<<<<< - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4760, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_open, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4759 - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - */ - } - - /* "talib/stream.pyx":4761 - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - */ - __pyx_v_open_data = ((double *)__pyx_v_open->data); - - /* "talib/stream.pyx":4762 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4763 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__769, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4763, __pyx_L1_error) - - /* "talib/stream.pyx":4762 - * open = PyArray_GETCONTIGUOUS(open) - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":4764 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4765 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__770, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4765, __pyx_L1_error) - - /* "talib/stream.pyx":4764 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4766 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4767 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4767, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4766 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":4768 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":4769 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4770 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__771, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4770, __pyx_L1_error) - - /* "talib/stream.pyx":4769 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":4771 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4772 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__772, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4772, __pyx_L1_error) - - /* "talib/stream.pyx":4771 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4773 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4774 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4774, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4773 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":4775 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":4776 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4777 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__773, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4777, __pyx_L1_error) - - /* "talib/stream.pyx":4776 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":4778 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4779 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__774, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4779, __pyx_L1_error) - - /* "talib/stream.pyx":4778 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4780 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4781 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = open.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4781, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4780 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":4782 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = open.shape[0] - * if length != high.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":4783 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = open.shape[0] # <<<<<<<<<<<<<< - * if length != high.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_open->dimensions[0]); - - /* "talib/stream.pyx":4784 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_high->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4785 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__775, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4785, __pyx_L1_error) - - /* "talib/stream.pyx":4784 - * close_data = close.data - * length = open.shape[0] - * if length != high.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != low.shape[0]: - */ - } - - /* "talib/stream.pyx":4786 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4787 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__776, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4787, __pyx_L1_error) - - /* "talib/stream.pyx":4786 - * if length != high.shape[0]: - * raise Exception("input lengths are different") - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":4788 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4789 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__777, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4789, __pyx_L1_error) - - /* "talib/stream.pyx":4788 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outinteger = 0 - */ - } - - /* "talib/stream.pyx":4790 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":4791 - * raise Exception("input lengths are different") - * outinteger = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_CDLXSIDEGAP3METHODS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_open_data, __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":4792 - * outinteger = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4792, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4793 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_CDLXSIDEGAP3METHODS", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4733 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CDLXSIDEGAP3METHODS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_open); - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4797 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_157CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_156CEIL[] = " CEIL(real)\n\n Vector Ceil (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_157CEIL = {"CEIL", (PyCFunction)__pyx_pw_5talib_6stream_157CEIL, METH_O, __pyx_doc_5talib_6stream_156CEIL}; -static PyObject *__pyx_pw_5talib_6stream_157CEIL(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CEIL (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 4797, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_156CEIL(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_156CEIL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CEIL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":4816 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4817 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__778, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4817, __pyx_L1_error) - - /* "talib/stream.pyx":4816 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":4818 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4819 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__779, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4819, __pyx_L1_error) - - /* "talib/stream.pyx":4818 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4820 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4821 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4821, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4820 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":4822 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":4823 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":4824 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CEIL", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":4825 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CEIL", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CEIL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":4826 - * outreal = NaN - * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CEIL", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CEIL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4827 - * retCode = lib.TA_CEIL( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CEIL", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4797 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CEIL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_159CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_158CMO[] = " CMO(real[, timeperiod=?])\n\n Chande Momentum Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_159CMO = {"CMO", (PyCFunction)__pyx_pw_5talib_6stream_159CMO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_158CMO}; -static PyObject *__pyx_pw_5talib_6stream_159CMO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CMO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CMO") < 0)) __PYX_ERR(0, 4831, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4831, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CMO", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4831, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 4831, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_158CMO(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_158CMO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CMO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":4852 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4853 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__780, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4853, __pyx_L1_error) - - /* "talib/stream.pyx":4852 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":4854 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4855 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__781, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4855, __pyx_L1_error) - - /* "talib/stream.pyx":4854 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4856 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4857 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4857, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4857, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4856 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":4858 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":4859 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":4860 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CMO", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":4861 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CMO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CMO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":4862 - * outreal = NaN - * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CMO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CMO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4863 - * retCode = lib.TA_CMO( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CMO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CMO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4867 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_161CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_160CORREL[] = " CORREL(real0, real1[, timeperiod=?])\n\n Pearson's Correlation Coefficient (r) (Statistic Functions)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_161CORREL = {"CORREL", (PyCFunction)__pyx_pw_5talib_6stream_161CORREL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_160CORREL}; -static PyObject *__pyx_pw_5talib_6stream_161CORREL(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("CORREL (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, 1); __PYX_ERR(0, 4867, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CORREL") < 0)) __PYX_ERR(0, 4867, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4867, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CORREL", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4867, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 4867, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 4867, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_160CORREL(__pyx_self, __pyx_v_real0, __pyx_v_real1, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_160CORREL(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("CORREL", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":4890 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4891 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__782, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4891, __pyx_L1_error) - - /* "talib/stream.pyx":4890 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":4892 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4893 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__783, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4893, __pyx_L1_error) - - /* "talib/stream.pyx":4892 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4894 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4895 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4895, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4894 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":4896 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":4897 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4898 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__784, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4898, __pyx_L1_error) - - /* "talib/stream.pyx":4897 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":4899 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4900 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__785, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4900, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4900, __pyx_L1_error) - - /* "talib/stream.pyx":4899 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4901 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4902 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4902, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4902, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4901 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":4903 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":4904 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":4905 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4906 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__786, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4906, __pyx_L1_error) - - /* "talib/stream.pyx":4905 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":4907 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CORREL", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":4908 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_CORREL", retCode) - * return outreal - */ - __pyx_v_retCode = TA_CORREL((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":4909 - * outreal = NaN - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CORREL", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_CORREL, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4910 - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_CORREL", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4867 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.CORREL", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_163COS(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_162COS[] = " COS(real)\n\n Vector Trigonometric Cos (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_163COS = {"COS", (PyCFunction)__pyx_pw_5talib_6stream_163COS, METH_O, __pyx_doc_5talib_6stream_162COS}; -static PyObject *__pyx_pw_5talib_6stream_163COS(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("COS (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 4914, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_162COS(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_162COS(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("COS", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":4933 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4934 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__787, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4934, __pyx_L1_error) - - /* "talib/stream.pyx":4933 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":4935 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4936 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__788, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4936, __pyx_L1_error) - - /* "talib/stream.pyx":4935 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4937 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4938 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4938, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4937 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":4939 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":4940 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":4941 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COS", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":4942 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_COS", retCode) - * return outreal - */ - __pyx_v_retCode = TA_COS((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":4943 - * outreal = NaN - * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COS", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_COS, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4944 - * retCode = lib.TA_COS( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COS", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.COS", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4948 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_165COSH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_164COSH[] = " COSH(real)\n\n Vector Trigonometric Cosh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_165COSH = {"COSH", (PyCFunction)__pyx_pw_5talib_6stream_165COSH, METH_O, __pyx_doc_5talib_6stream_164COSH}; -static PyObject *__pyx_pw_5talib_6stream_165COSH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("COSH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 4948, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_164COSH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_164COSH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("COSH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":4967 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4968 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__789, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4968, __pyx_L1_error) - - /* "talib/stream.pyx":4967 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":4969 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4970 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__790, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 4970, __pyx_L1_error) - - /* "talib/stream.pyx":4969 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":4971 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":4972 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4972, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":4971 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":4973 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":4974 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":4975 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COSH", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":4976 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_COSH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_COSH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":4977 - * outreal = NaN - * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COSH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_COSH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":4978 - * retCode = lib.TA_COSH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_COSH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4948 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.COSH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":4982 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_167DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_166DEMA[] = " DEMA(real[, timeperiod=?])\n\n Double Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_167DEMA = {"DEMA", (PyCFunction)__pyx_pw_5talib_6stream_167DEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_166DEMA}; -static PyObject *__pyx_pw_5talib_6stream_167DEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DEMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DEMA") < 0)) __PYX_ERR(0, 4982, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4982, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4982, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 4982, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_166DEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_166DEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("DEMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5003 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5004 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__791, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5004, __pyx_L1_error) - - /* "talib/stream.pyx":5003 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5005 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5006 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__792, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5006, __pyx_L1_error) - - /* "talib/stream.pyx":5005 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5007 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5008 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5008, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5007 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5009 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5010 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5011 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DEMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5012 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DEMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DEMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5013 - * outreal = NaN - * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DEMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5014 - * retCode = lib.TA_DEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DEMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":4982 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.DEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5018 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_169DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_168DIV[] = " DIV(real0, real1)\n\n Vector Arithmetic Div (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_169DIV = {"DIV", (PyCFunction)__pyx_pw_5talib_6stream_169DIV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_168DIV}; -static PyObject *__pyx_pw_5talib_6stream_169DIV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DIV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, 1); __PYX_ERR(0, 5018, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DIV") < 0)) __PYX_ERR(0, 5018, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DIV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5018, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 5018, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 5018, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_168DIV(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_168DIV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("DIV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":5039 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5040 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__793, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5040, __pyx_L1_error) - - /* "talib/stream.pyx":5039 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":5041 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5042 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__794, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5042, __pyx_L1_error) - - /* "talib/stream.pyx":5041 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5043 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5044 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5044, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5043 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":5045 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":5046 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5047 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__795, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5047, __pyx_L1_error) - - /* "talib/stream.pyx":5046 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":5048 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5049 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__796, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5049, __pyx_L1_error) - - /* "talib/stream.pyx":5048 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5050 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5051 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5051, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5050 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":5052 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":5053 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":5054 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5055 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__797, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5055, __pyx_L1_error) - - /* "talib/stream.pyx":5054 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":5056 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DIV", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5057 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DIV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DIV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5058 - * outreal = NaN - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DIV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DIV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5059 - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DIV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5018 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.DIV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_171DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_170DX[] = " DX(high, low, close[, timeperiod=?])\n\n Directional Movement Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_171DX = {"DX", (PyCFunction)__pyx_pw_5talib_6stream_171DX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_170DX}; -static PyObject *__pyx_pw_5talib_6stream_171DX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("DX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 1); __PYX_ERR(0, 5063, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, 2); __PYX_ERR(0, 5063, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DX") < 0)) __PYX_ERR(0, 5063, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5063, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("DX", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5063, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 5063, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 5063, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 5063, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_170DX(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_170DX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("DX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":5086 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5087 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__798, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5087, __pyx_L1_error) - - /* "talib/stream.pyx":5086 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":5088 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5089 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__799, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5089, __pyx_L1_error) - - /* "talib/stream.pyx":5088 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5090 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5091 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5091, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5090 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":5092 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":5093 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5094 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__800, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5094, __pyx_L1_error) - - /* "talib/stream.pyx":5093 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":5095 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5096 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__801, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5096, __pyx_L1_error) - - /* "talib/stream.pyx":5095 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5097 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5098 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5098, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5097 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":5099 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":5100 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5101 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__802, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5101, __pyx_L1_error) - - /* "talib/stream.pyx":5100 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":5102 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5103 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__803, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5103, __pyx_L1_error) - - /* "talib/stream.pyx":5102 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5104 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5105 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5105, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5104 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":5106 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":5107 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":5108 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5109 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__804, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5109, __pyx_L1_error) - - /* "talib/stream.pyx":5108 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":5110 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5111 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__805, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5111, __pyx_L1_error) - - /* "talib/stream.pyx":5110 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":5112 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DX", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5113 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_DX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_DX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5114 - * outreal = NaN - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_DX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5115 - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_DX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.DX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5119 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_173EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_172EMA[] = " EMA(real[, timeperiod=?])\n\n Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_173EMA = {"EMA", (PyCFunction)__pyx_pw_5talib_6stream_173EMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_172EMA}; -static PyObject *__pyx_pw_5talib_6stream_173EMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("EMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "EMA") < 0)) __PYX_ERR(0, 5119, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5119, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("EMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5119, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5119, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_172EMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_172EMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("EMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5140 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5141 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__806, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5141, __pyx_L1_error) - - /* "talib/stream.pyx":5140 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5142 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5143 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__807, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5143, __pyx_L1_error) - - /* "talib/stream.pyx":5142 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5144 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5145 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5145, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5144 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5146 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5147 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5148 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5149 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_EMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_EMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5150 - * outreal = NaN - * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_EMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5151 - * retCode = lib.TA_EMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5119 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.EMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5155 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_175EXP(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_174EXP[] = " EXP(real)\n\n Vector Arithmetic Exp (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_175EXP = {"EXP", (PyCFunction)__pyx_pw_5talib_6stream_175EXP, METH_O, __pyx_doc_5talib_6stream_174EXP}; -static PyObject *__pyx_pw_5talib_6stream_175EXP(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("EXP (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5155, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_174EXP(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_174EXP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("EXP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5174 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5175 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__808, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5175, __pyx_L1_error) - - /* "talib/stream.pyx":5174 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5176 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5177 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__809, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5177, __pyx_L1_error) - - /* "talib/stream.pyx":5176 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5178 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5179 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5179, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5178 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5180 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5181 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5182 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EXP", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5183 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_EXP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_EXP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5184 - * outreal = NaN - * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EXP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_EXP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5185 - * retCode = lib.TA_EXP( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_EXP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5155 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.EXP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5189 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_177FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_176FLOOR[] = " FLOOR(real)\n\n Vector Floor (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_177FLOOR = {"FLOOR", (PyCFunction)__pyx_pw_5talib_6stream_177FLOOR, METH_O, __pyx_doc_5talib_6stream_176FLOOR}; -static PyObject *__pyx_pw_5talib_6stream_177FLOOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("FLOOR (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5189, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_176FLOOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_176FLOOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("FLOOR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5208 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5209 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__810, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5209, __pyx_L1_error) - - /* "talib/stream.pyx":5208 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5210 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5211 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__811, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5211, __pyx_L1_error) - - /* "talib/stream.pyx":5210 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5212 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5213 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5213, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5212 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5214 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5215 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5216 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_FLOOR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5217 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_FLOOR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_FLOOR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5218 - * outreal = NaN - * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_FLOOR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_FLOOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5219 - * retCode = lib.TA_FLOOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_FLOOR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5189 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.FLOOR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5223 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_179HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_178HT_DCPERIOD[] = " HT_DCPERIOD(real)\n\n Hilbert Transform - Dominant Cycle Period (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_179HT_DCPERIOD = {"HT_DCPERIOD", (PyCFunction)__pyx_pw_5talib_6stream_179HT_DCPERIOD, METH_O, __pyx_doc_5talib_6stream_178HT_DCPERIOD}; -static PyObject *__pyx_pw_5talib_6stream_179HT_DCPERIOD(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_DCPERIOD (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5223, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_178HT_DCPERIOD(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_178HT_DCPERIOD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("HT_DCPERIOD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5242 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5243 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__812, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5243, __pyx_L1_error) - - /* "talib/stream.pyx":5242 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5244 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5245 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__813, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5245, __pyx_L1_error) - - /* "talib/stream.pyx":5244 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5246 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5247 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5247, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5246 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5248 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5249 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5250 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5251 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_DCPERIOD", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_DCPERIOD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5252 - * outreal = NaN - * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_DCPERIOD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5253 - * retCode = lib.TA_HT_DCPERIOD( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPERIOD", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5223 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.HT_DCPERIOD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5257 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_181HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_180HT_DCPHASE[] = " HT_DCPHASE(real)\n\n Hilbert Transform - Dominant Cycle Phase (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_181HT_DCPHASE = {"HT_DCPHASE", (PyCFunction)__pyx_pw_5talib_6stream_181HT_DCPHASE, METH_O, __pyx_doc_5talib_6stream_180HT_DCPHASE}; -static PyObject *__pyx_pw_5talib_6stream_181HT_DCPHASE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_DCPHASE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5257, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_180HT_DCPHASE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_180HT_DCPHASE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("HT_DCPHASE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5276 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5277 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__814, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5277, __pyx_L1_error) - - /* "talib/stream.pyx":5276 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5278 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5279 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__815, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5279, __pyx_L1_error) - - /* "talib/stream.pyx":5278 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5280 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5281 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5281, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5280 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5282 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5283 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5284 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPHASE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5285 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_DCPHASE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_DCPHASE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5286 - * outreal = NaN - * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPHASE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_DCPHASE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5287 - * retCode = lib.TA_HT_DCPHASE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_DCPHASE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5257 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.HT_DCPHASE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5291 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_183HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_182HT_PHASOR[] = " HT_PHASOR(real)\n\n Hilbert Transform - Phasor Components (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n inphase\n quadrature\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_183HT_PHASOR = {"HT_PHASOR", (PyCFunction)__pyx_pw_5talib_6stream_183HT_PHASOR, METH_O, __pyx_doc_5talib_6stream_182HT_PHASOR}; -static PyObject *__pyx_pw_5talib_6stream_183HT_PHASOR(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_PHASOR (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5291, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_182HT_PHASOR(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_182HT_PHASOR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outinphase; - double __pyx_v_outquadrature; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("HT_PHASOR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5312 - * double outinphase - * double outquadrature - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5313 - * double outquadrature - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__816, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5313, __pyx_L1_error) - - /* "talib/stream.pyx":5312 - * double outinphase - * double outquadrature - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5314 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5315 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__817, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5315, __pyx_L1_error) - - /* "talib/stream.pyx":5314 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5316 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5317 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5317, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5316 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5318 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outinphase = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5319 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outinphase = NaN - * outquadrature = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5320 - * real_data = real.data - * length = real.shape[0] - * outinphase = NaN # <<<<<<<<<<<<<< - * outquadrature = NaN - * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) - */ - __pyx_v_outinphase = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5321 - * length = real.shape[0] - * outinphase = NaN - * outquadrature = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) - * _ta_check_success("TA_HT_PHASOR", retCode) - */ - __pyx_v_outquadrature = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5322 - * outinphase = NaN - * outquadrature = NaN - * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_PHASOR", retCode) - * return outinphase , outquadrature - */ - __pyx_v_retCode = TA_HT_PHASOR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinphase), (&__pyx_v_outquadrature)); - - /* "talib/stream.pyx":5323 - * outquadrature = NaN - * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) - * _ta_check_success("TA_HT_PHASOR", retCode) # <<<<<<<<<<<<<< - * return outinphase , outquadrature - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_PHASOR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5324 - * retCode = lib.TA_HT_PHASOR( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinphase , &outquadrature ) - * _ta_check_success("TA_HT_PHASOR", retCode) - * return outinphase , outquadrature # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outinphase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outquadrature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5291 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.HT_PHASOR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5328 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_185HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_184HT_SINE[] = " HT_SINE(real)\n\n Hilbert Transform - SineWave (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n sine\n leadsine\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_185HT_SINE = {"HT_SINE", (PyCFunction)__pyx_pw_5talib_6stream_185HT_SINE, METH_O, __pyx_doc_5talib_6stream_184HT_SINE}; -static PyObject *__pyx_pw_5talib_6stream_185HT_SINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_SINE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5328, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_184HT_SINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_184HT_SINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outsine; - double __pyx_v_outleadsine; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("HT_SINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5349 - * double outsine - * double outleadsine - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5350 - * double outleadsine - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__818, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5350, __pyx_L1_error) - - /* "talib/stream.pyx":5349 - * double outsine - * double outleadsine - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5351 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5352 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__819, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5352, __pyx_L1_error) - - /* "talib/stream.pyx":5351 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5353 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5354 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5354, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5353 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5355 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outsine = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5356 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outsine = NaN - * outleadsine = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5357 - * real_data = real.data - * length = real.shape[0] - * outsine = NaN # <<<<<<<<<<<<<< - * outleadsine = NaN - * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) - */ - __pyx_v_outsine = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5358 - * length = real.shape[0] - * outsine = NaN - * outleadsine = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) - * _ta_check_success("TA_HT_SINE", retCode) - */ - __pyx_v_outleadsine = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5359 - * outsine = NaN - * outleadsine = NaN - * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_SINE", retCode) - * return outsine , outleadsine - */ - __pyx_v_retCode = TA_HT_SINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outsine), (&__pyx_v_outleadsine)); - - /* "talib/stream.pyx":5360 - * outleadsine = NaN - * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) - * _ta_check_success("TA_HT_SINE", retCode) # <<<<<<<<<<<<<< - * return outsine , outleadsine - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_SINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5361 - * retCode = lib.TA_HT_SINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outsine , &outleadsine ) - * _ta_check_success("TA_HT_SINE", retCode) - * return outsine , outleadsine # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outsine); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outleadsine); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5328 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.HT_SINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5365 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_187HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_186HT_TRENDLINE[] = " HT_TRENDLINE(real)\n\n Hilbert Transform - Instantaneous Trendline (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_187HT_TRENDLINE = {"HT_TRENDLINE", (PyCFunction)__pyx_pw_5talib_6stream_187HT_TRENDLINE, METH_O, __pyx_doc_5talib_6stream_186HT_TRENDLINE}; -static PyObject *__pyx_pw_5talib_6stream_187HT_TRENDLINE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_TRENDLINE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5365, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_186HT_TRENDLINE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_186HT_TRENDLINE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("HT_TRENDLINE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5384 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5385 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__820, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5385, __pyx_L1_error) - - /* "talib/stream.pyx":5384 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5386 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5387 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__821, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5387, __pyx_L1_error) - - /* "talib/stream.pyx":5386 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5388 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5389 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5389, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5388 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5390 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5391 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5392 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5393 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_TRENDLINE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_HT_TRENDLINE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5394 - * outreal = NaN - * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_TRENDLINE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5395 - * retCode = lib.TA_HT_TRENDLINE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_HT_TRENDLINE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5365 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.HT_TRENDLINE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_189HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_188HT_TRENDMODE[] = " HT_TRENDMODE(real)\n\n Hilbert Transform - Trend vs Cycle Mode (Cycle Indicators)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_189HT_TRENDMODE = {"HT_TRENDMODE", (PyCFunction)__pyx_pw_5talib_6stream_189HT_TRENDMODE, METH_O, __pyx_doc_5talib_6stream_188HT_TRENDMODE}; -static PyObject *__pyx_pw_5talib_6stream_189HT_TRENDMODE(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("HT_TRENDMODE (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5399, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_188HT_TRENDMODE(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_188HT_TRENDMODE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("HT_TRENDMODE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5418 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5419 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__822, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5419, __pyx_L1_error) - - /* "talib/stream.pyx":5418 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5420 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5421 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__823, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5421, __pyx_L1_error) - - /* "talib/stream.pyx":5420 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5422 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5423 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5423, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5422 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5424 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outinteger = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5425 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5426 - * real_data = real.data - * length = real.shape[0] - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":5427 - * length = real.shape[0] - * outinteger = 0 - * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_HT_TRENDMODE", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_HT_TRENDMODE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":5428 - * outinteger = 0 - * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_HT_TRENDMODE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5429 - * retCode = lib.TA_HT_TRENDMODE( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_HT_TRENDMODE", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.HT_TRENDMODE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_191KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_190KAMA[] = " KAMA(real[, timeperiod=?])\n\n Kaufman Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_191KAMA = {"KAMA", (PyCFunction)__pyx_pw_5talib_6stream_191KAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_190KAMA}; -static PyObject *__pyx_pw_5talib_6stream_191KAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("KAMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "KAMA") < 0)) __PYX_ERR(0, 5433, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5433, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("KAMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5433, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5433, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_190KAMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_190KAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("KAMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5454 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5455 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__824, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5455, __pyx_L1_error) - - /* "talib/stream.pyx":5454 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5456 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5457 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__825, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5457, __pyx_L1_error) - - /* "talib/stream.pyx":5456 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5458 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5459 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5459, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5458 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5460 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5461 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5462 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_KAMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5463 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_KAMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_KAMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5464 - * outreal = NaN - * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_KAMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_KAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5465 - * retCode = lib.TA_KAMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_KAMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.KAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_193LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_192LINEARREG[] = " LINEARREG(real[, timeperiod=?])\n\n Linear Regression (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_193LINEARREG = {"LINEARREG", (PyCFunction)__pyx_pw_5talib_6stream_193LINEARREG, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_192LINEARREG}; -static PyObject *__pyx_pw_5talib_6stream_193LINEARREG(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG") < 0)) __PYX_ERR(0, 5469, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5469, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5469, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5469, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_192LINEARREG(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_192LINEARREG(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LINEARREG", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5490 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5491 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__826, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5491, __pyx_L1_error) - - /* "talib/stream.pyx":5490 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5492 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5493 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__827, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5493, __pyx_L1_error) - - /* "talib/stream.pyx":5492 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5494 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5495 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5495, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5494 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5496 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5497 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5498 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5499 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5500 - * outreal = NaN - * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5501 - * retCode = lib.TA_LINEARREG( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LINEARREG", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5505 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_195LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_194LINEARREG_ANGLE[] = " LINEARREG_ANGLE(real[, timeperiod=?])\n\n Linear Regression Angle (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_195LINEARREG_ANGLE = {"LINEARREG_ANGLE", (PyCFunction)__pyx_pw_5talib_6stream_195LINEARREG_ANGLE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_194LINEARREG_ANGLE}; -static PyObject *__pyx_pw_5talib_6stream_195LINEARREG_ANGLE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_ANGLE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_ANGLE") < 0)) __PYX_ERR(0, 5505, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5505, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_ANGLE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5505, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5505, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_194LINEARREG_ANGLE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_194LINEARREG_ANGLE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LINEARREG_ANGLE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5526 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5527 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__828, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5527, __pyx_L1_error) - - /* "talib/stream.pyx":5526 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5528 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5529 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__829, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5529, __pyx_L1_error) - - /* "talib/stream.pyx":5528 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5530 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5531 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5530 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5532 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5533 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5534 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5535 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_ANGLE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5536 - * outreal = NaN - * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5537 - * retCode = lib.TA_LINEARREG_ANGLE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_ANGLE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5505 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LINEARREG_ANGLE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_197LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_196LINEARREG_INTERCEPT[] = " LINEARREG_INTERCEPT(real[, timeperiod=?])\n\n Linear Regression Intercept (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_197LINEARREG_INTERCEPT = {"LINEARREG_INTERCEPT", (PyCFunction)__pyx_pw_5talib_6stream_197LINEARREG_INTERCEPT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_196LINEARREG_INTERCEPT}; -static PyObject *__pyx_pw_5talib_6stream_197LINEARREG_INTERCEPT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_INTERCEPT") < 0)) __PYX_ERR(0, 5541, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5541, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_INTERCEPT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5541, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5541, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_196LINEARREG_INTERCEPT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_196LINEARREG_INTERCEPT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LINEARREG_INTERCEPT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5562 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5563 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__830, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5563, __pyx_L1_error) - - /* "talib/stream.pyx":5562 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5564 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5565 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__831, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5565, __pyx_L1_error) - - /* "talib/stream.pyx":5564 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5566 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5567 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5567, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5566 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5568 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5569 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5570 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5571 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_INTERCEPT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5572 - * outreal = NaN - * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5573 - * retCode = lib.TA_LINEARREG_INTERCEPT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_INTERCEPT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LINEARREG_INTERCEPT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_199LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_198LINEARREG_SLOPE[] = " LINEARREG_SLOPE(real[, timeperiod=?])\n\n Linear Regression Slope (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_199LINEARREG_SLOPE = {"LINEARREG_SLOPE", (PyCFunction)__pyx_pw_5talib_6stream_199LINEARREG_SLOPE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_198LINEARREG_SLOPE}; -static PyObject *__pyx_pw_5talib_6stream_199LINEARREG_SLOPE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LINEARREG_SLOPE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LINEARREG_SLOPE") < 0)) __PYX_ERR(0, 5577, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5577, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("LINEARREG_SLOPE", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5577, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5577, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_198LINEARREG_SLOPE(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_198LINEARREG_SLOPE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LINEARREG_SLOPE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5598 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5599 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__832, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5599, __pyx_L1_error) - - /* "talib/stream.pyx":5598 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5600 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5601 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__833, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5601, __pyx_L1_error) - - /* "talib/stream.pyx":5600 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5602 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5603 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5603, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5602 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5604 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5605 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5606 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5607 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LINEARREG_SLOPE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5608 - * outreal = NaN - * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5609 - * retCode = lib.TA_LINEARREG_SLOPE( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LINEARREG_SLOPE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LINEARREG_SLOPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_201LN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_200LN[] = " LN(real)\n\n Vector Log Natural (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_201LN = {"LN", (PyCFunction)__pyx_pw_5talib_6stream_201LN, METH_O, __pyx_doc_5talib_6stream_200LN}; -static PyObject *__pyx_pw_5talib_6stream_201LN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5613, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_200LN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_200LN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5632 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5633 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__834, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5633, __pyx_L1_error) - - /* "talib/stream.pyx":5632 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5634 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5635 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__835, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5635, __pyx_L1_error) - - /* "talib/stream.pyx":5634 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5636 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5637 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5637, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5636 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5638 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5639 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5640 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5641 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5642 - * outreal = NaN - * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5643 - * retCode = lib.TA_LN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5647 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_203LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_202LOG10[] = " LOG10(real)\n\n Vector Log10 (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_203LOG10 = {"LOG10", (PyCFunction)__pyx_pw_5talib_6stream_203LOG10, METH_O, __pyx_doc_5talib_6stream_202LOG10}; -static PyObject *__pyx_pw_5talib_6stream_203LOG10(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("LOG10 (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5647, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_202LOG10(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_202LOG10(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("LOG10", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5666 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5667 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__836, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5667, __pyx_L1_error) - - /* "talib/stream.pyx":5666 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5668 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5669 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__837, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5669, __pyx_L1_error) - - /* "talib/stream.pyx":5668 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5670 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5671 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5670 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5672 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5673 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5674 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LOG10", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5675 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_LOG10", retCode) - * return outreal - */ - __pyx_v_retCode = TA_LOG10((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5676 - * outreal = NaN - * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LOG10", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_LOG10, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5677 - * retCode = lib.TA_LOG10( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_LOG10", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5647 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.LOG10", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5681 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_205MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_204MA[] = " MA(real[, timeperiod=?, matype=?])\n\n Moving average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_205MA = {"MA", (PyCFunction)__pyx_pw_5talib_6stream_205MA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_204MA}; -static PyObject *__pyx_pw_5talib_6stream_205MA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_matype,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MA") < 0)) __PYX_ERR(0, 5681, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5681, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5681, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5681, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5681, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_204MA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_204MA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5703 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5704 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__838, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5704, __pyx_L1_error) - - /* "talib/stream.pyx":5703 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5705 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5706 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__839, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5706, __pyx_L1_error) - - /* "talib/stream.pyx":5705 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5707 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5708 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5708, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5707 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5709 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5710 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5711 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5712 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5713 - * outreal = NaN - * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5714 - * retCode = lib.TA_MA( length - 1 , length - 1 , real_data , timeperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5681 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_207MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_206MACD[] = " MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?])\n\n Moving Average Convergence/Divergence (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_207MACD = {"MACD", (PyCFunction)__pyx_pw_5talib_6stream_207MACD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_206MACD}; -static PyObject *__pyx_pw_5talib_6stream_207MACD(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_signalperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACD (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_signalperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACD") < 0)) __PYX_ERR(0, 5718, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5718, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5718, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5718, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACD", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5718, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5718, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_206MACD(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_206MACD(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_signalperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outmacd; - double __pyx_v_outmacdsignal; - double __pyx_v_outmacdhist; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("MACD", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5745 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5746 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__840, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5746, __pyx_L1_error) - - /* "talib/stream.pyx":5745 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5747 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5748 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__841, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5748, __pyx_L1_error) - - /* "talib/stream.pyx":5747 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5749 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5750 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5750, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5749 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5751 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outmacd = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5752 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outmacd = NaN - * outmacdsignal = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5753 - * real_data = real.data - * length = real.shape[0] - * outmacd = NaN # <<<<<<<<<<<<<< - * outmacdsignal = NaN - * outmacdhist = NaN - */ - __pyx_v_outmacd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5754 - * length = real.shape[0] - * outmacd = NaN - * outmacdsignal = NaN # <<<<<<<<<<<<<< - * outmacdhist = NaN - * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - */ - __pyx_v_outmacdsignal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5755 - * outmacd = NaN - * outmacdsignal = NaN - * outmacdhist = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACD", retCode) - */ - __pyx_v_outmacdhist = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5756 - * outmacdsignal = NaN - * outmacdhist = NaN - * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACD", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACD((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); - - /* "talib/stream.pyx":5757 - * outmacdhist = NaN - * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACD", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACD, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5758 - * retCode = lib.TA_MACD( length - 1 , length - 1 , real_data , fastperiod , slowperiod , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACD", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.stream.MACD", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5762 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_209MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_208MACDEXT[] = " MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?])\n\n MACD with controllable MA type (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n fastmatype: 0\n slowperiod: 26\n slowmatype: 0\n signalperiod: 9\n signalmatype: 0\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_209MACDEXT = {"MACDEXT", (PyCFunction)__pyx_pw_5talib_6stream_209MACDEXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_208MACDEXT}; -static PyObject *__pyx_pw_5talib_6stream_209MACDEXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_fastmatype; - int __pyx_v_slowperiod; - int __pyx_v_slowmatype; - int __pyx_v_signalperiod; - int __pyx_v_signalmatype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACDEXT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_fastmatype,&__pyx_n_s_slowperiod,&__pyx_n_s_slowmatype,&__pyx_n_s_signalperiod,&__pyx_n_s_signalmatype,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastmatype); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowmatype); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalmatype); - if (value) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDEXT") < 0)) __PYX_ERR(0, 5762, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_fastmatype = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_fastmatype = ((int)0); - } - if (values[3]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_slowmatype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_slowmatype = ((int)0); - } - if (values[5]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - if (values[6]) { - __pyx_v_signalmatype = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_signalmatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5762, __pyx_L3_error) - } else { - __pyx_v_signalmatype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACDEXT", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5762, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5762, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_208MACDEXT(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_208MACDEXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_fastmatype, int __pyx_v_slowperiod, int __pyx_v_slowmatype, int __pyx_v_signalperiod, int __pyx_v_signalmatype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outmacd; - double __pyx_v_outmacdsignal; - double __pyx_v_outmacdhist; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("MACDEXT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5792 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5793 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__842, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5793, __pyx_L1_error) - - /* "talib/stream.pyx":5792 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5794 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5795 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__843, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5795, __pyx_L1_error) - - /* "talib/stream.pyx":5794 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5796 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5797 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5797, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5796 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5798 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outmacd = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5799 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outmacd = NaN - * outmacdsignal = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5800 - * real_data = real.data - * length = real.shape[0] - * outmacd = NaN # <<<<<<<<<<<<<< - * outmacdsignal = NaN - * outmacdhist = NaN - */ - __pyx_v_outmacd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5801 - * length = real.shape[0] - * outmacd = NaN - * outmacdsignal = NaN # <<<<<<<<<<<<<< - * outmacdhist = NaN - * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - */ - __pyx_v_outmacdsignal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5802 - * outmacd = NaN - * outmacdsignal = NaN - * outmacdhist = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDEXT", retCode) - */ - __pyx_v_outmacdhist = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5803 - * outmacdsignal = NaN - * outmacdhist = NaN - * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACDEXT", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACDEXT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_fastmatype, __pyx_v_slowperiod, __pyx_v_slowmatype, __pyx_v_signalperiod, __pyx_v_signalmatype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); - - /* "talib/stream.pyx":5804 - * outmacdhist = NaN - * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDEXT", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACDEXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5805 - * retCode = lib.TA_MACDEXT( length - 1 , length - 1 , real_data , fastperiod , fastmatype , slowperiod , slowmatype , signalperiod , signalmatype , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDEXT", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5762 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.stream.MACDEXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5809 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_211MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_210MACDFIX[] = " MACDFIX(real[, signalperiod=?])\n\n Moving Average Convergence/Divergence Fix 12/26 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n signalperiod: 9\n Outputs:\n macd\n macdsignal\n macdhist\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_211MACDFIX = {"MACDFIX", (PyCFunction)__pyx_pw_5talib_6stream_211MACDFIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_210MACDFIX}; -static PyObject *__pyx_pw_5talib_6stream_211MACDFIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_signalperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MACDFIX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_signalperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MACDFIX") < 0)) __PYX_ERR(0, 5809, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_signalperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5809, __pyx_L3_error) - } else { - __pyx_v_signalperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MACDFIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5809, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5809, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_210MACDFIX(__pyx_self, __pyx_v_real, __pyx_v_signalperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_210MACDFIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_signalperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outmacd; - double __pyx_v_outmacdsignal; - double __pyx_v_outmacdhist; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("MACDFIX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5834 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5835 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__844, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5835, __pyx_L1_error) - - /* "talib/stream.pyx":5834 - * double outmacdsignal - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5836 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5837 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__845, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5837, __pyx_L1_error) - - /* "talib/stream.pyx":5836 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5838 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5839 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5839, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5838 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5840 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outmacd = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5841 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outmacd = NaN - * outmacdsignal = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5842 - * real_data = real.data - * length = real.shape[0] - * outmacd = NaN # <<<<<<<<<<<<<< - * outmacdsignal = NaN - * outmacdhist = NaN - */ - __pyx_v_outmacd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5843 - * length = real.shape[0] - * outmacd = NaN - * outmacdsignal = NaN # <<<<<<<<<<<<<< - * outmacdhist = NaN - * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - */ - __pyx_v_outmacdsignal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5844 - * outmacd = NaN - * outmacdsignal = NaN - * outmacdhist = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDFIX", retCode) - */ - __pyx_v_outmacdhist = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5845 - * outmacdsignal = NaN - * outmacdhist = NaN - * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MACDFIX", retCode) - * return outmacd , outmacdsignal , outmacdhist - */ - __pyx_v_retCode = TA_MACDFIX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_signalperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmacd), (&__pyx_v_outmacdsignal), (&__pyx_v_outmacdhist)); - - /* "talib/stream.pyx":5846 - * outmacdhist = NaN - * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDFIX", retCode) # <<<<<<<<<<<<<< - * return outmacd , outmacdsignal , outmacdhist - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MACDFIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5847 - * retCode = lib.TA_MACDFIX( length - 1 , length - 1 , real_data , signalperiod , &outbegidx , &outnbelement , &outmacd , &outmacdsignal , &outmacdhist ) - * _ta_check_success("TA_MACDFIX", retCode) - * return outmacd , outmacdsignal , outmacdhist # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmacd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmacdsignal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_outmacdhist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5809 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("talib.stream.MACDFIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5851 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_213MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_212MAMA[] = " MAMA(real[, fastlimit=?, slowlimit=?])\n\n MESA Adaptive Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastlimit: 0.5\n slowlimit: 0.05\n Outputs:\n mama\n fama\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_213MAMA = {"MAMA", (PyCFunction)__pyx_pw_5talib_6stream_213MAMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_212MAMA}; -static PyObject *__pyx_pw_5talib_6stream_213MAMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - double __pyx_v_fastlimit; - double __pyx_v_slowlimit; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastlimit,&__pyx_n_s_slowlimit,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastlimit); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowlimit); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAMA") < 0)) __PYX_ERR(0, 5851, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastlimit = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fastlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5851, __pyx_L3_error) - } else { - __pyx_v_fastlimit = ((double)-4e37); - } - if (values[2]) { - __pyx_v_slowlimit = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_slowlimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5851, __pyx_L3_error) - } else { - __pyx_v_slowlimit = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAMA", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5851, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5851, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_212MAMA(__pyx_self, __pyx_v_real, __pyx_v_fastlimit, __pyx_v_slowlimit); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_212MAMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, double __pyx_v_fastlimit, double __pyx_v_slowlimit) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outmama; - double __pyx_v_outfama; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("MAMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5875 - * double outmama - * double outfama - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5876 - * double outfama - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__846, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5876, __pyx_L1_error) - - /* "talib/stream.pyx":5875 - * double outmama - * double outfama - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5877 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5878 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__847, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5878, __pyx_L1_error) - - /* "talib/stream.pyx":5877 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5879 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5880 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5880, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5879 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5881 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outmama = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5882 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outmama = NaN - * outfama = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5883 - * real_data = real.data - * length = real.shape[0] - * outmama = NaN # <<<<<<<<<<<<<< - * outfama = NaN - * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) - */ - __pyx_v_outmama = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5884 - * length = real.shape[0] - * outmama = NaN - * outfama = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) - * _ta_check_success("TA_MAMA", retCode) - */ - __pyx_v_outfama = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5885 - * outmama = NaN - * outfama = NaN - * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAMA", retCode) - * return outmama , outfama - */ - __pyx_v_retCode = TA_MAMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastlimit, __pyx_v_slowlimit, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmama), (&__pyx_v_outfama)); - - /* "talib/stream.pyx":5886 - * outfama = NaN - * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) - * _ta_check_success("TA_MAMA", retCode) # <<<<<<<<<<<<<< - * return outmama , outfama - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5887 - * retCode = lib.TA_MAMA( length - 1 , length - 1 , real_data , fastlimit , slowlimit , &outbegidx , &outnbelement , &outmama , &outfama ) - * _ta_check_success("TA_MAMA", retCode) - * return outmama , outfama # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmama); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfama); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5851 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.MAMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5891 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_215MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_214MAVP[] = " MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?])\n\n Moving average with variable period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n periods: (any ndarray)\n Parameters:\n minperiod: 2\n maxperiod: 30\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_215MAVP = {"MAVP", (PyCFunction)__pyx_pw_5talib_6stream_215MAVP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_214MAVP}; -static PyObject *__pyx_pw_5talib_6stream_215MAVP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - PyArrayObject *__pyx_v_periods = 0; - int __pyx_v_minperiod; - int __pyx_v_maxperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAVP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_periods,&__pyx_n_s_minperiod,&__pyx_n_s_maxperiod,&__pyx_n_s_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, 1); __PYX_ERR(0, 5891, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxperiod); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAVP") < 0)) __PYX_ERR(0, 5891, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - __pyx_v_periods = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_minperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5891, __pyx_L3_error) - } else { - __pyx_v_minperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_maxperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5891, __pyx_L3_error) - } else { - __pyx_v_maxperiod = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5891, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAVP", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5891, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5891, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periods), __pyx_ptype_5numpy_ndarray, 0, "periods", 0))) __PYX_ERR(0, 5891, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_214MAVP(__pyx_self, __pyx_v_real, __pyx_v_periods, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_214MAVP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_periods, int __pyx_v_minperiod, int __pyx_v_maxperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - double *__pyx_v_periods_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MAVP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - __Pyx_INCREF((PyObject *)__pyx_v_periods); - - /* "talib/stream.pyx":5916 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5917 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__848, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5917, __pyx_L1_error) - - /* "talib/stream.pyx":5916 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5918 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5919 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__849, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5919, __pyx_L1_error) - - /* "talib/stream.pyx":5918 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5920 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5921 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5921, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5921, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5920 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5922 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5923 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("periods is not double") - * if periods.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_periods) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5924 - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") # <<<<<<<<<<<<<< - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__850, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5924, __pyx_L1_error) - - /* "talib/stream.pyx":5923 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("periods is not double") - * if periods.ndim != 1: - */ - } - - /* "talib/stream.pyx":5925 - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - * if periods.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_periods->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5926 - * raise Exception("periods is not double") - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__851, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5926, __pyx_L1_error) - - /* "talib/stream.pyx":5925 - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") - * if periods.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5927 - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_periods) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5928 - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) # <<<<<<<<<<<<<< - * periods_data = periods.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_periods); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5928, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_periods, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5927 - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - */ - } - - /* "talib/stream.pyx":5929 - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * if length != periods.shape[0]: - */ - __pyx_v_periods_data = ((double *)__pyx_v_periods->data); - - /* "talib/stream.pyx":5930 - * periods = PyArray_GETCONTIGUOUS(periods) - * periods_data = periods.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * if length != periods.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5931 - * periods_data = periods.data - * length = real.shape[0] - * if length != periods.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_periods->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5932 - * length = real.shape[0] - * if length != periods.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__852, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5932, __pyx_L1_error) - - /* "talib/stream.pyx":5931 - * periods_data = periods.data - * length = real.shape[0] - * if length != periods.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":5933 - * if length != periods.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAVP", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5934 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAVP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MAVP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_periods_data, __pyx_v_minperiod, __pyx_v_maxperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5935 - * outreal = NaN - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAVP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAVP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5936 - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAVP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5891 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MAVP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XDECREF((PyObject *)__pyx_v_periods); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5940 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_217MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_216MAX[] = " MAX(real[, timeperiod=?])\n\n Highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_217MAX = {"MAX", (PyCFunction)__pyx_pw_5talib_6stream_217MAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_216MAX}; -static PyObject *__pyx_pw_5talib_6stream_217MAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAX") < 0)) __PYX_ERR(0, 5940, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5940, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5940, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5940, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_216MAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_216MAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MAX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5961 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5962 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__853, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5962, __pyx_L1_error) - - /* "talib/stream.pyx":5961 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5963 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5964 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__854, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5964, __pyx_L1_error) - - /* "talib/stream.pyx":5963 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":5965 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5966 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5966, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":5965 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":5967 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":5968 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":5969 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAX", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":5970 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MAX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":5971 - * outreal = NaN - * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":5972 - * retCode = lib.TA_MAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MAX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5940 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":5976 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_219MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_218MAXINDEX[] = " MAXINDEX(real[, timeperiod=?])\n\n Index of highest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_219MAXINDEX = {"MAXINDEX", (PyCFunction)__pyx_pw_5talib_6stream_219MAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_218MAXINDEX}; -static PyObject *__pyx_pw_5talib_6stream_219MAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MAXINDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MAXINDEX") < 0)) __PYX_ERR(0, 5976, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5976, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5976, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 5976, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_218MAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_218MAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MAXINDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":5997 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":5998 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__855, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 5998, __pyx_L1_error) - - /* "talib/stream.pyx":5997 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":5999 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6000 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__856, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6000, __pyx_L1_error) - - /* "talib/stream.pyx":5999 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6001 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6002 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6002, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6001 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6003 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outinteger = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6004 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6005 - * real_data = real.data - * length = real.shape[0] - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MAXINDEX", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":6006 - * length = real.shape[0] - * outinteger = 0 - * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MAXINDEX", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_MAXINDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":6007 - * outinteger = 0 - * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MAXINDEX", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6008 - * retCode = lib.TA_MAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MAXINDEX", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":5976 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_221MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_220MEDPRICE[] = " MEDPRICE(high, low)\n\n Median Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_221MEDPRICE = {"MEDPRICE", (PyCFunction)__pyx_pw_5talib_6stream_221MEDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_220MEDPRICE}; -static PyObject *__pyx_pw_5talib_6stream_221MEDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MEDPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, 1); __PYX_ERR(0, 6012, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MEDPRICE") < 0)) __PYX_ERR(0, 6012, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MEDPRICE", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6012, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6012, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6012, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_220MEDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_220MEDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MEDPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":6032 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6033 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__857, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6033, __pyx_L1_error) - - /* "talib/stream.pyx":6032 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6034 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6035 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__858, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6035, __pyx_L1_error) - - /* "talib/stream.pyx":6034 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6036 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6037 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6037, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6036 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6038 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6039 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6040 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__859, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6040, __pyx_L1_error) - - /* "talib/stream.pyx":6039 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6041 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6042 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__860, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6042, __pyx_L1_error) - - /* "talib/stream.pyx":6041 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6043 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6044 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6044, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6043 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6045 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6046 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6047 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6048 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__861, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6048, __pyx_L1_error) - - /* "talib/stream.pyx":6047 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6049 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MEDPRICE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6050 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MEDPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MEDPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6051 - * outreal = NaN - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MEDPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MEDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6052 - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MEDPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MEDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6056 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_223MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_222MFI[] = " MFI(high, low, close, volume[, timeperiod=?])\n\n Money Flow Index (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close', 'volume']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_223MFI = {"MFI", (PyCFunction)__pyx_pw_5talib_6stream_223MFI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_222MFI}; -static PyObject *__pyx_pw_5talib_6stream_223MFI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyArrayObject *__pyx_v_volume = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MFI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_volume,&__pyx_n_s_timeperiod,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 1); __PYX_ERR(0, 6056, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 2); __PYX_ERR(0, 6056, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, 3); __PYX_ERR(0, 6056, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MFI") < 0)) __PYX_ERR(0, 6056, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - __pyx_v_volume = ((PyArrayObject *)values[3]); - if (values[4]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6056, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MFI", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6056, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6056, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6056, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6056, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 6056, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_222MFI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_volume, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_222MFI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, PyArrayObject *__pyx_v_volume, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MFI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/stream.pyx":6080 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6081 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__862, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6081, __pyx_L1_error) - - /* "talib/stream.pyx":6080 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6082 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6083 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__863, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6083, __pyx_L1_error) - - /* "talib/stream.pyx":6082 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6084 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6085 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6085, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6084 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6086 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6087 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6088 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__864, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6088, __pyx_L1_error) - - /* "talib/stream.pyx":6087 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6089 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6090 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__865, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6090, __pyx_L1_error) - - /* "talib/stream.pyx":6089 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6091 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6092 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6092, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6091 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6093 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6094 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6095 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__866, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6095, __pyx_L1_error) - - /* "talib/stream.pyx":6094 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":6096 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6097 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__867, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6097, __pyx_L1_error) - - /* "talib/stream.pyx":6096 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6098 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6099 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6099, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6098 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":6100 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":6101 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6102 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__868, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6102, __pyx_L1_error) - - /* "talib/stream.pyx":6101 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/stream.pyx":6103 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6104 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__869, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6104, __pyx_L1_error) - - /* "talib/stream.pyx":6103 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6105 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6106 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6106, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6105 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/stream.pyx":6107 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/stream.pyx":6108 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6109 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6110 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__870, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6110, __pyx_L1_error) - - /* "talib/stream.pyx":6109 - * volume_data = volume.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":6111 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6112 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__871, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6112, __pyx_L1_error) - - /* "talib/stream.pyx":6111 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - */ - } - - /* "talib/stream.pyx":6113 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6114 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__872, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6114, __pyx_L1_error) - - /* "talib/stream.pyx":6113 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6115 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MFI", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6116 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MFI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MFI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_volume_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6117 - * outreal = NaN - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MFI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MFI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6118 - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MFI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6056 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MFI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_225MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_224MIDPOINT[] = " MIDPOINT(real[, timeperiod=?])\n\n MidPoint over period (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_225MIDPOINT = {"MIDPOINT", (PyCFunction)__pyx_pw_5talib_6stream_225MIDPOINT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_224MIDPOINT}; -static PyObject *__pyx_pw_5talib_6stream_225MIDPOINT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIDPOINT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPOINT") < 0)) __PYX_ERR(0, 6122, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6122, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIDPOINT", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6122, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6122, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_224MIDPOINT(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_224MIDPOINT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MIDPOINT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6143 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6144 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__873, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6144, __pyx_L1_error) - - /* "talib/stream.pyx":6143 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6145 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6146 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__874, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6146, __pyx_L1_error) - - /* "talib/stream.pyx":6145 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6147 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6148 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6148, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6147 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6149 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6150 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6151 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPOINT", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6152 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIDPOINT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIDPOINT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6153 - * outreal = NaN - * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPOINT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIDPOINT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6154 - * retCode = lib.TA_MIDPOINT( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPOINT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MIDPOINT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6158 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_227MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_226MIDPRICE[] = " MIDPRICE(high, low[, timeperiod=?])\n\n Midpoint Price over period (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_227MIDPRICE = {"MIDPRICE", (PyCFunction)__pyx_pw_5talib_6stream_227MIDPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_226MIDPRICE}; -static PyObject *__pyx_pw_5talib_6stream_227MIDPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIDPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, 1); __PYX_ERR(0, 6158, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIDPRICE") < 0)) __PYX_ERR(0, 6158, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6158, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIDPRICE", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6158, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6158, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6158, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_226MIDPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_226MIDPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MIDPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":6180 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6181 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__875, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6181, __pyx_L1_error) - - /* "talib/stream.pyx":6180 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6182 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6183 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__876, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6183, __pyx_L1_error) - - /* "talib/stream.pyx":6182 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6184 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6185 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6185, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6184 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6186 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6187 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6188 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__877, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6188, __pyx_L1_error) - - /* "talib/stream.pyx":6187 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6189 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6190 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__878, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6190, __pyx_L1_error) - - /* "talib/stream.pyx":6189 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6191 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6192 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6192, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6191 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6193 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6194 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6195 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6196 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__879, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6196, __pyx_L1_error) - - /* "talib/stream.pyx":6195 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6197 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPRICE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6198 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIDPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIDPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6199 - * outreal = NaN - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIDPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6200 - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIDPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6158 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MIDPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6204 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_229MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_228MIN[] = " MIN(real[, timeperiod=?])\n\n Lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_229MIN = {"MIN", (PyCFunction)__pyx_pw_5talib_6stream_229MIN, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_228MIN}; -static PyObject *__pyx_pw_5talib_6stream_229MIN(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MIN (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MIN") < 0)) __PYX_ERR(0, 6204, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6204, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MIN", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6204, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6204, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_228MIN(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_228MIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6225 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6226 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__880, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6226, __pyx_L1_error) - - /* "talib/stream.pyx":6225 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6227 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6228 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__881, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6228, __pyx_L1_error) - - /* "talib/stream.pyx":6227 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6229 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6230 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6230, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6229 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6231 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6232 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6233 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6234 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6235 - * outreal = NaN - * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6236 - * retCode = lib.TA_MIN( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6204 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6240 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_231MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_230MININDEX[] = " MININDEX(real[, timeperiod=?])\n\n Index of lowest value over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n integer (values are -100, 0 or 100)\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_231MININDEX = {"MININDEX", (PyCFunction)__pyx_pw_5talib_6stream_231MININDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_230MININDEX}; -static PyObject *__pyx_pw_5talib_6stream_231MININDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MININDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MININDEX") < 0)) __PYX_ERR(0, 6240, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6240, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MININDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6240, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6240, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_230MININDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_230MININDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outinteger; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MININDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6261 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6262 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__882, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6262, __pyx_L1_error) - - /* "talib/stream.pyx":6261 - * int outnbelement - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6263 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6264 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__883, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6264, __pyx_L1_error) - - /* "talib/stream.pyx":6263 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6265 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6266 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6266, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6265 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6267 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outinteger = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6268 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6269 - * real_data = real.data - * length = real.shape[0] - * outinteger = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MININDEX", retCode) - */ - __pyx_v_outinteger = 0; - - /* "talib/stream.pyx":6270 - * length = real.shape[0] - * outinteger = 0 - * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MININDEX", retCode) - * return outinteger - */ - __pyx_v_retCode = TA_MININDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outinteger)); - - /* "talib/stream.pyx":6271 - * outinteger = 0 - * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MININDEX", retCode) # <<<<<<<<<<<<<< - * return outinteger - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MININDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6272 - * retCode = lib.TA_MININDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outinteger ) - * _ta_check_success("TA_MININDEX", retCode) - * return outinteger # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6240 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MININDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_233MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_232MINMAX[] = " MINMAX(real[, timeperiod=?])\n\n Lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n min\n max\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_233MINMAX = {"MINMAX", (PyCFunction)__pyx_pw_5talib_6stream_233MINMAX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_232MINMAX}; -static PyObject *__pyx_pw_5talib_6stream_233MINMAX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINMAX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAX") < 0)) __PYX_ERR(0, 6276, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6276, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINMAX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6276, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6276, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_232MINMAX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_232MINMAX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outmin; - double __pyx_v_outmax; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("MINMAX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6299 - * double outmin - * double outmax - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6300 - * double outmax - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__884, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6300, __pyx_L1_error) - - /* "talib/stream.pyx":6299 - * double outmin - * double outmax - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6301 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6302 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__885, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6302, __pyx_L1_error) - - /* "talib/stream.pyx":6301 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6303 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6304 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6304, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6303 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6305 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outmin = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6306 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outmin = NaN - * outmax = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6307 - * real_data = real.data - * length = real.shape[0] - * outmin = NaN # <<<<<<<<<<<<<< - * outmax = NaN - * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) - */ - __pyx_v_outmin = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6308 - * length = real.shape[0] - * outmin = NaN - * outmax = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) - * _ta_check_success("TA_MINMAX", retCode) - */ - __pyx_v_outmax = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6309 - * outmin = NaN - * outmax = NaN - * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINMAX", retCode) - * return outmin , outmax - */ - __pyx_v_retCode = TA_MINMAX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outmin), (&__pyx_v_outmax)); - - /* "talib/stream.pyx":6310 - * outmax = NaN - * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) - * _ta_check_success("TA_MINMAX", retCode) # <<<<<<<<<<<<<< - * return outmin , outmax - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINMAX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6311 - * retCode = lib.TA_MINMAX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outmin , &outmax ) - * _ta_check_success("TA_MINMAX", retCode) - * return outmin , outmax # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.MINMAX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_235MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_234MINMAXINDEX[] = " MINMAXINDEX(real[, timeperiod=?])\n\n Indexes of lowest and highest values over a specified period (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n minidx\n maxidx\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_235MINMAXINDEX = {"MINMAXINDEX", (PyCFunction)__pyx_pw_5talib_6stream_235MINMAXINDEX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_234MINMAXINDEX}; -static PyObject *__pyx_pw_5talib_6stream_235MINMAXINDEX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINMAXINDEX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINMAXINDEX") < 0)) __PYX_ERR(0, 6315, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6315, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINMAXINDEX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6315, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6315, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_234MINMAXINDEX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_234MINMAXINDEX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - int __pyx_v_outminidx; - int __pyx_v_outmaxidx; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("MINMAXINDEX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6338 - * int outminidx - * int outmaxidx - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6339 - * int outmaxidx - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__886, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6339, __pyx_L1_error) - - /* "talib/stream.pyx":6338 - * int outminidx - * int outmaxidx - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6340 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6341 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__887, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6341, __pyx_L1_error) - - /* "talib/stream.pyx":6340 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6342 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6343 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6343, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6342 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6344 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outminidx = 0 - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6345 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outminidx = 0 - * outmaxidx = 0 - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6346 - * real_data = real.data - * length = real.shape[0] - * outminidx = 0 # <<<<<<<<<<<<<< - * outmaxidx = 0 - * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) - */ - __pyx_v_outminidx = 0; - - /* "talib/stream.pyx":6347 - * length = real.shape[0] - * outminidx = 0 - * outmaxidx = 0 # <<<<<<<<<<<<<< - * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) - * _ta_check_success("TA_MINMAXINDEX", retCode) - */ - __pyx_v_outmaxidx = 0; - - /* "talib/stream.pyx":6348 - * outminidx = 0 - * outmaxidx = 0 - * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINMAXINDEX", retCode) - * return outminidx , outmaxidx - */ - __pyx_v_retCode = TA_MINMAXINDEX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outminidx), (&__pyx_v_outmaxidx)); - - /* "talib/stream.pyx":6349 - * outmaxidx = 0 - * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) - * _ta_check_success("TA_MINMAXINDEX", retCode) # <<<<<<<<<<<<<< - * return outminidx , outmaxidx - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINMAXINDEX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6350 - * retCode = lib.TA_MINMAXINDEX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outminidx , &outmaxidx ) - * _ta_check_success("TA_MINMAXINDEX", retCode) - * return outminidx , outmaxidx # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_outminidx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_outmaxidx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.MINMAXINDEX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6354 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_237MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_236MINUS_DI[] = " MINUS_DI(high, low, close[, timeperiod=?])\n\n Minus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_237MINUS_DI = {"MINUS_DI", (PyCFunction)__pyx_pw_5talib_6stream_237MINUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_236MINUS_DI}; -static PyObject *__pyx_pw_5talib_6stream_237MINUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINUS_DI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 1); __PYX_ERR(0, 6354, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, 2); __PYX_ERR(0, 6354, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DI") < 0)) __PYX_ERR(0, 6354, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6354, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6354, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6354, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6354, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6354, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_236MINUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_236MINUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MINUS_DI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":6377 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6378 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__888, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6378, __pyx_L1_error) - - /* "talib/stream.pyx":6377 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6379 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6380 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__889, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6380, __pyx_L1_error) - - /* "talib/stream.pyx":6379 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6381 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6382 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6382, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6381 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6383 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6384 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6385 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__890, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6385, __pyx_L1_error) - - /* "talib/stream.pyx":6384 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6386 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6387 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__891, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6387, __pyx_L1_error) - - /* "talib/stream.pyx":6386 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6388 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6389 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6389, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6388 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6390 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6391 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6392 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__892, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6392, __pyx_L1_error) - - /* "talib/stream.pyx":6391 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":6393 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6394 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__893, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6394, __pyx_L1_error) - - /* "talib/stream.pyx":6393 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6395 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6396 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6396, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6395 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":6397 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":6398 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6399 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6400 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__894, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6400, __pyx_L1_error) - - /* "talib/stream.pyx":6399 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":6401 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6402 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__895, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6402, __pyx_L1_error) - - /* "talib/stream.pyx":6401 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6403 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DI", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6404 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINUS_DI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MINUS_DI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6405 - * outreal = NaN - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6406 - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6354 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MINUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_239MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_238MINUS_DM[] = " MINUS_DM(high, low[, timeperiod=?])\n\n Minus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_239MINUS_DM = {"MINUS_DM", (PyCFunction)__pyx_pw_5talib_6stream_239MINUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_238MINUS_DM}; -static PyObject *__pyx_pw_5talib_6stream_239MINUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MINUS_DM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, 1); __PYX_ERR(0, 6410, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MINUS_DM") < 0)) __PYX_ERR(0, 6410, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6410, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MINUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6410, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6410, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6410, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_238MINUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_238MINUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MINUS_DM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":6432 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6433 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__896, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6433, __pyx_L1_error) - - /* "talib/stream.pyx":6432 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6434 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6435 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__897, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6435, __pyx_L1_error) - - /* "talib/stream.pyx":6434 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6436 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6437 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6437, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6436 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6438 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6439 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6440 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__898, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6440, __pyx_L1_error) - - /* "talib/stream.pyx":6439 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6441 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6442 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__899, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6442, __pyx_L1_error) - - /* "talib/stream.pyx":6441 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6443 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6444 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6444, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6443 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6445 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6446 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6447 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6448 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__900, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6448, __pyx_L1_error) - - /* "talib/stream.pyx":6447 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6449 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DM", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6450 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MINUS_DM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MINUS_DM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6451 - * outreal = NaN - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MINUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6452 - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MINUS_DM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MINUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_241MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_240MOM[] = " MOM(real[, timeperiod=?])\n\n Momentum (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_241MOM = {"MOM", (PyCFunction)__pyx_pw_5talib_6stream_241MOM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_240MOM}; -static PyObject *__pyx_pw_5talib_6stream_241MOM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MOM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MOM") < 0)) __PYX_ERR(0, 6456, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6456, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MOM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6456, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6456, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_240MOM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_240MOM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MOM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6477 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6478 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__901, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6478, __pyx_L1_error) - - /* "talib/stream.pyx":6477 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6479 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6480 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__902, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6480, __pyx_L1_error) - - /* "talib/stream.pyx":6479 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6481 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6482 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6482, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6481 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6483 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6484 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6485 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MOM", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6486 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MOM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MOM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6487 - * outreal = NaN - * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MOM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MOM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6488 - * retCode = lib.TA_MOM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MOM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MOM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6492 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_243MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_242MULT[] = " MULT(real0, real1)\n\n Vector Arithmetic Mult (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_243MULT = {"MULT", (PyCFunction)__pyx_pw_5talib_6stream_243MULT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_242MULT}; -static PyObject *__pyx_pw_5talib_6stream_243MULT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("MULT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, 1); __PYX_ERR(0, 6492, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MULT") < 0)) __PYX_ERR(0, 6492, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("MULT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6492, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 6492, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 6492, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_242MULT(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_242MULT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("MULT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":6513 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6514 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__903, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6514, __pyx_L1_error) - - /* "talib/stream.pyx":6513 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":6515 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6516 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__904, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6516, __pyx_L1_error) - - /* "talib/stream.pyx":6515 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6517 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6518 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6518, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6517 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":6519 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":6520 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6521 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__905, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6521, __pyx_L1_error) - - /* "talib/stream.pyx":6520 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":6522 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6523 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__906, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6523, __pyx_L1_error) - - /* "talib/stream.pyx":6522 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6524 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6525 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6525, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6524 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":6526 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":6527 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":6528 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6529 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__907, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6529, __pyx_L1_error) - - /* "talib/stream.pyx":6528 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6530 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MULT", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6531 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_MULT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_MULT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6532 - * outreal = NaN - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MULT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_MULT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6533 - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_MULT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6492 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.MULT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6537 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_245NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_244NATR[] = " NATR(high, low, close[, timeperiod=?])\n\n Normalized Average True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_245NATR = {"NATR", (PyCFunction)__pyx_pw_5talib_6stream_245NATR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_244NATR}; -static PyObject *__pyx_pw_5talib_6stream_245NATR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("NATR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 1); __PYX_ERR(0, 6537, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, 2); __PYX_ERR(0, 6537, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NATR") < 0)) __PYX_ERR(0, 6537, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6537, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("NATR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6537, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6537, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6537, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6537, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_244NATR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_244NATR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("NATR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":6560 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6561 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__908, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6561, __pyx_L1_error) - - /* "talib/stream.pyx":6560 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6562 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6563 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__909, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6563, __pyx_L1_error) - - /* "talib/stream.pyx":6562 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6564 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6565 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6565, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6564 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6566 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6567 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6568 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__910, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6568, __pyx_L1_error) - - /* "talib/stream.pyx":6567 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6569 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6570 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__911, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6570, __pyx_L1_error) - - /* "talib/stream.pyx":6569 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6571 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6572 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6572, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6571 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6573 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6574 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6575 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__912, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6575, __pyx_L1_error) - - /* "talib/stream.pyx":6574 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":6576 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6577 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__913, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6577, __pyx_L1_error) - - /* "talib/stream.pyx":6576 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6578 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6579 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6579, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6578 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":6580 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":6581 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6582 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6583 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__914, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6583, __pyx_L1_error) - - /* "talib/stream.pyx":6582 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":6584 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6585 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__915, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6585, __pyx_L1_error) - - /* "talib/stream.pyx":6584 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6586 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_NATR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6587 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_NATR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_NATR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6588 - * outreal = NaN - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_NATR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_NATR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6589 - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_NATR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6537 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.NATR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_247OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_246OBV[] = " OBV(real, volume)\n\n On Balance Volume (Volume Indicators)\n\n Inputs:\n real: (any ndarray)\n prices: ['volume']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_247OBV = {"OBV", (PyCFunction)__pyx_pw_5talib_6stream_247OBV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_246OBV}; -static PyObject *__pyx_pw_5talib_6stream_247OBV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - PyArrayObject *__pyx_v_volume = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("OBV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_volume,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, 1); __PYX_ERR(0, 6593, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "OBV") < 0)) __PYX_ERR(0, 6593, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real = ((PyArrayObject *)values[0]); - __pyx_v_volume = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("OBV", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6593, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6593, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_volume), __pyx_ptype_5numpy_ndarray, 0, "volume", 0))) __PYX_ERR(0, 6593, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_246OBV(__pyx_self, __pyx_v_real, __pyx_v_volume); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_246OBV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, PyArrayObject *__pyx_v_volume) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - double *__pyx_v_volume_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("OBV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - __Pyx_INCREF((PyObject *)__pyx_v_volume); - - /* "talib/stream.pyx":6614 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6615 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__916, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6615, __pyx_L1_error) - - /* "talib/stream.pyx":6614 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6616 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6617 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__917, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6617, __pyx_L1_error) - - /* "talib/stream.pyx":6616 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6618 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6619 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6619, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6618 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6620 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6621 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_volume) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6622 - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__918, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6622, __pyx_L1_error) - - /* "talib/stream.pyx":6621 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("volume is not double") - * if volume.ndim != 1: - */ - } - - /* "talib/stream.pyx":6623 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_volume->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6624 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__919, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6624, __pyx_L1_error) - - /* "talib/stream.pyx":6623 - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") - * if volume.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6625 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_volume) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6626 - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) # <<<<<<<<<<<<<< - * volume_data = volume.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6626, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_volume, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6625 - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - */ - } - - /* "talib/stream.pyx":6627 - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * if length != volume.shape[0]: - */ - __pyx_v_volume_data = ((double *)__pyx_v_volume->data); - - /* "talib/stream.pyx":6628 - * volume = PyArray_GETCONTIGUOUS(volume) - * volume_data = volume.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6629 - * volume_data = volume.data - * length = real.shape[0] - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_volume->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6630 - * length = real.shape[0] - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__920, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6630, __pyx_L1_error) - - /* "talib/stream.pyx":6629 - * volume_data = volume.data - * length = real.shape[0] - * if length != volume.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6631 - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_OBV", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6632 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_OBV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_OBV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_volume_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6633 - * outreal = NaN - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_OBV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_OBV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6634 - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_OBV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.OBV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XDECREF((PyObject *)__pyx_v_volume); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6638 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_249PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_248PLUS_DI[] = " PLUS_DI(high, low, close[, timeperiod=?])\n\n Plus Directional Indicator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_249PLUS_DI = {"PLUS_DI", (PyCFunction)__pyx_pw_5talib_6stream_249PLUS_DI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_248PLUS_DI}; -static PyObject *__pyx_pw_5talib_6stream_249PLUS_DI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PLUS_DI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 1); __PYX_ERR(0, 6638, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, 2); __PYX_ERR(0, 6638, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DI") < 0)) __PYX_ERR(0, 6638, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6638, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PLUS_DI", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6638, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6638, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6638, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 6638, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_248PLUS_DI(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_248PLUS_DI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("PLUS_DI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":6661 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6662 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__921, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6662, __pyx_L1_error) - - /* "talib/stream.pyx":6661 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6663 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6664 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__922, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6664, __pyx_L1_error) - - /* "talib/stream.pyx":6663 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6665 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6666 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6666, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6665 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6667 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6668 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6669 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__923, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6669, __pyx_L1_error) - - /* "talib/stream.pyx":6668 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6670 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6671 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__924, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6671, __pyx_L1_error) - - /* "talib/stream.pyx":6670 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6672 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6673 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6673, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6672 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6674 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6675 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6676 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__925, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6676, __pyx_L1_error) - - /* "talib/stream.pyx":6675 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":6677 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6678 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__926, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6678, __pyx_L1_error) - - /* "talib/stream.pyx":6677 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6679 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6680 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6680, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6679 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":6681 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":6682 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6683 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6684 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__927, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6684, __pyx_L1_error) - - /* "talib/stream.pyx":6683 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":6685 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6686 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__928, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6686, __pyx_L1_error) - - /* "talib/stream.pyx":6685 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6687 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DI", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6688 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PLUS_DI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PLUS_DI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6689 - * outreal = NaN - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PLUS_DI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6690 - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6638 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.PLUS_DI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6694 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_251PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_250PLUS_DM[] = " PLUS_DM(high, low[, timeperiod=?])\n\n Plus Directional Movement (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_251PLUS_DM = {"PLUS_DM", (PyCFunction)__pyx_pw_5talib_6stream_251PLUS_DM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_250PLUS_DM}; -static PyObject *__pyx_pw_5talib_6stream_251PLUS_DM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PLUS_DM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_timeperiod,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, 1); __PYX_ERR(0, 6694, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PLUS_DM") < 0)) __PYX_ERR(0, 6694, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6694, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PLUS_DM", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6694, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6694, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6694, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_250PLUS_DM(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_250PLUS_DM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("PLUS_DM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":6716 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6717 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__929, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6717, __pyx_L1_error) - - /* "talib/stream.pyx":6716 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6718 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6719 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__930, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6719, __pyx_L1_error) - - /* "talib/stream.pyx":6718 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6720 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6721 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6721, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6720 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6722 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6723 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6724 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__931, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6724, __pyx_L1_error) - - /* "talib/stream.pyx":6723 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6725 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6726 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__932, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6726, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6726, __pyx_L1_error) - - /* "talib/stream.pyx":6725 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6727 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6728 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6728, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6727 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6729 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6730 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6731 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6732 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__933, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6732, __pyx_L1_error) - - /* "talib/stream.pyx":6731 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6733 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DM", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6734 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PLUS_DM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PLUS_DM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6735 - * outreal = NaN - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PLUS_DM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6736 - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PLUS_DM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6694 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.PLUS_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_253PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_252PPO[] = " PPO(real[, fastperiod=?, slowperiod=?, matype=?])\n\n Percentage Price Oscillator (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n fastperiod: 12\n slowperiod: 26\n matype: 0 (Simple Moving Average)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_253PPO = {"PPO", (PyCFunction)__pyx_pw_5talib_6stream_253PPO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_252PPO}; -static PyObject *__pyx_pw_5talib_6stream_253PPO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_fastperiod; - int __pyx_v_slowperiod; - int __pyx_v_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PPO (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_fastperiod,&__pyx_n_s_slowperiod,&__pyx_n_s_matype,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowperiod); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_matype); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PPO") < 0)) __PYX_ERR(0, 6740, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_fastperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fastperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6740, __pyx_L3_error) - } else { - __pyx_v_fastperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_slowperiod = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_slowperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6740, __pyx_L3_error) - } else { - __pyx_v_slowperiod = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_matype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6740, __pyx_L3_error) - } else { - __pyx_v_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PPO", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6740, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6740, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_252PPO(__pyx_self, __pyx_v_real, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_252PPO(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_fastperiod, int __pyx_v_slowperiod, int __pyx_v_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("PPO", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6763 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6764 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__934, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6764, __pyx_L1_error) - - /* "talib/stream.pyx":6763 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6765 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6766 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__935, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6766, __pyx_L1_error) - - /* "talib/stream.pyx":6765 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6767 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6768 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6768, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6767 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6769 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6770 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6771 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PPO", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6772 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_PPO", retCode) - * return outreal - */ - __pyx_v_retCode = TA_PPO((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_fastperiod, __pyx_v_slowperiod, __pyx_v_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6773 - * outreal = NaN - * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PPO", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_PPO, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6774 - * retCode = lib.TA_PPO( length - 1 , length - 1 , real_data , fastperiod , slowperiod , matype , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_PPO", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.PPO", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_255ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_254ROC[] = " ROC(real[, timeperiod=?])\n\n Rate of change : ((real/prevPrice)-1)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_255ROC = {"ROC", (PyCFunction)__pyx_pw_5talib_6stream_255ROC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_254ROC}; -static PyObject *__pyx_pw_5talib_6stream_255ROC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROC") < 0)) __PYX_ERR(0, 6778, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6778, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6778, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6778, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_254ROC(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_254ROC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ROC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6799 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6800 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__936, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6800, __pyx_L1_error) - - /* "talib/stream.pyx":6799 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6801 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6802 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__937, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6802, __pyx_L1_error) - - /* "talib/stream.pyx":6801 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6803 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6804 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6804, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6803 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6805 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6806 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6807 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROC", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6808 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6809 - * outreal = NaN - * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6810 - * retCode = lib.TA_ROC( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ROC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_257ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_256ROCP[] = " ROCP(real[, timeperiod=?])\n\n Rate of change Percentage: (real-prevPrice)/prevPrice (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_257ROCP = {"ROCP", (PyCFunction)__pyx_pw_5talib_6stream_257ROCP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_256ROCP}; -static PyObject *__pyx_pw_5talib_6stream_257ROCP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCP (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCP") < 0)) __PYX_ERR(0, 6814, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6814, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCP", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6814, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6814, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_256ROCP(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_256ROCP(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ROCP", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6835 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6836 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__938, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6836, __pyx_L1_error) - - /* "talib/stream.pyx":6835 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6837 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6838 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__939, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6838, __pyx_L1_error) - - /* "talib/stream.pyx":6837 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6839 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6840 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6840, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6839 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6841 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6842 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6843 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCP", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6844 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCP", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCP((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6845 - * outreal = NaN - * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCP", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCP, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6846 - * retCode = lib.TA_ROCP( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCP", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ROCP", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6850 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_259ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_258ROCR[] = " ROCR(real[, timeperiod=?])\n\n Rate of change ratio: (real/prevPrice) (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_259ROCR = {"ROCR", (PyCFunction)__pyx_pw_5talib_6stream_259ROCR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_258ROCR}; -static PyObject *__pyx_pw_5talib_6stream_259ROCR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR") < 0)) __PYX_ERR(0, 6850, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6850, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCR", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6850, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6850, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_258ROCR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_258ROCR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ROCR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6871 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6872 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__940, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6872, __pyx_L1_error) - - /* "talib/stream.pyx":6871 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6873 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6874 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__941, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6874, __pyx_L1_error) - - /* "talib/stream.pyx":6873 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6875 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6876 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6876, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6875 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6877 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6878 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6879 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6880 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6881 - * outreal = NaN - * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6882 - * retCode = lib.TA_ROCR( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6850 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ROCR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6886 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_261ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_260ROCR100[] = " ROCR100(real[, timeperiod=?])\n\n Rate of change ratio 100 scale: (real/prevPrice)*100 (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 10\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_261ROCR100 = {"ROCR100", (PyCFunction)__pyx_pw_5talib_6stream_261ROCR100, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_260ROCR100}; -static PyObject *__pyx_pw_5talib_6stream_261ROCR100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ROCR100 (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ROCR100") < 0)) __PYX_ERR(0, 6886, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6886, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ROCR100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6886, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6886, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_260ROCR100(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_260ROCR100(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ROCR100", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6907 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6908 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__942, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6908, __pyx_L1_error) - - /* "talib/stream.pyx":6907 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6909 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6910 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__943, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6910, __pyx_L1_error) - - /* "talib/stream.pyx":6909 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6911 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6912 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6912, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6912, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6911 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6913 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6914 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6915 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR100", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6916 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ROCR100", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ROCR100((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6917 - * outreal = NaN - * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR100", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ROCR100, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6918 - * retCode = lib.TA_ROCR100( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ROCR100", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6886 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ROCR100", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6922 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_263RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_262RSI[] = " RSI(real[, timeperiod=?])\n\n Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_263RSI = {"RSI", (PyCFunction)__pyx_pw_5talib_6stream_263RSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_262RSI}; -static PyObject *__pyx_pw_5talib_6stream_263RSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("RSI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RSI") < 0)) __PYX_ERR(0, 6922, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6922, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("RSI", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6922, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 6922, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_262RSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_262RSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("RSI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":6943 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6944 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__944, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6944, __pyx_L1_error) - - /* "talib/stream.pyx":6943 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":6945 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6946 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__945, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6946, __pyx_L1_error) - - /* "talib/stream.pyx":6945 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6947 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6948 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6948, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6947 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":6949 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":6950 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":6951 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_RSI", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6952 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_RSI", retCode) - * return outreal - */ - __pyx_v_retCode = TA_RSI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":6953 - * outreal = NaN - * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_RSI", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_RSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":6954 - * retCode = lib.TA_RSI( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_RSI", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6922 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.RSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":6958 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_265SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_264SAR[] = " SAR(high, low[, acceleration=?, maximum=?])\n\n Parabolic SAR (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n acceleration: 0.02\n maximum: 0.2\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_265SAR = {"SAR", (PyCFunction)__pyx_pw_5talib_6stream_265SAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_264SAR}; -static PyObject *__pyx_pw_5talib_6stream_265SAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - double __pyx_v_acceleration; - double __pyx_v_maximum; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_acceleration,&__pyx_n_s_maximum,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, 1); __PYX_ERR(0, 6958, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceleration); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maximum); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAR") < 0)) __PYX_ERR(0, 6958, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_acceleration = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_acceleration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6958, __pyx_L3_error) - } else { - __pyx_v_acceleration = ((double)0.02); - } - if (values[3]) { - __pyx_v_maximum = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_maximum == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6958, __pyx_L3_error) - } else { - __pyx_v_maximum = ((double)0.2); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SAR", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6958, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 6958, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 6958, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_264SAR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_acceleration, __pyx_v_maximum); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_264SAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_acceleration, double __pyx_v_maximum) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":6981 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6982 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__946, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6982, __pyx_L1_error) - - /* "talib/stream.pyx":6981 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":6983 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6984 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__947, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6984, __pyx_L1_error) - - /* "talib/stream.pyx":6983 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6985 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6986 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6986, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6985 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":6987 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":6988 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6989 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__948, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6989, __pyx_L1_error) - - /* "talib/stream.pyx":6988 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":6990 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6991 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__949, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6991, __pyx_L1_error) - - /* "talib/stream.pyx":6990 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":6992 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6993 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 6993, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":6992 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":6994 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":6995 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":6996 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":6997 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__950, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 6997, __pyx_L1_error) - - /* "talib/stream.pyx":6996 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":6998 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":6999 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SAR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_acceleration, __pyx_v_maximum, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7000 - * outreal = NaN - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7001 - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":6958 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7005 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_267SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_266SAREXT[] = " SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?])\n\n Parabolic SAR - Extended (Overlap Studies)\n\n Inputs:\n prices: ['high', 'low']\n Parameters:\n startvalue: 0\n offsetonreverse: 0\n accelerationinitlong: 0.02\n accelerationlong: 0.02\n accelerationmaxlong: 0.2\n accelerationinitshort: 0.02\n accelerationshort: 0.02\n accelerationmaxshort: 0.2\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_267SAREXT = {"SAREXT", (PyCFunction)__pyx_pw_5talib_6stream_267SAREXT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_266SAREXT}; -static PyObject *__pyx_pw_5talib_6stream_267SAREXT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - double __pyx_v_startvalue; - double __pyx_v_offsetonreverse; - double __pyx_v_accelerationinitlong; - double __pyx_v_accelerationlong; - double __pyx_v_accelerationmaxlong; - double __pyx_v_accelerationinitshort; - double __pyx_v_accelerationshort; - double __pyx_v_accelerationmaxshort; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SAREXT (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_startvalue,&__pyx_n_s_offsetonreverse,&__pyx_n_s_accelerationinitlong,&__pyx_n_s_accelerationlong,&__pyx_n_s_accelerationmaxlong,&__pyx_n_s_accelerationinitshort,&__pyx_n_s_accelerationshort,&__pyx_n_s_accelerationmaxshort,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, 1); __PYX_ERR(0, 7005, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startvalue); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offsetonreverse); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitlong); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationlong); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxlong); - if (value) { values[6] = value; kw_args--; } - } - case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationinitshort); - if (value) { values[7] = value; kw_args--; } - } - case 8: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationshort); - if (value) { values[8] = value; kw_args--; } - } - case 9: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accelerationmaxshort); - if (value) { values[9] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SAREXT") < 0)) __PYX_ERR(0, 7005, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_startvalue = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_startvalue == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_startvalue = ((double)-4e37); - } - if (values[3]) { - __pyx_v_offsetonreverse = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_offsetonreverse == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_offsetonreverse = ((double)-4e37); - } - if (values[4]) { - __pyx_v_accelerationinitlong = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_accelerationinitlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationinitlong = ((double)-4e37); - } - if (values[5]) { - __pyx_v_accelerationlong = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_accelerationlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationlong = ((double)-4e37); - } - if (values[6]) { - __pyx_v_accelerationmaxlong = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_accelerationmaxlong == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationmaxlong = ((double)-4e37); - } - if (values[7]) { - __pyx_v_accelerationinitshort = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_accelerationinitshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationinitshort = ((double)-4e37); - } - if (values[8]) { - __pyx_v_accelerationshort = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_accelerationshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationshort = ((double)-4e37); - } - if (values[9]) { - __pyx_v_accelerationmaxshort = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_accelerationmaxshort == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7005, __pyx_L3_error) - } else { - __pyx_v_accelerationmaxshort = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SAREXT", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7005, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7005, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7005, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_266SAREXT(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_266SAREXT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, double __pyx_v_startvalue, double __pyx_v_offsetonreverse, double __pyx_v_accelerationinitlong, double __pyx_v_accelerationlong, double __pyx_v_accelerationmaxlong, double __pyx_v_accelerationinitshort, double __pyx_v_accelerationshort, double __pyx_v_accelerationmaxshort) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SAREXT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - - /* "talib/stream.pyx":7034 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7035 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__951, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7035, __pyx_L1_error) - - /* "talib/stream.pyx":7034 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7036 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7037 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__952, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7037, __pyx_L1_error) - - /* "talib/stream.pyx":7036 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7038 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7039 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7039, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7038 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7040 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7041 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7042 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__953, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7042, __pyx_L1_error) - - /* "talib/stream.pyx":7041 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7043 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7044 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__954, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7044, __pyx_L1_error) - - /* "talib/stream.pyx":7043 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7045 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7046 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7046, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7045 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7047 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7048 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7049 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7050 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__955, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7050, __pyx_L1_error) - - /* "talib/stream.pyx":7049 - * low_data = low.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7051 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAREXT", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7052 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SAREXT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SAREXT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_startvalue, __pyx_v_offsetonreverse, __pyx_v_accelerationinitlong, __pyx_v_accelerationlong, __pyx_v_accelerationmaxlong, __pyx_v_accelerationinitshort, __pyx_v_accelerationshort, __pyx_v_accelerationmaxshort, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7053 - * outreal = NaN - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAREXT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SAREXT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7054 - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SAREXT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7005 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SAREXT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7058 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_269SIN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_268SIN[] = " SIN(real)\n\n Vector Trigonometric Sin (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_269SIN = {"SIN", (PyCFunction)__pyx_pw_5talib_6stream_269SIN, METH_O, __pyx_doc_5talib_6stream_268SIN}; -static PyObject *__pyx_pw_5talib_6stream_269SIN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SIN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7058, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_268SIN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_268SIN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SIN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7077 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7078 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__956, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7078, __pyx_L1_error) - - /* "talib/stream.pyx":7077 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7079 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7080 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__957, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7080, __pyx_L1_error) - - /* "talib/stream.pyx":7079 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7081 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7082 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7082, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7081 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7083 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7084 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7085 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SIN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7086 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SIN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SIN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7087 - * outreal = NaN - * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SIN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SIN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7088 - * retCode = lib.TA_SIN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SIN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7058 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SIN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7092 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_271SINH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_270SINH[] = " SINH(real)\n\n Vector Trigonometric Sinh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_271SINH = {"SINH", (PyCFunction)__pyx_pw_5talib_6stream_271SINH, METH_O, __pyx_doc_5talib_6stream_270SINH}; -static PyObject *__pyx_pw_5talib_6stream_271SINH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SINH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7092, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_270SINH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_270SINH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SINH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7111 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7112 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__958, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7112, __pyx_L1_error) - - /* "talib/stream.pyx":7111 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7113 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7114 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__959, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7114, __pyx_L1_error) - - /* "talib/stream.pyx":7113 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7115 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7116 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7116, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7115 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7117 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7118 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7119 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SINH", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7120 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SINH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SINH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7121 - * outreal = NaN - * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SINH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SINH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7122 - * retCode = lib.TA_SINH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SINH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7092 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SINH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7126 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_273SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_272SMA[] = " SMA(real[, timeperiod=?])\n\n Simple Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_273SMA = {"SMA", (PyCFunction)__pyx_pw_5talib_6stream_273SMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_272SMA}; -static PyObject *__pyx_pw_5talib_6stream_273SMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SMA") < 0)) __PYX_ERR(0, 7126, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7126, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7126, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7126, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_272SMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_272SMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7147 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7148 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__960, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7148, __pyx_L1_error) - - /* "talib/stream.pyx":7147 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7149 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7150 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__961, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7150, __pyx_L1_error) - - /* "talib/stream.pyx":7149 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7151 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7152 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7152, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7151 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7153 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7154 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7155 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7156 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7157 - * outreal = NaN - * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7158 - * retCode = lib.TA_SMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7126 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_275SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_274SQRT[] = " SQRT(real)\n\n Vector Square Root (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_275SQRT = {"SQRT", (PyCFunction)__pyx_pw_5talib_6stream_275SQRT, METH_O, __pyx_doc_5talib_6stream_274SQRT}; -static PyObject *__pyx_pw_5talib_6stream_275SQRT(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SQRT (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7162, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_274SQRT(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_274SQRT(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SQRT", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7181 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7182 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__962, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7182, __pyx_L1_error) - - /* "talib/stream.pyx":7181 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7183 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7184 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__963, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7184, __pyx_L1_error) - - /* "talib/stream.pyx":7183 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7185 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7186 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7186, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7185 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7187 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7188 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7189 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SQRT", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7190 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SQRT", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SQRT((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7191 - * outreal = NaN - * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SQRT", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SQRT, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7192 - * retCode = lib.TA_SQRT( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SQRT", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SQRT", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7196 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_277STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_276STDDEV[] = " STDDEV(real[, timeperiod=?, nbdev=?])\n\n Standard Deviation (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_277STDDEV = {"STDDEV", (PyCFunction)__pyx_pw_5talib_6stream_277STDDEV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_276STDDEV}; -static PyObject *__pyx_pw_5talib_6stream_277STDDEV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdev; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STDDEV (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDDEV") < 0)) __PYX_ERR(0, 7196, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7196, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7196, __pyx_L3_error) - } else { - __pyx_v_nbdev = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STDDEV", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7196, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7196, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_276STDDEV(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_276STDDEV(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("STDDEV", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7218 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7219 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__964, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7219, __pyx_L1_error) - - /* "talib/stream.pyx":7218 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7220 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7221 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__965, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7221, __pyx_L1_error) - - /* "talib/stream.pyx":7220 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7222 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7223 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7223, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7222 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7224 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7225 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7226 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_STDDEV", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7227 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STDDEV", retCode) - * return outreal - */ - __pyx_v_retCode = TA_STDDEV((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7228 - * outreal = NaN - * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_STDDEV", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STDDEV, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7229 - * retCode = lib.TA_STDDEV( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_STDDEV", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7196 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.STDDEV", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7233 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_279STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_278STOCH[] = " STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?])\n\n Stochastic (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n slowk_period: 3\n slowk_matype: 0\n slowd_period: 3\n slowd_matype: 0\n Outputs:\n slowk\n slowd\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_279STOCH = {"STOCH", (PyCFunction)__pyx_pw_5talib_6stream_279STOCH, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_278STOCH}; -static PyObject *__pyx_pw_5talib_6stream_279STOCH(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_fastk_period; - int __pyx_v_slowk_period; - int __pyx_v_slowk_matype; - int __pyx_v_slowd_period; - int __pyx_v_slowd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCH (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_slowk_period,&__pyx_n_s_slowk_matype,&__pyx_n_s_slowd_period,&__pyx_n_s_slowd_matype,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 1); __PYX_ERR(0, 7233, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, 2); __PYX_ERR(0, 7233, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_period); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowk_matype); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_period); - if (value) { values[6] = value; kw_args--; } - } - case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slowd_matype); - if (value) { values[7] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCH") < 0)) __PYX_ERR(0, 7233, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7233, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_slowk_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_slowk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7233, __pyx_L3_error) - } else { - __pyx_v_slowk_period = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_slowk_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_slowk_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7233, __pyx_L3_error) - } else { - __pyx_v_slowk_matype = ((int)0); - } - if (values[6]) { - __pyx_v_slowd_period = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_slowd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7233, __pyx_L3_error) - } else { - __pyx_v_slowd_period = ((int)-2147483648); - } - if (values[7]) { - __pyx_v_slowd_matype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_slowd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7233, __pyx_L3_error) - } else { - __pyx_v_slowd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCH", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7233, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7233, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7233, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7233, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_278STOCH(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_278STOCH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_slowk_period, int __pyx_v_slowk_matype, int __pyx_v_slowd_period, int __pyx_v_slowd_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outslowk; - double __pyx_v_outslowd; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("STOCH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7262 - * double outslowk - * double outslowd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7263 - * double outslowd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__966, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7263, __pyx_L1_error) - - /* "talib/stream.pyx":7262 - * double outslowk - * double outslowd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7264 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7265 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__967, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7265, __pyx_L1_error) - - /* "talib/stream.pyx":7264 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7266 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7267 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7267, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7266 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7268 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7269 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7270 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__968, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7270, __pyx_L1_error) - - /* "talib/stream.pyx":7269 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7271 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7272 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__969, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7272, __pyx_L1_error) - - /* "talib/stream.pyx":7271 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7273 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7274 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7274, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7273 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7275 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7276 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7277 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__970, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7277, __pyx_L1_error) - - /* "talib/stream.pyx":7276 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7278 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7279 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__971, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7279, __pyx_L1_error) - - /* "talib/stream.pyx":7278 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7280 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7281 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7281, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7280 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7282 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7283 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7284 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7285 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__972, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7285, __pyx_L1_error) - - /* "talib/stream.pyx":7284 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7286 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outslowk = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7287 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outslowk = NaN - * outslowd = NaN - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__973, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7287, __pyx_L1_error) - - /* "talib/stream.pyx":7286 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outslowk = NaN - */ - } - - /* "talib/stream.pyx":7288 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outslowk = NaN # <<<<<<<<<<<<<< - * outslowd = NaN - * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) - */ - __pyx_v_outslowk = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7289 - * raise Exception("input lengths are different") - * outslowk = NaN - * outslowd = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) - * _ta_check_success("TA_STOCH", retCode) - */ - __pyx_v_outslowd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7290 - * outslowk = NaN - * outslowd = NaN - * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCH", retCode) - * return outslowk , outslowd - */ - __pyx_v_retCode = TA_STOCH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_fastk_period, __pyx_v_slowk_period, __pyx_v_slowk_matype, __pyx_v_slowd_period, __pyx_v_slowd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outslowk), (&__pyx_v_outslowd)); - - /* "talib/stream.pyx":7291 - * outslowd = NaN - * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) - * _ta_check_success("TA_STOCH", retCode) # <<<<<<<<<<<<<< - * return outslowk , outslowd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7292 - * retCode = lib.TA_STOCH( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , slowk_period , slowk_matype , slowd_period , slowd_matype , &outbegidx , &outnbelement , &outslowk , &outslowd ) - * _ta_check_success("TA_STOCH", retCode) - * return outslowk , outslowd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outslowk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outslowd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7233 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.STOCH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_281STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_280STOCHF[] = " STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Fast (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_281STOCHF = {"STOCHF", (PyCFunction)__pyx_pw_5talib_6stream_281STOCHF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_280STOCHF}; -static PyObject *__pyx_pw_5talib_6stream_281STOCHF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_fastk_period; - int __pyx_v_fastd_period; - int __pyx_v_fastd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCHF (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 1); __PYX_ERR(0, 7296, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, 2); __PYX_ERR(0, 7296, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHF") < 0)) __PYX_ERR(0, 7296, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7296, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7296, __pyx_L3_error) - } else { - __pyx_v_fastd_period = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7296, __pyx_L3_error) - } else { - __pyx_v_fastd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCHF", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7296, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7296, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7296, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7296, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_280STOCHF(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_280STOCHF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outfastk; - double __pyx_v_outfastd; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("STOCHF", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7323 - * double outfastk - * double outfastd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7324 - * double outfastd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__974, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7324, __pyx_L1_error) - - /* "talib/stream.pyx":7323 - * double outfastk - * double outfastd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7325 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7326 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__975, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7326, __pyx_L1_error) - - /* "talib/stream.pyx":7325 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7327 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7328 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7328, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7327 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7329 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7330 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7331 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__976, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7331, __pyx_L1_error) - - /* "talib/stream.pyx":7330 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7332 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7333 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__977, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7333, __pyx_L1_error) - - /* "talib/stream.pyx":7332 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7334 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7335 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7335, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7334 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7336 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7337 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7338 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__978, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7338, __pyx_L1_error) - - /* "talib/stream.pyx":7337 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7339 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7340 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__979, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7340, __pyx_L1_error) - - /* "talib/stream.pyx":7339 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7341 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7342 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7342, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7341 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7343 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7344 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7345 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7346 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__980, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7346, __pyx_L1_error) - - /* "talib/stream.pyx":7345 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7347 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outfastk = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7348 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outfastk = NaN - * outfastd = NaN - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__981, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7348, __pyx_L1_error) - - /* "talib/stream.pyx":7347 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outfastk = NaN - */ - } - - /* "talib/stream.pyx":7349 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outfastk = NaN # <<<<<<<<<<<<<< - * outfastd = NaN - * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - */ - __pyx_v_outfastk = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7350 - * raise Exception("input lengths are different") - * outfastk = NaN - * outfastd = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHF", retCode) - */ - __pyx_v_outfastd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7351 - * outfastk = NaN - * outfastd = NaN - * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCHF", retCode) - * return outfastk , outfastd - */ - __pyx_v_retCode = TA_STOCHF((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outfastk), (&__pyx_v_outfastd)); - - /* "talib/stream.pyx":7352 - * outfastd = NaN - * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHF", retCode) # <<<<<<<<<<<<<< - * return outfastk , outfastd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCHF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7353 - * retCode = lib.TA_STOCHF( length - 1 , length - 1 , high_data , low_data , close_data , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHF", retCode) - * return outfastk , outfastd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outfastk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfastd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.STOCHF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_283STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_282STOCHRSI[] = " STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?])\n\n Stochastic Relative Strength Index (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n fastk_period: 5\n fastd_period: 3\n fastd_matype: 0\n Outputs:\n fastk\n fastd\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_283STOCHRSI = {"STOCHRSI", (PyCFunction)__pyx_pw_5talib_6stream_283STOCHRSI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_282STOCHRSI}; -static PyObject *__pyx_pw_5talib_6stream_283STOCHRSI(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - int __pyx_v_fastk_period; - int __pyx_v_fastd_period; - int __pyx_v_fastd_matype; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("STOCHRSI (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_fastk_period,&__pyx_n_s_fastd_period,&__pyx_n_s_fastd_matype,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastk_period); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_period); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fastd_matype); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STOCHRSI") < 0)) __PYX_ERR(0, 7357, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7357, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_fastk_period = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_fastk_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7357, __pyx_L3_error) - } else { - __pyx_v_fastk_period = ((int)-2147483648); - } - if (values[3]) { - __pyx_v_fastd_period = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_fastd_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7357, __pyx_L3_error) - } else { - __pyx_v_fastd_period = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_fastd_matype = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_fastd_matype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7357, __pyx_L3_error) - } else { - __pyx_v_fastd_matype = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("STOCHRSI", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7357, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7357, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_282STOCHRSI(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_282STOCHRSI(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, int __pyx_v_fastk_period, int __pyx_v_fastd_period, int __pyx_v_fastd_matype) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outfastk; - double __pyx_v_outfastd; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("STOCHRSI", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7383 - * double outfastk - * double outfastd - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7384 - * double outfastd - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__982, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7384, __pyx_L1_error) - - /* "talib/stream.pyx":7383 - * double outfastk - * double outfastd - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7385 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7386 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__983, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7386, __pyx_L1_error) - - /* "talib/stream.pyx":7385 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7387 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7388 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7388, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7387 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7389 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outfastk = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7390 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outfastk = NaN - * outfastd = NaN - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7391 - * real_data = real.data - * length = real.shape[0] - * outfastk = NaN # <<<<<<<<<<<<<< - * outfastd = NaN - * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - */ - __pyx_v_outfastk = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7392 - * length = real.shape[0] - * outfastk = NaN - * outfastd = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHRSI", retCode) - */ - __pyx_v_outfastd = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7393 - * outfastk = NaN - * outfastd = NaN - * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_STOCHRSI", retCode) - * return outfastk , outfastd - */ - __pyx_v_retCode = TA_STOCHRSI((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_fastk_period, __pyx_v_fastd_period, __pyx_v_fastd_matype, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outfastk), (&__pyx_v_outfastd)); - - /* "talib/stream.pyx":7394 - * outfastd = NaN - * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHRSI", retCode) # <<<<<<<<<<<<<< - * return outfastk , outfastd - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_STOCHRSI, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7395 - * retCode = lib.TA_STOCHRSI( length - 1 , length - 1 , real_data , timeperiod , fastk_period , fastd_period , fastd_matype , &outbegidx , &outnbelement , &outfastk , &outfastd ) - * _ta_check_success("TA_STOCHRSI", retCode) - * return outfastk , outfastd # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outfastk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_outfastd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("talib.stream.STOCHRSI", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_285SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_284SUB[] = " SUB(real0, real1)\n\n Vector Arithmetic Substraction (Math Operators)\n\n Inputs:\n real0: (any ndarray)\n real1: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_285SUB = {"SUB", (PyCFunction)__pyx_pw_5talib_6stream_285SUB, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_284SUB}; -static PyObject *__pyx_pw_5talib_6stream_285SUB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real0 = 0; - PyArrayObject *__pyx_v_real1 = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SUB (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real0,&__pyx_n_s_real1,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, 1); __PYX_ERR(0, 7399, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUB") < 0)) __PYX_ERR(0, 7399, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_real0 = ((PyArrayObject *)values[0]); - __pyx_v_real1 = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SUB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7399, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real0), __pyx_ptype_5numpy_ndarray, 0, "real0", 0))) __PYX_ERR(0, 7399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real1), __pyx_ptype_5numpy_ndarray, 0, "real1", 0))) __PYX_ERR(0, 7399, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_284SUB(__pyx_self, __pyx_v_real0, __pyx_v_real1); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_284SUB(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real0, PyArrayObject *__pyx_v_real1) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real0_data; - double *__pyx_v_real1_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SUB", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real0); - __Pyx_INCREF((PyObject *)__pyx_v_real1); - - /* "talib/stream.pyx":7420 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real0) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7421 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__984, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7421, __pyx_L1_error) - - /* "talib/stream.pyx":7420 - * int outnbelement - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real0 is not double") - * if real0.ndim != 1: - */ - } - - /* "talib/stream.pyx":7422 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real0->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7423 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__985, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7423, __pyx_L1_error) - - /* "talib/stream.pyx":7422 - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") - * if real0.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7424 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real0) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7425 - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) # <<<<<<<<<<<<<< - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7425, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real0, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7424 - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - */ - } - - /* "talib/stream.pyx":7426 - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - */ - __pyx_v_real0_data = ((double *)__pyx_v_real0->data); - - /* "talib/stream.pyx":7427 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real1) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7428 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__986, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7428, __pyx_L1_error) - - /* "talib/stream.pyx":7427 - * real0 = PyArray_GETCONTIGUOUS(real0) - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real1 is not double") - * if real1.ndim != 1: - */ - } - - /* "talib/stream.pyx":7429 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real1->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7430 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__987, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7430, __pyx_L1_error) - - /* "talib/stream.pyx":7429 - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") - * if real1.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7431 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real1) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7432 - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) # <<<<<<<<<<<<<< - * real1_data = real1.data - * length = real0.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7432, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real1, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7431 - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - */ - } - - /* "talib/stream.pyx":7433 - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data # <<<<<<<<<<<<<< - * length = real0.shape[0] - * if length != real1.shape[0]: - */ - __pyx_v_real1_data = ((double *)__pyx_v_real1->data); - - /* "talib/stream.pyx":7434 - * real1 = PyArray_GETCONTIGUOUS(real1) - * real1_data = real1.data - * length = real0.shape[0] # <<<<<<<<<<<<<< - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_real0->dimensions[0]); - - /* "talib/stream.pyx":7435 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_real1->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7436 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__988, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7436, __pyx_L1_error) - - /* "talib/stream.pyx":7435 - * real1_data = real1.data - * length = real0.shape[0] - * if length != real1.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7437 - * if length != real1.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUB", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7438 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SUB", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SUB((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real0_data, __pyx_v_real1_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7439 - * outreal = NaN - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUB", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SUB, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7440 - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUB", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SUB", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real0); - __Pyx_XDECREF((PyObject *)__pyx_v_real1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7444 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_287SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_286SUM[] = " SUM(real[, timeperiod=?])\n\n Summation (Math Operators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_287SUM = {"SUM", (PyCFunction)__pyx_pw_5talib_6stream_287SUM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_286SUM}; -static PyObject *__pyx_pw_5talib_6stream_287SUM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("SUM (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SUM") < 0)) __PYX_ERR(0, 7444, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7444, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SUM", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7444, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7444, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_286SUM(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_286SUM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SUM", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7465 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7466 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__989, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7466, __pyx_L1_error) - - /* "talib/stream.pyx":7465 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7467 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7468 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__990, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7468, __pyx_L1_error) - - /* "talib/stream.pyx":7467 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7469 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7470 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7470, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7469 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7471 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7472 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7473 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUM", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7474 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_SUM", retCode) - * return outreal - */ - __pyx_v_retCode = TA_SUM((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7475 - * outreal = NaN - * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUM", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_SUM, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7476 - * retCode = lib.TA_SUM( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_SUM", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7444 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.SUM", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7480 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_289T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_288T3[] = " T3(real[, timeperiod=?, vfactor=?])\n\n Triple Exponential Moving Average (T3) (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n vfactor: 0.7\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_289T3 = {"T3", (PyCFunction)__pyx_pw_5talib_6stream_289T3, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_288T3}; -static PyObject *__pyx_pw_5talib_6stream_289T3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_vfactor; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("T3 (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_vfactor,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vfactor); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "T3") < 0)) __PYX_ERR(0, 7480, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7480, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_vfactor = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_vfactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7480, __pyx_L3_error) - } else { - __pyx_v_vfactor = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("T3", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7480, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7480, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_288T3(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_vfactor); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_288T3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_vfactor) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("T3", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7502 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7503 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__991, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7503, __pyx_L1_error) - - /* "talib/stream.pyx":7502 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7504 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7505 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__992, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7505, __pyx_L1_error) - - /* "talib/stream.pyx":7504 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7506 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7507 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7507, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7506 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7508 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7509 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7510 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_T3", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7511 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_T3", retCode) - * return outreal - */ - __pyx_v_retCode = TA_T3((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_vfactor, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7512 - * outreal = NaN - * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_T3", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_T3, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7513 - * retCode = lib.TA_T3( length - 1 , length - 1 , real_data , timeperiod , vfactor , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_T3", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7480 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.T3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7517 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_291TAN(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_290TAN[] = " TAN(real)\n\n Vector Trigonometric Tan (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_291TAN = {"TAN", (PyCFunction)__pyx_pw_5talib_6stream_291TAN, METH_O, __pyx_doc_5talib_6stream_290TAN}; -static PyObject *__pyx_pw_5talib_6stream_291TAN(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TAN (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7517, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_290TAN(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_290TAN(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TAN", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7536 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7537 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__993, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7537, __pyx_L1_error) - - /* "talib/stream.pyx":7536 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7538 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7539 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__994, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7539, __pyx_L1_error) - - /* "talib/stream.pyx":7538 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7540 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7541 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7541, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7540 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7542 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7543 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7544 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TAN", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7545 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TAN", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TAN((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7546 - * outreal = NaN - * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TAN", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TAN, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7547 - * retCode = lib.TA_TAN( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TAN", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7517 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TAN", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_293TANH(PyObject *__pyx_self, PyObject *__pyx_v_real); /*proto*/ -static char __pyx_doc_5talib_6stream_292TANH[] = " TANH(real)\n\n Vector Trigonometric Tanh (Math Transform)\n\n Inputs:\n real: (any ndarray)\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_293TANH = {"TANH", (PyCFunction)__pyx_pw_5talib_6stream_293TANH, METH_O, __pyx_doc_5talib_6stream_292TANH}; -static PyObject *__pyx_pw_5talib_6stream_293TANH(PyObject *__pyx_self, PyObject *__pyx_v_real) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TANH (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7551, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_292TANH(__pyx_self, ((PyArrayObject *)__pyx_v_real)); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_292TANH(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TANH", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7570 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7571 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__995, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7571, __pyx_L1_error) - - /* "talib/stream.pyx":7570 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7572 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7573 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__996, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7573, __pyx_L1_error) - - /* "talib/stream.pyx":7572 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7574 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7575 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7575, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7574 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7576 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7577 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7578 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TANH", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7579 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TANH", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TANH((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7580 - * outreal = NaN - * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TANH", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TANH, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7581 - * retCode = lib.TA_TANH( length - 1 , length - 1 , real_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TANH", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TANH", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_295TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_294TEMA[] = " TEMA(real[, timeperiod=?])\n\n Triple Exponential Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_295TEMA = {"TEMA", (PyCFunction)__pyx_pw_5talib_6stream_295TEMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_294TEMA}; -static PyObject *__pyx_pw_5talib_6stream_295TEMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TEMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TEMA") < 0)) __PYX_ERR(0, 7585, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7585, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TEMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7585, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7585, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_294TEMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_294TEMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TEMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7606 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7607 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__997, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7607, __pyx_L1_error) - - /* "talib/stream.pyx":7606 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7608 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7609 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__998, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7609, __pyx_L1_error) - - /* "talib/stream.pyx":7608 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7610 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7611 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7611, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7610 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7612 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7613 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7614 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TEMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7615 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TEMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TEMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7616 - * outreal = NaN - * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TEMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TEMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7617 - * retCode = lib.TA_TEMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TEMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TEMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7621 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_297TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_296TRANGE[] = " TRANGE(high, low, close)\n\n True Range (Volatility Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_297TRANGE = {"TRANGE", (PyCFunction)__pyx_pw_5talib_6stream_297TRANGE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_296TRANGE}; -static PyObject *__pyx_pw_5talib_6stream_297TRANGE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRANGE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 1); __PYX_ERR(0, 7621, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, 2); __PYX_ERR(0, 7621, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRANGE") < 0)) __PYX_ERR(0, 7621, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRANGE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7621, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7621, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7621, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7621, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_296TRANGE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_296TRANGE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TRANGE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7642 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7643 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__999, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7643, __pyx_L1_error) - - /* "talib/stream.pyx":7642 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7644 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7645 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1000, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7645, __pyx_L1_error) - - /* "talib/stream.pyx":7644 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7646 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7647 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7647, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7646 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7648 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7649 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7650 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1001, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7650, __pyx_L1_error) - - /* "talib/stream.pyx":7649 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7651 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7652 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1002, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7652, __pyx_L1_error) - - /* "talib/stream.pyx":7651 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7653 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7654 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7654, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7653 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7655 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7656 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7657 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1003, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7657, __pyx_L1_error) - - /* "talib/stream.pyx":7656 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7658 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7659 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1004, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7659, __pyx_L1_error) - - /* "talib/stream.pyx":7658 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7660 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7661 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7661, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7660 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7662 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7663 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7664 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7665 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1005, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7665, __pyx_L1_error) - - /* "talib/stream.pyx":7664 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7666 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7667 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1006, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7667, __pyx_L1_error) - - /* "talib/stream.pyx":7666 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7668 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRANGE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7669 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRANGE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRANGE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7670 - * outreal = NaN - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRANGE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRANGE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7671 - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRANGE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7621 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TRANGE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_299TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_298TRIMA[] = " TRIMA(real[, timeperiod=?])\n\n Triangular Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_299TRIMA = {"TRIMA", (PyCFunction)__pyx_pw_5talib_6stream_299TRIMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_298TRIMA}; -static PyObject *__pyx_pw_5talib_6stream_299TRIMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRIMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIMA") < 0)) __PYX_ERR(0, 7675, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7675, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRIMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7675, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7675, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_298TRIMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_298TRIMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TRIMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7696 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7697 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1007, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7697, __pyx_L1_error) - - /* "talib/stream.pyx":7696 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7698 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7699 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1008, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7699, __pyx_L1_error) - - /* "talib/stream.pyx":7698 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7700 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7701 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7701, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7700 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7702 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7703 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7704 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7705 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRIMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRIMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7706 - * outreal = NaN - * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRIMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7707 - * retCode = lib.TA_TRIMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TRIMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7711 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_301TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_300TRIX[] = " TRIX(real[, timeperiod=?])\n\n 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (Momentum Indicators)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_301TRIX = {"TRIX", (PyCFunction)__pyx_pw_5talib_6stream_301TRIX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_300TRIX}; -static PyObject *__pyx_pw_5talib_6stream_301TRIX(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TRIX (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TRIX") < 0)) __PYX_ERR(0, 7711, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7711, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TRIX", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7711, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7711, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_300TRIX(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_300TRIX(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TRIX", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7732 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7733 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1009, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7733, __pyx_L1_error) - - /* "talib/stream.pyx":7732 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7734 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7735 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1010, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7735, __pyx_L1_error) - - /* "talib/stream.pyx":7734 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7736 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7737 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7737, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7736 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7738 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7739 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7740 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIX", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7741 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TRIX", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TRIX((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7742 - * outreal = NaN - * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIX", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TRIX, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7743 - * retCode = lib.TA_TRIX( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TRIX", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7711 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TRIX", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7747 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_303TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_302TSF[] = " TSF(real[, timeperiod=?])\n\n Time Series Forecast (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_303TSF = {"TSF", (PyCFunction)__pyx_pw_5talib_6stream_303TSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_302TSF}; -static PyObject *__pyx_pw_5talib_6stream_303TSF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TSF (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TSF") < 0)) __PYX_ERR(0, 7747, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7747, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TSF", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7747, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7747, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_302TSF(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_302TSF(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TSF", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7768 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7769 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1011, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7769, __pyx_L1_error) - - /* "talib/stream.pyx":7768 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7770 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7771 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1012, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7771, __pyx_L1_error) - - /* "talib/stream.pyx":7770 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7772 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7773 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7773, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7772 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7774 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7775 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7776 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TSF", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7777 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TSF", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TSF((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7778 - * outreal = NaN - * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TSF", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TSF, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7779 - * retCode = lib.TA_TSF( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TSF", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7747 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TSF", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7783 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_305TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_304TYPPRICE[] = " TYPPRICE(high, low, close)\n\n Typical Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_305TYPPRICE = {"TYPPRICE", (PyCFunction)__pyx_pw_5talib_6stream_305TYPPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_304TYPPRICE}; -static PyObject *__pyx_pw_5talib_6stream_305TYPPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TYPPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 1); __PYX_ERR(0, 7783, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, 2); __PYX_ERR(0, 7783, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TYPPRICE") < 0)) __PYX_ERR(0, 7783, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TYPPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7783, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7783, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7783, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7783, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_304TYPPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_304TYPPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("TYPPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7804 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7805 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1013, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7805, __pyx_L1_error) - - /* "talib/stream.pyx":7804 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7806 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7807 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1014, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7807, __pyx_L1_error) - - /* "talib/stream.pyx":7806 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7808 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7809 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7809, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7808 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7810 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7811 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7812 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1015, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7812, __pyx_L1_error) - - /* "talib/stream.pyx":7811 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7813 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7814 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1016, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7814, __pyx_L1_error) - - /* "talib/stream.pyx":7813 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7815 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7816 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7816, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7815 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7817 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7818 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7819 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1017, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7819, __pyx_L1_error) - - /* "talib/stream.pyx":7818 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7820 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7821 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1018, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7821, __pyx_L1_error) - - /* "talib/stream.pyx":7820 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7822 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7823 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7823, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7822 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7824 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7825 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7826 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7827 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1019, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7827, __pyx_L1_error) - - /* "talib/stream.pyx":7826 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7828 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7829 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1020, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7829, __pyx_L1_error) - - /* "talib/stream.pyx":7828 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7830 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TYPPRICE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7831 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_TYPPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_TYPPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7832 - * outreal = NaN - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TYPPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_TYPPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7833 - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_TYPPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7783 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.TYPPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_307ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_306ULTOSC[] = " ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?])\n\n Ultimate Oscillator (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod1: 7\n timeperiod2: 14\n timeperiod3: 28\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_307ULTOSC = {"ULTOSC", (PyCFunction)__pyx_pw_5talib_6stream_307ULTOSC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_306ULTOSC}; -static PyObject *__pyx_pw_5talib_6stream_307ULTOSC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod1; - int __pyx_v_timeperiod2; - int __pyx_v_timeperiod3; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ULTOSC (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod1,&__pyx_n_s_timeperiod2,&__pyx_n_s_timeperiod3,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 1); __PYX_ERR(0, 7837, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, 2); __PYX_ERR(0, 7837, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod1); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod2); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod3); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ULTOSC") < 0)) __PYX_ERR(0, 7837, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7837, __pyx_L3_error) - } else { - __pyx_v_timeperiod1 = ((int)-2147483648); - } - if (values[4]) { - __pyx_v_timeperiod2 = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_timeperiod2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7837, __pyx_L3_error) - } else { - __pyx_v_timeperiod2 = ((int)-2147483648); - } - if (values[5]) { - __pyx_v_timeperiod3 = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_timeperiod3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7837, __pyx_L3_error) - } else { - __pyx_v_timeperiod3 = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ULTOSC", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7837, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7837, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7837, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7837, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_306ULTOSC(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_306ULTOSC(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod1, int __pyx_v_timeperiod2, int __pyx_v_timeperiod3) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("ULTOSC", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7862 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7863 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1021, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7863, __pyx_L1_error) - - /* "talib/stream.pyx":7862 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7864 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7865 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1022, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7865, __pyx_L1_error) - - /* "talib/stream.pyx":7864 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7866 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7867 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7867, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7866 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7868 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7869 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7870 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1023, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7870, __pyx_L1_error) - - /* "talib/stream.pyx":7869 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7871 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7872 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1024, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7872, __pyx_L1_error) - - /* "talib/stream.pyx":7871 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7873 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7874 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7874, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7873 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7875 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7876 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7877 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1025, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7877, __pyx_L1_error) - - /* "talib/stream.pyx":7876 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7878 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7879 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1026, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7879, __pyx_L1_error) - - /* "talib/stream.pyx":7878 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7880 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7881 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7881, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7880 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7882 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7883 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7884 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7885 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1027, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7885, __pyx_L1_error) - - /* "talib/stream.pyx":7884 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7886 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7887 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1028, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7887, __pyx_L1_error) - - /* "talib/stream.pyx":7886 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7888 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ULTOSC", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7889 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_ULTOSC", retCode) - * return outreal - */ - __pyx_v_retCode = TA_ULTOSC((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod1, __pyx_v_timeperiod2, __pyx_v_timeperiod3, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7890 - * outreal = NaN - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ULTOSC", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_ULTOSC, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7891 - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_ULTOSC", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.ULTOSC", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7895 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_309VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_308VAR[] = " VAR(real[, timeperiod=?, nbdev=?])\n\n Variance (Statistic Functions)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 5\n nbdev: 1\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_309VAR = {"VAR", (PyCFunction)__pyx_pw_5talib_6stream_309VAR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_308VAR}; -static PyObject *__pyx_pw_5talib_6stream_309VAR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - double __pyx_v_nbdev; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("VAR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,&__pyx_n_s_nbdev,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nbdev); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "VAR") < 0)) __PYX_ERR(0, 7895, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7895, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - if (values[2]) { - __pyx_v_nbdev = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_nbdev == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7895, __pyx_L3_error) - } else { - __pyx_v_nbdev = ((double)-4e37); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("VAR", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7895, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 7895, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_308VAR(__pyx_self, __pyx_v_real, __pyx_v_timeperiod, __pyx_v_nbdev); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_308VAR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod, double __pyx_v_nbdev) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("VAR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":7917 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7918 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1029, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7918, __pyx_L1_error) - - /* "talib/stream.pyx":7917 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":7919 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7920 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1030, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7920, __pyx_L1_error) - - /* "talib/stream.pyx":7919 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7921 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7922 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7922, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7921 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":7923 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":7924 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":7925 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_VAR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7926 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_VAR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_VAR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, __pyx_v_nbdev, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7927 - * outreal = NaN - * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_VAR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_VAR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7928 - * retCode = lib.TA_VAR( length - 1 , length - 1 , real_data , timeperiod , nbdev , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_VAR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7895 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.VAR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7932 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_311WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_310WCLPRICE[] = " WCLPRICE(high, low, close)\n\n Weighted Close Price (Price Transform)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_311WCLPRICE = {"WCLPRICE", (PyCFunction)__pyx_pw_5talib_6stream_311WCLPRICE, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_310WCLPRICE}; -static PyObject *__pyx_pw_5talib_6stream_311WCLPRICE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WCLPRICE (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 1); __PYX_ERR(0, 7932, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, 2); __PYX_ERR(0, 7932, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WCLPRICE") < 0)) __PYX_ERR(0, 7932, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WCLPRICE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7932, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7932, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7932, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7932, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_310WCLPRICE(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_310WCLPRICE(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("WCLPRICE", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":7953 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7954 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1031, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7954, __pyx_L1_error) - - /* "talib/stream.pyx":7953 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":7955 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7956 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1032, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7956, __pyx_L1_error) - - /* "talib/stream.pyx":7955 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7957 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7958 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7958, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7957 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":7959 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":7960 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7961 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1033, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7961, __pyx_L1_error) - - /* "talib/stream.pyx":7960 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":7962 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7963 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1034, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7963, __pyx_L1_error) - - /* "talib/stream.pyx":7962 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7964 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7965 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7965, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7964 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":7966 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":7967 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7968 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1035, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7968, __pyx_L1_error) - - /* "talib/stream.pyx":7967 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":7969 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7970 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1036, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7970, __pyx_L1_error) - - /* "talib/stream.pyx":7969 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":7971 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7972 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 7972, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":7971 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":7973 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":7974 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":7975 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7976 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1037, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7976, __pyx_L1_error) - - /* "talib/stream.pyx":7975 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":7977 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":7978 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1038, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 7978, __pyx_L1_error) - - /* "talib/stream.pyx":7977 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":7979 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WCLPRICE", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":7980 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WCLPRICE", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WCLPRICE((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":7981 - * outreal = NaN - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WCLPRICE", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WCLPRICE, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":7982 - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WCLPRICE", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7932 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.WCLPRICE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":7986 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_313WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_312WILLR[] = " WILLR(high, low, close[, timeperiod=?])\n\n Williams' %R (Momentum Indicators)\n\n Inputs:\n prices: ['high', 'low', 'close']\n Parameters:\n timeperiod: 14\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_313WILLR = {"WILLR", (PyCFunction)__pyx_pw_5talib_6stream_313WILLR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_312WILLR}; -static PyObject *__pyx_pw_5talib_6stream_313WILLR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_high = 0; - PyArrayObject *__pyx_v_low = 0; - PyArrayObject *__pyx_v_close = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WILLR (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_high,&__pyx_n_s_low,&__pyx_n_s_close,&__pyx_n_s_timeperiod,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_high)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 1); __PYX_ERR(0, 7986, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, 2); __PYX_ERR(0, 7986, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WILLR") < 0)) __PYX_ERR(0, 7986, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_high = ((PyArrayObject *)values[0]); - __pyx_v_low = ((PyArrayObject *)values[1]); - __pyx_v_close = ((PyArrayObject *)values[2]); - if (values[3]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7986, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WILLR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7986, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_high), __pyx_ptype_5numpy_ndarray, 0, "high", 0))) __PYX_ERR(0, 7986, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_low), __pyx_ptype_5numpy_ndarray, 0, "low", 0))) __PYX_ERR(0, 7986, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_close), __pyx_ptype_5numpy_ndarray, 0, "close", 0))) __PYX_ERR(0, 7986, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_312WILLR(__pyx_self, __pyx_v_high, __pyx_v_low, __pyx_v_close, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_312WILLR(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_high, PyArrayObject *__pyx_v_low, PyArrayObject *__pyx_v_close, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_high_data; - double *__pyx_v_low_data; - double *__pyx_v_close_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("WILLR", 0); - __Pyx_INCREF((PyObject *)__pyx_v_high); - __Pyx_INCREF((PyObject *)__pyx_v_low); - __Pyx_INCREF((PyObject *)__pyx_v_close); - - /* "talib/stream.pyx":8009 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_high) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8010 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1039, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8010, __pyx_L1_error) - - /* "talib/stream.pyx":8009 - * int outnbelement - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("high is not double") - * if high.ndim != 1: - */ - } - - /* "talib/stream.pyx":8011 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_high->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8012 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1040, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8012, __pyx_L1_error) - - /* "talib/stream.pyx":8011 - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") - * if high.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":8013 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_high) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8014 - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) # <<<<<<<<<<<<<< - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8014, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_high, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":8013 - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - */ - } - - /* "talib/stream.pyx":8015 - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - */ - __pyx_v_high_data = ((double *)__pyx_v_high->data); - - /* "talib/stream.pyx":8016 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_low) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8017 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1041, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8017, __pyx_L1_error) - - /* "talib/stream.pyx":8016 - * high = PyArray_GETCONTIGUOUS(high) - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("low is not double") - * if low.ndim != 1: - */ - } - - /* "talib/stream.pyx":8018 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_low->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8019 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1042, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8019, __pyx_L1_error) - - /* "talib/stream.pyx":8018 - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") - * if low.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":8020 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_low) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8021 - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) # <<<<<<<<<<<<<< - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8021, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_low, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":8020 - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - */ - } - - /* "talib/stream.pyx":8022 - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data # <<<<<<<<<<<<<< - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - */ - __pyx_v_low_data = ((double *)__pyx_v_low->data); - - /* "talib/stream.pyx":8023 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_close) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8024 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1043, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8024, __pyx_L1_error) - - /* "talib/stream.pyx":8023 - * low = PyArray_GETCONTIGUOUS(low) - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("close is not double") - * if close.ndim != 1: - */ - } - - /* "talib/stream.pyx":8025 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_close->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8026 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1044, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8026, __pyx_L1_error) - - /* "talib/stream.pyx":8025 - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") - * if close.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":8027 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_close) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8028 - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) # <<<<<<<<<<<<<< - * close_data = close.data - * length = high.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8028, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_close, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":8027 - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - */ - } - - /* "talib/stream.pyx":8029 - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data # <<<<<<<<<<<<<< - * length = high.shape[0] - * if length != low.shape[0]: - */ - __pyx_v_close_data = ((double *)__pyx_v_close->data); - - /* "talib/stream.pyx":8030 - * close = PyArray_GETCONTIGUOUS(close) - * close_data = close.data - * length = high.shape[0] # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_v_length = (__pyx_v_high->dimensions[0]); - - /* "talib/stream.pyx":8031 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_low->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8032 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1045, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8032, __pyx_L1_error) - - /* "talib/stream.pyx":8031 - * close_data = close.data - * length = high.shape[0] - * if length != low.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * if length != close.shape[0]: - */ - } - - /* "talib/stream.pyx":8033 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - __pyx_t_1 = ((__pyx_v_length != (__pyx_v_close->dimensions[0])) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8034 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1046, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8034, __pyx_L1_error) - - /* "talib/stream.pyx":8033 - * if length != low.shape[0]: - * raise Exception("input lengths are different") - * if length != close.shape[0]: # <<<<<<<<<<<<<< - * raise Exception("input lengths are different") - * outreal = NaN - */ - } - - /* "talib/stream.pyx":8035 - * if length != close.shape[0]: - * raise Exception("input lengths are different") - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WILLR", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":8036 - * raise Exception("input lengths are different") - * outreal = NaN - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WILLR", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WILLR((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_high_data, __pyx_v_low_data, __pyx_v_close_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":8037 - * outreal = NaN - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WILLR", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WILLR, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":8038 - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WILLR", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":7986 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.WILLR", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_high); - __Pyx_XDECREF((PyObject *)__pyx_v_low); - __Pyx_XDECREF((PyObject *)__pyx_v_close); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "talib/stream.pyx":8042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5talib_6stream_315WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5talib_6stream_314WMA[] = " WMA(real[, timeperiod=?])\n\n Weighted Moving Average (Overlap Studies)\n\n Inputs:\n real: (any ndarray)\n Parameters:\n timeperiod: 30\n Outputs:\n real\n "; -static PyMethodDef __pyx_mdef_5talib_6stream_315WMA = {"WMA", (PyCFunction)__pyx_pw_5talib_6stream_315WMA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5talib_6stream_314WMA}; -static PyObject *__pyx_pw_5talib_6stream_315WMA(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_real = 0; - int __pyx_v_timeperiod; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("WMA (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_real,&__pyx_n_s_timeperiod,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeperiod); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WMA") < 0)) __PYX_ERR(0, 8042, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_real = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_timeperiod = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_timeperiod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8042, __pyx_L3_error) - } else { - __pyx_v_timeperiod = ((int)-2147483648); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("WMA", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8042, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("talib.stream.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_real), __pyx_ptype_5numpy_ndarray, 0, "real", 0))) __PYX_ERR(0, 8042, __pyx_L1_error) - __pyx_r = __pyx_pf_5talib_6stream_314WMA(__pyx_self, __pyx_v_real, __pyx_v_timeperiod); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5talib_6stream_314WMA(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_real, int __pyx_v_timeperiod) { - npy_intp __pyx_v_length; - TA_RetCode __pyx_v_retCode; - double *__pyx_v_real_data; - int __pyx_v_outbegidx; - int __pyx_v_outnbelement; - double __pyx_v_outreal; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("WMA", 0); - __Pyx_INCREF((PyObject *)__pyx_v_real); - - /* "talib/stream.pyx":8063 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - __pyx_t_1 = ((PyArray_TYPE(__pyx_v_real) != NPY_DOUBLE) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8064 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1047, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8064, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8064, __pyx_L1_error) - - /* "talib/stream.pyx":8063 - * int outnbelement - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: # <<<<<<<<<<<<<< - * raise Exception("real is not double") - * if real.ndim != 1: - */ - } - - /* "talib/stream.pyx":8065 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - __pyx_t_1 = ((__pyx_v_real->nd != 1) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8066 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__1048, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 8066, __pyx_L1_error) - - /* "talib/stream.pyx":8065 - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") - * if real.ndim != 1: # <<<<<<<<<<<<<< - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - */ - } - - /* "talib/stream.pyx":8067 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - __pyx_t_1 = ((!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)) != 0); - if (__pyx_t_1) { - - /* "talib/stream.pyx":8068 - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) # <<<<<<<<<<<<<< - * real_data = real.data - * length = real.shape[0] - */ - __pyx_t_2 = PyArray_GETCONTIGUOUS(__pyx_v_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 8068, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_real, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "talib/stream.pyx":8067 - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): # <<<<<<<<<<<<<< - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - */ - } - - /* "talib/stream.pyx":8069 - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data # <<<<<<<<<<<<<< - * length = real.shape[0] - * outreal = NaN - */ - __pyx_v_real_data = ((double *)__pyx_v_real->data); - - /* "talib/stream.pyx":8070 - * real = PyArray_GETCONTIGUOUS(real) - * real_data = real.data - * length = real.shape[0] # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_v_length = (__pyx_v_real->dimensions[0]); - - /* "talib/stream.pyx":8071 - * real_data = real.data - * length = real.shape[0] - * outreal = NaN # <<<<<<<<<<<<<< - * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WMA", retCode) - */ - __pyx_v_outreal = __pyx_v_5talib_6stream_NaN; - - /* "talib/stream.pyx":8072 - * length = real.shape[0] - * outreal = NaN - * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) # <<<<<<<<<<<<<< - * _ta_check_success("TA_WMA", retCode) - * return outreal - */ - __pyx_v_retCode = TA_WMA((__pyx_v_length - 1), (__pyx_v_length - 1), __pyx_v_real_data, __pyx_v_timeperiod, (&__pyx_v_outbegidx), (&__pyx_v_outnbelement), (&__pyx_v_outreal)); - - /* "talib/stream.pyx":8073 - * outreal = NaN - * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WMA", retCode) # <<<<<<<<<<<<<< - * return outreal - * - */ - __pyx_t_2 = __pyx_f_5talib_6common__ta_check_success(__pyx_n_s_TA_WMA, __pyx_v_retCode, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "talib/stream.pyx":8074 - * retCode = lib.TA_WMA( length - 1 , length - 1 , real_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - * _ta_check_success("TA_WMA", retCode) - * return outreal # <<<<<<<<<<<<<< - * - * __all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_outreal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "talib/stream.pyx":8042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("talib.stream.WMA", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_real); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1049, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1050, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * - */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1051, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__1052, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L7_bool_binop_done:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__1053, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__1054, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) - */ - /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr - */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * - */ - Py_XDECREF(__pyx_v_arr->base); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "stream", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_ACOS, __pyx_k_ACOS, sizeof(__pyx_k_ACOS), 0, 0, 1, 1}, - {&__pyx_n_s_AD, __pyx_k_AD, sizeof(__pyx_k_AD), 0, 0, 1, 1}, - {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1}, - {&__pyx_n_s_ADOSC, __pyx_k_ADOSC, sizeof(__pyx_k_ADOSC), 0, 0, 1, 1}, - {&__pyx_n_s_ADX, __pyx_k_ADX, sizeof(__pyx_k_ADX), 0, 0, 1, 1}, - {&__pyx_n_s_ADXR, __pyx_k_ADXR, sizeof(__pyx_k_ADXR), 0, 0, 1, 1}, - {&__pyx_n_s_APO, __pyx_k_APO, sizeof(__pyx_k_APO), 0, 0, 1, 1}, - {&__pyx_n_s_AROON, __pyx_k_AROON, sizeof(__pyx_k_AROON), 0, 0, 1, 1}, - {&__pyx_n_s_AROONOSC, __pyx_k_AROONOSC, sizeof(__pyx_k_AROONOSC), 0, 0, 1, 1}, - {&__pyx_n_s_ASIN, __pyx_k_ASIN, sizeof(__pyx_k_ASIN), 0, 0, 1, 1}, - {&__pyx_n_s_ATAN, __pyx_k_ATAN, sizeof(__pyx_k_ATAN), 0, 0, 1, 1}, - {&__pyx_n_s_ATR, __pyx_k_ATR, sizeof(__pyx_k_ATR), 0, 0, 1, 1}, - {&__pyx_n_s_AVGPRICE, __pyx_k_AVGPRICE, sizeof(__pyx_k_AVGPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_BBANDS, __pyx_k_BBANDS, sizeof(__pyx_k_BBANDS), 0, 0, 1, 1}, - {&__pyx_n_s_BETA, __pyx_k_BETA, sizeof(__pyx_k_BETA), 0, 0, 1, 1}, - {&__pyx_n_s_BOP, __pyx_k_BOP, sizeof(__pyx_k_BOP), 0, 0, 1, 1}, - {&__pyx_n_s_CCI, __pyx_k_CCI, sizeof(__pyx_k_CCI), 0, 0, 1, 1}, - {&__pyx_n_s_CDL2CROWS, __pyx_k_CDL2CROWS, sizeof(__pyx_k_CDL2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3BLACKCROWS, __pyx_k_CDL3BLACKCROWS, sizeof(__pyx_k_CDL3BLACKCROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3INSIDE, __pyx_k_CDL3INSIDE, sizeof(__pyx_k_CDL3INSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3LINESTRIKE, __pyx_k_CDL3LINESTRIKE, sizeof(__pyx_k_CDL3LINESTRIKE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3OUTSIDE, __pyx_k_CDL3OUTSIDE, sizeof(__pyx_k_CDL3OUTSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3STARSINSOUTH, __pyx_k_CDL3STARSINSOUTH, sizeof(__pyx_k_CDL3STARSINSOUTH), 0, 0, 1, 1}, - {&__pyx_n_s_CDL3WHITESOLDIERS, __pyx_k_CDL3WHITESOLDIERS, sizeof(__pyx_k_CDL3WHITESOLDIERS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLABANDONEDBABY, __pyx_k_CDLABANDONEDBABY, sizeof(__pyx_k_CDLABANDONEDBABY), 0, 0, 1, 1}, - {&__pyx_n_s_CDLADVANCEBLOCK, __pyx_k_CDLADVANCEBLOCK, sizeof(__pyx_k_CDLADVANCEBLOCK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLBELTHOLD, __pyx_k_CDLBELTHOLD, sizeof(__pyx_k_CDLBELTHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLBREAKAWAY, __pyx_k_CDLBREAKAWAY, sizeof(__pyx_k_CDLBREAKAWAY), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_k_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCONCEALBABYSWALL, __pyx_k_CDLCONCEALBABYSWALL, sizeof(__pyx_k_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, - {&__pyx_n_s_CDLCOUNTERATTACK, __pyx_k_CDLCOUNTERATTACK, sizeof(__pyx_k_CDLCOUNTERATTACK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDARKCLOUDCOVER, __pyx_k_CDLDARKCLOUDCOVER, sizeof(__pyx_k_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDOJI, __pyx_k_CDLDOJI, sizeof(__pyx_k_CDLDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDOJISTAR, __pyx_k_CDLDOJISTAR, sizeof(__pyx_k_CDLDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLDRAGONFLYDOJI, __pyx_k_CDLDRAGONFLYDOJI, sizeof(__pyx_k_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLENGULFING, __pyx_k_CDLENGULFING, sizeof(__pyx_k_CDLENGULFING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLEVENINGDOJISTAR, __pyx_k_CDLEVENINGDOJISTAR, sizeof(__pyx_k_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLEVENINGSTAR, __pyx_k_CDLEVENINGSTAR, sizeof(__pyx_k_CDLEVENINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_k_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLGRAVESTONEDOJI, __pyx_k_CDLGRAVESTONEDOJI, sizeof(__pyx_k_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHAMMER, __pyx_k_CDLHAMMER, sizeof(__pyx_k_CDLHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHANGINGMAN, __pyx_k_CDLHANGINGMAN, sizeof(__pyx_k_CDLHANGINGMAN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHARAMI, __pyx_k_CDLHARAMI, sizeof(__pyx_k_CDLHARAMI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHARAMICROSS, __pyx_k_CDLHARAMICROSS, sizeof(__pyx_k_CDLHARAMICROSS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIGHWAVE, __pyx_k_CDLHIGHWAVE, sizeof(__pyx_k_CDLHIGHWAVE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIKKAKE, __pyx_k_CDLHIKKAKE, sizeof(__pyx_k_CDLHIKKAKE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHIKKAKEMOD, __pyx_k_CDLHIKKAKEMOD, sizeof(__pyx_k_CDLHIKKAKEMOD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLHOMINGPIGEON, __pyx_k_CDLHOMINGPIGEON, sizeof(__pyx_k_CDLHOMINGPIGEON), 0, 0, 1, 1}, - {&__pyx_n_s_CDLIDENTICAL3CROWS, __pyx_k_CDLIDENTICAL3CROWS, sizeof(__pyx_k_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLINNECK, __pyx_k_CDLINNECK, sizeof(__pyx_k_CDLINNECK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLINVERTEDHAMMER, __pyx_k_CDLINVERTEDHAMMER, sizeof(__pyx_k_CDLINVERTEDHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLKICKING, __pyx_k_CDLKICKING, sizeof(__pyx_k_CDLKICKING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLKICKINGBYLENGTH, __pyx_k_CDLKICKINGBYLENGTH, sizeof(__pyx_k_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLADDERBOTTOM, __pyx_k_CDLLADDERBOTTOM, sizeof(__pyx_k_CDLLADDERBOTTOM), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_k_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLLONGLINE, __pyx_k_CDLLONGLINE, sizeof(__pyx_k_CDLLONGLINE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMARUBOZU, __pyx_k_CDLMARUBOZU, sizeof(__pyx_k_CDLMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMATCHINGLOW, __pyx_k_CDLMATCHINGLOW, sizeof(__pyx_k_CDLMATCHINGLOW), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMATHOLD, __pyx_k_CDLMATHOLD, sizeof(__pyx_k_CDLMATHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMORNINGDOJISTAR, __pyx_k_CDLMORNINGDOJISTAR, sizeof(__pyx_k_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLMORNINGSTAR, __pyx_k_CDLMORNINGSTAR, sizeof(__pyx_k_CDLMORNINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLONNECK, __pyx_k_CDLONNECK, sizeof(__pyx_k_CDLONNECK), 0, 0, 1, 1}, - {&__pyx_n_s_CDLPIERCING, __pyx_k_CDLPIERCING, sizeof(__pyx_k_CDLPIERCING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLRICKSHAWMAN, __pyx_k_CDLRICKSHAWMAN, sizeof(__pyx_k_CDLRICKSHAWMAN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLRISEFALL3METHODS, __pyx_k_CDLRISEFALL3METHODS, sizeof(__pyx_k_CDLRISEFALL3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSEPARATINGLINES, __pyx_k_CDLSEPARATINGLINES, sizeof(__pyx_k_CDLSEPARATINGLINES), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSHOOTINGSTAR, __pyx_k_CDLSHOOTINGSTAR, sizeof(__pyx_k_CDLSHOOTINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSHORTLINE, __pyx_k_CDLSHORTLINE, sizeof(__pyx_k_CDLSHORTLINE), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSPINNINGTOP, __pyx_k_CDLSPINNINGTOP, sizeof(__pyx_k_CDLSPINNINGTOP), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSTALLEDPATTERN, __pyx_k_CDLSTALLEDPATTERN, sizeof(__pyx_k_CDLSTALLEDPATTERN), 0, 0, 1, 1}, - {&__pyx_n_s_CDLSTICKSANDWICH, __pyx_k_CDLSTICKSANDWICH, sizeof(__pyx_k_CDLSTICKSANDWICH), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTAKURI, __pyx_k_CDLTAKURI, sizeof(__pyx_k_CDLTAKURI), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTASUKIGAP, __pyx_k_CDLTASUKIGAP, sizeof(__pyx_k_CDLTASUKIGAP), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTHRUSTING, __pyx_k_CDLTHRUSTING, sizeof(__pyx_k_CDLTHRUSTING), 0, 0, 1, 1}, - {&__pyx_n_s_CDLTRISTAR, __pyx_k_CDLTRISTAR, sizeof(__pyx_k_CDLTRISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_CDLUNIQUE3RIVER, __pyx_k_CDLUNIQUE3RIVER, sizeof(__pyx_k_CDLUNIQUE3RIVER), 0, 0, 1, 1}, - {&__pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_k_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_k_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_CEIL, __pyx_k_CEIL, sizeof(__pyx_k_CEIL), 0, 0, 1, 1}, - {&__pyx_n_s_CMO, __pyx_k_CMO, sizeof(__pyx_k_CMO), 0, 0, 1, 1}, - {&__pyx_n_s_CORREL, __pyx_k_CORREL, sizeof(__pyx_k_CORREL), 0, 0, 1, 1}, - {&__pyx_n_s_COS, __pyx_k_COS, sizeof(__pyx_k_COS), 0, 0, 1, 1}, - {&__pyx_n_s_COSH, __pyx_k_COSH, sizeof(__pyx_k_COSH), 0, 0, 1, 1}, - {&__pyx_n_s_DEMA, __pyx_k_DEMA, sizeof(__pyx_k_DEMA), 0, 0, 1, 1}, - {&__pyx_n_s_DIV, __pyx_k_DIV, sizeof(__pyx_k_DIV), 0, 0, 1, 1}, - {&__pyx_n_s_DX, __pyx_k_DX, sizeof(__pyx_k_DX), 0, 0, 1, 1}, - {&__pyx_n_s_EMA, __pyx_k_EMA, sizeof(__pyx_k_EMA), 0, 0, 1, 1}, - {&__pyx_n_s_EXP, __pyx_k_EXP, sizeof(__pyx_k_EXP), 0, 0, 1, 1}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_n_s_FLOOR, __pyx_k_FLOOR, sizeof(__pyx_k_FLOOR), 0, 0, 1, 1}, - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_n_s_HT_DCPERIOD, __pyx_k_HT_DCPERIOD, sizeof(__pyx_k_HT_DCPERIOD), 0, 0, 1, 1}, - {&__pyx_n_s_HT_DCPHASE, __pyx_k_HT_DCPHASE, sizeof(__pyx_k_HT_DCPHASE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_PHASOR, __pyx_k_HT_PHASOR, sizeof(__pyx_k_HT_PHASOR), 0, 0, 1, 1}, - {&__pyx_n_s_HT_SINE, __pyx_k_HT_SINE, sizeof(__pyx_k_HT_SINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDLINE, __pyx_k_HT_TRENDLINE, sizeof(__pyx_k_HT_TRENDLINE), 0, 0, 1, 1}, - {&__pyx_n_s_HT_TRENDMODE, __pyx_k_HT_TRENDMODE, sizeof(__pyx_k_HT_TRENDMODE), 0, 0, 1, 1}, - {&__pyx_n_s_KAMA, __pyx_k_KAMA, sizeof(__pyx_k_KAMA), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG, __pyx_k_LINEARREG, sizeof(__pyx_k_LINEARREG), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_ANGLE, __pyx_k_LINEARREG_ANGLE, sizeof(__pyx_k_LINEARREG_ANGLE), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_INTERCEPT, __pyx_k_LINEARREG_INTERCEPT, sizeof(__pyx_k_LINEARREG_INTERCEPT), 0, 0, 1, 1}, - {&__pyx_n_s_LINEARREG_SLOPE, __pyx_k_LINEARREG_SLOPE, sizeof(__pyx_k_LINEARREG_SLOPE), 0, 0, 1, 1}, - {&__pyx_n_s_LN, __pyx_k_LN, sizeof(__pyx_k_LN), 0, 0, 1, 1}, - {&__pyx_n_s_LOG10, __pyx_k_LOG10, sizeof(__pyx_k_LOG10), 0, 0, 1, 1}, - {&__pyx_n_s_MA, __pyx_k_MA, sizeof(__pyx_k_MA), 0, 0, 1, 1}, - {&__pyx_n_s_MACD, __pyx_k_MACD, sizeof(__pyx_k_MACD), 0, 0, 1, 1}, - {&__pyx_n_s_MACDEXT, __pyx_k_MACDEXT, sizeof(__pyx_k_MACDEXT), 0, 0, 1, 1}, - {&__pyx_n_s_MACDFIX, __pyx_k_MACDFIX, sizeof(__pyx_k_MACDFIX), 0, 0, 1, 1}, - {&__pyx_n_s_MAMA, __pyx_k_MAMA, sizeof(__pyx_k_MAMA), 0, 0, 1, 1}, - {&__pyx_n_s_MAVP, __pyx_k_MAVP, sizeof(__pyx_k_MAVP), 0, 0, 1, 1}, - {&__pyx_n_s_MAX, __pyx_k_MAX, sizeof(__pyx_k_MAX), 0, 0, 1, 1}, - {&__pyx_n_s_MAXINDEX, __pyx_k_MAXINDEX, sizeof(__pyx_k_MAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MEDPRICE, __pyx_k_MEDPRICE, sizeof(__pyx_k_MEDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_MFI, __pyx_k_MFI, sizeof(__pyx_k_MFI), 0, 0, 1, 1}, - {&__pyx_n_s_MIDPOINT, __pyx_k_MIDPOINT, sizeof(__pyx_k_MIDPOINT), 0, 0, 1, 1}, - {&__pyx_n_s_MIDPRICE, __pyx_k_MIDPRICE, sizeof(__pyx_k_MIDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_MIN, __pyx_k_MIN, sizeof(__pyx_k_MIN), 0, 0, 1, 1}, - {&__pyx_n_s_MININDEX, __pyx_k_MININDEX, sizeof(__pyx_k_MININDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MINMAX, __pyx_k_MINMAX, sizeof(__pyx_k_MINMAX), 0, 0, 1, 1}, - {&__pyx_n_s_MINMAXINDEX, __pyx_k_MINMAXINDEX, sizeof(__pyx_k_MINMAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DI, __pyx_k_MINUS_DI, sizeof(__pyx_k_MINUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_MINUS_DM, __pyx_k_MINUS_DM, sizeof(__pyx_k_MINUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_MOM, __pyx_k_MOM, sizeof(__pyx_k_MOM), 0, 0, 1, 1}, - {&__pyx_n_s_MULT, __pyx_k_MULT, sizeof(__pyx_k_MULT), 0, 0, 1, 1}, - {&__pyx_n_s_NATR, __pyx_k_NATR, sizeof(__pyx_k_NATR), 0, 0, 1, 1}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_OBV, __pyx_k_OBV, sizeof(__pyx_k_OBV), 0, 0, 1, 1}, - {&__pyx_n_s_PLUS_DI, __pyx_k_PLUS_DI, sizeof(__pyx_k_PLUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_PLUS_DM, __pyx_k_PLUS_DM, sizeof(__pyx_k_PLUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_PPO, __pyx_k_PPO, sizeof(__pyx_k_PPO), 0, 0, 1, 1}, - {&__pyx_n_s_ROC, __pyx_k_ROC, sizeof(__pyx_k_ROC), 0, 0, 1, 1}, - {&__pyx_n_s_ROCP, __pyx_k_ROCP, sizeof(__pyx_k_ROCP), 0, 0, 1, 1}, - {&__pyx_n_s_ROCR, __pyx_k_ROCR, sizeof(__pyx_k_ROCR), 0, 0, 1, 1}, - {&__pyx_n_s_ROCR100, __pyx_k_ROCR100, sizeof(__pyx_k_ROCR100), 0, 0, 1, 1}, - {&__pyx_n_s_RSI, __pyx_k_RSI, sizeof(__pyx_k_RSI), 0, 0, 1, 1}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_SAR, __pyx_k_SAR, sizeof(__pyx_k_SAR), 0, 0, 1, 1}, - {&__pyx_n_s_SAREXT, __pyx_k_SAREXT, sizeof(__pyx_k_SAREXT), 0, 0, 1, 1}, - {&__pyx_n_s_SIN, __pyx_k_SIN, sizeof(__pyx_k_SIN), 0, 0, 1, 1}, - {&__pyx_n_s_SINH, __pyx_k_SINH, sizeof(__pyx_k_SINH), 0, 0, 1, 1}, - {&__pyx_n_s_SMA, __pyx_k_SMA, sizeof(__pyx_k_SMA), 0, 0, 1, 1}, - {&__pyx_n_s_SQRT, __pyx_k_SQRT, sizeof(__pyx_k_SQRT), 0, 0, 1, 1}, - {&__pyx_n_s_STDDEV, __pyx_k_STDDEV, sizeof(__pyx_k_STDDEV), 0, 0, 1, 1}, - {&__pyx_n_s_STOCH, __pyx_k_STOCH, sizeof(__pyx_k_STOCH), 0, 0, 1, 1}, - {&__pyx_n_s_STOCHF, __pyx_k_STOCHF, sizeof(__pyx_k_STOCHF), 0, 0, 1, 1}, - {&__pyx_n_s_STOCHRSI, __pyx_k_STOCHRSI, sizeof(__pyx_k_STOCHRSI), 0, 0, 1, 1}, - {&__pyx_n_s_SUB, __pyx_k_SUB, sizeof(__pyx_k_SUB), 0, 0, 1, 1}, - {&__pyx_n_s_SUM, __pyx_k_SUM, sizeof(__pyx_k_SUM), 0, 0, 1, 1}, - {&__pyx_n_s_T3, __pyx_k_T3, sizeof(__pyx_k_T3), 0, 0, 1, 1}, - {&__pyx_n_s_TAN, __pyx_k_TAN, sizeof(__pyx_k_TAN), 0, 0, 1, 1}, - {&__pyx_n_s_TANH, __pyx_k_TANH, sizeof(__pyx_k_TANH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ACOS, __pyx_k_TA_ACOS, sizeof(__pyx_k_TA_ACOS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AD, __pyx_k_TA_AD, sizeof(__pyx_k_TA_AD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADD, __pyx_k_TA_ADD, sizeof(__pyx_k_TA_ADD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADOSC, __pyx_k_TA_ADOSC, sizeof(__pyx_k_TA_ADOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADX, __pyx_k_TA_ADX, sizeof(__pyx_k_TA_ADX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ADXR, __pyx_k_TA_ADXR, sizeof(__pyx_k_TA_ADXR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_APO, __pyx_k_TA_APO, sizeof(__pyx_k_TA_APO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AROON, __pyx_k_TA_AROON, sizeof(__pyx_k_TA_AROON), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AROONOSC, __pyx_k_TA_AROONOSC, sizeof(__pyx_k_TA_AROONOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ASIN, __pyx_k_TA_ASIN, sizeof(__pyx_k_TA_ASIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ATAN, __pyx_k_TA_ATAN, sizeof(__pyx_k_TA_ATAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ATR, __pyx_k_TA_ATR, sizeof(__pyx_k_TA_ATR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_AVGPRICE, __pyx_k_TA_AVGPRICE, sizeof(__pyx_k_TA_AVGPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BBANDS, __pyx_k_TA_BBANDS, sizeof(__pyx_k_TA_BBANDS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BETA, __pyx_k_TA_BETA, sizeof(__pyx_k_TA_BETA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_BOP, __pyx_k_TA_BOP, sizeof(__pyx_k_TA_BOP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CCI, __pyx_k_TA_CCI, sizeof(__pyx_k_TA_CCI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL2CROWS, __pyx_k_TA_CDL2CROWS, sizeof(__pyx_k_TA_CDL2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3BLACKCROWS, __pyx_k_TA_CDL3BLACKCROWS, sizeof(__pyx_k_TA_CDL3BLACKCROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3INSIDE, __pyx_k_TA_CDL3INSIDE, sizeof(__pyx_k_TA_CDL3INSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3LINESTRIKE, __pyx_k_TA_CDL3LINESTRIKE, sizeof(__pyx_k_TA_CDL3LINESTRIKE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3OUTSIDE, __pyx_k_TA_CDL3OUTSIDE, sizeof(__pyx_k_TA_CDL3OUTSIDE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3STARSINSOUTH, __pyx_k_TA_CDL3STARSINSOUTH, sizeof(__pyx_k_TA_CDL3STARSINSOUTH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDL3WHITESOLDIERS, __pyx_k_TA_CDL3WHITESOLDIERS, sizeof(__pyx_k_TA_CDL3WHITESOLDIERS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLABANDONEDBABY, __pyx_k_TA_CDLABANDONEDBABY, sizeof(__pyx_k_TA_CDLABANDONEDBABY), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLADVANCEBLOCK, __pyx_k_TA_CDLADVANCEBLOCK, sizeof(__pyx_k_TA_CDLADVANCEBLOCK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLBELTHOLD, __pyx_k_TA_CDLBELTHOLD, sizeof(__pyx_k_TA_CDLBELTHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLBREAKAWAY, __pyx_k_TA_CDLBREAKAWAY, sizeof(__pyx_k_TA_CDLBREAKAWAY), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCLOSINGMARUBOZU, __pyx_k_TA_CDLCLOSINGMARUBOZU, sizeof(__pyx_k_TA_CDLCLOSINGMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCONCEALBABYSWALL, __pyx_k_TA_CDLCONCEALBABYSWALL, sizeof(__pyx_k_TA_CDLCONCEALBABYSWALL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLCOUNTERATTACK, __pyx_k_TA_CDLCOUNTERATTACK, sizeof(__pyx_k_TA_CDLCOUNTERATTACK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDARKCLOUDCOVER, __pyx_k_TA_CDLDARKCLOUDCOVER, sizeof(__pyx_k_TA_CDLDARKCLOUDCOVER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDOJI, __pyx_k_TA_CDLDOJI, sizeof(__pyx_k_TA_CDLDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDOJISTAR, __pyx_k_TA_CDLDOJISTAR, sizeof(__pyx_k_TA_CDLDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLDRAGONFLYDOJI, __pyx_k_TA_CDLDRAGONFLYDOJI, sizeof(__pyx_k_TA_CDLDRAGONFLYDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLENGULFING, __pyx_k_TA_CDLENGULFING, sizeof(__pyx_k_TA_CDLENGULFING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLEVENINGDOJISTAR, __pyx_k_TA_CDLEVENINGDOJISTAR, sizeof(__pyx_k_TA_CDLEVENINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLEVENINGSTAR, __pyx_k_TA_CDLEVENINGSTAR, sizeof(__pyx_k_TA_CDLEVENINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLGAPSIDESIDEWHITE, __pyx_k_TA_CDLGAPSIDESIDEWHITE, sizeof(__pyx_k_TA_CDLGAPSIDESIDEWHITE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLGRAVESTONEDOJI, __pyx_k_TA_CDLGRAVESTONEDOJI, sizeof(__pyx_k_TA_CDLGRAVESTONEDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHAMMER, __pyx_k_TA_CDLHAMMER, sizeof(__pyx_k_TA_CDLHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHANGINGMAN, __pyx_k_TA_CDLHANGINGMAN, sizeof(__pyx_k_TA_CDLHANGINGMAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHARAMI, __pyx_k_TA_CDLHARAMI, sizeof(__pyx_k_TA_CDLHARAMI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHARAMICROSS, __pyx_k_TA_CDLHARAMICROSS, sizeof(__pyx_k_TA_CDLHARAMICROSS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIGHWAVE, __pyx_k_TA_CDLHIGHWAVE, sizeof(__pyx_k_TA_CDLHIGHWAVE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIKKAKE, __pyx_k_TA_CDLHIKKAKE, sizeof(__pyx_k_TA_CDLHIKKAKE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHIKKAKEMOD, __pyx_k_TA_CDLHIKKAKEMOD, sizeof(__pyx_k_TA_CDLHIKKAKEMOD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLHOMINGPIGEON, __pyx_k_TA_CDLHOMINGPIGEON, sizeof(__pyx_k_TA_CDLHOMINGPIGEON), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLIDENTICAL3CROWS, __pyx_k_TA_CDLIDENTICAL3CROWS, sizeof(__pyx_k_TA_CDLIDENTICAL3CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLINNECK, __pyx_k_TA_CDLINNECK, sizeof(__pyx_k_TA_CDLINNECK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLINVERTEDHAMMER, __pyx_k_TA_CDLINVERTEDHAMMER, sizeof(__pyx_k_TA_CDLINVERTEDHAMMER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLKICKING, __pyx_k_TA_CDLKICKING, sizeof(__pyx_k_TA_CDLKICKING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLKICKINGBYLENGTH, __pyx_k_TA_CDLKICKINGBYLENGTH, sizeof(__pyx_k_TA_CDLKICKINGBYLENGTH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLADDERBOTTOM, __pyx_k_TA_CDLLADDERBOTTOM, sizeof(__pyx_k_TA_CDLLADDERBOTTOM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLONGLEGGEDDOJI, __pyx_k_TA_CDLLONGLEGGEDDOJI, sizeof(__pyx_k_TA_CDLLONGLEGGEDDOJI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLLONGLINE, __pyx_k_TA_CDLLONGLINE, sizeof(__pyx_k_TA_CDLLONGLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMARUBOZU, __pyx_k_TA_CDLMARUBOZU, sizeof(__pyx_k_TA_CDLMARUBOZU), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMATCHINGLOW, __pyx_k_TA_CDLMATCHINGLOW, sizeof(__pyx_k_TA_CDLMATCHINGLOW), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMATHOLD, __pyx_k_TA_CDLMATHOLD, sizeof(__pyx_k_TA_CDLMATHOLD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMORNINGDOJISTAR, __pyx_k_TA_CDLMORNINGDOJISTAR, sizeof(__pyx_k_TA_CDLMORNINGDOJISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLMORNINGSTAR, __pyx_k_TA_CDLMORNINGSTAR, sizeof(__pyx_k_TA_CDLMORNINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLONNECK, __pyx_k_TA_CDLONNECK, sizeof(__pyx_k_TA_CDLONNECK), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLPIERCING, __pyx_k_TA_CDLPIERCING, sizeof(__pyx_k_TA_CDLPIERCING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLRICKSHAWMAN, __pyx_k_TA_CDLRICKSHAWMAN, sizeof(__pyx_k_TA_CDLRICKSHAWMAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLRISEFALL3METHODS, __pyx_k_TA_CDLRISEFALL3METHODS, sizeof(__pyx_k_TA_CDLRISEFALL3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSEPARATINGLINES, __pyx_k_TA_CDLSEPARATINGLINES, sizeof(__pyx_k_TA_CDLSEPARATINGLINES), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSHOOTINGSTAR, __pyx_k_TA_CDLSHOOTINGSTAR, sizeof(__pyx_k_TA_CDLSHOOTINGSTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSHORTLINE, __pyx_k_TA_CDLSHORTLINE, sizeof(__pyx_k_TA_CDLSHORTLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSPINNINGTOP, __pyx_k_TA_CDLSPINNINGTOP, sizeof(__pyx_k_TA_CDLSPINNINGTOP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSTALLEDPATTERN, __pyx_k_TA_CDLSTALLEDPATTERN, sizeof(__pyx_k_TA_CDLSTALLEDPATTERN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLSTICKSANDWICH, __pyx_k_TA_CDLSTICKSANDWICH, sizeof(__pyx_k_TA_CDLSTICKSANDWICH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTAKURI, __pyx_k_TA_CDLTAKURI, sizeof(__pyx_k_TA_CDLTAKURI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTASUKIGAP, __pyx_k_TA_CDLTASUKIGAP, sizeof(__pyx_k_TA_CDLTASUKIGAP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTHRUSTING, __pyx_k_TA_CDLTHRUSTING, sizeof(__pyx_k_TA_CDLTHRUSTING), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLTRISTAR, __pyx_k_TA_CDLTRISTAR, sizeof(__pyx_k_TA_CDLTRISTAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLUNIQUE3RIVER, __pyx_k_TA_CDLUNIQUE3RIVER, sizeof(__pyx_k_TA_CDLUNIQUE3RIVER), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLUPSIDEGAP2CROWS, __pyx_k_TA_CDLUPSIDEGAP2CROWS, sizeof(__pyx_k_TA_CDLUPSIDEGAP2CROWS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CDLXSIDEGAP3METHODS, __pyx_k_TA_CDLXSIDEGAP3METHODS, sizeof(__pyx_k_TA_CDLXSIDEGAP3METHODS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CEIL, __pyx_k_TA_CEIL, sizeof(__pyx_k_TA_CEIL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CMO, __pyx_k_TA_CMO, sizeof(__pyx_k_TA_CMO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_CORREL, __pyx_k_TA_CORREL, sizeof(__pyx_k_TA_CORREL), 0, 0, 1, 1}, - {&__pyx_n_s_TA_COS, __pyx_k_TA_COS, sizeof(__pyx_k_TA_COS), 0, 0, 1, 1}, - {&__pyx_n_s_TA_COSH, __pyx_k_TA_COSH, sizeof(__pyx_k_TA_COSH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DEMA, __pyx_k_TA_DEMA, sizeof(__pyx_k_TA_DEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DIV, __pyx_k_TA_DIV, sizeof(__pyx_k_TA_DIV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_DX, __pyx_k_TA_DX, sizeof(__pyx_k_TA_DX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_EMA, __pyx_k_TA_EMA, sizeof(__pyx_k_TA_EMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_EXP, __pyx_k_TA_EXP, sizeof(__pyx_k_TA_EXP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_FLOOR, __pyx_k_TA_FLOOR, sizeof(__pyx_k_TA_FLOOR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_DCPERIOD, __pyx_k_TA_HT_DCPERIOD, sizeof(__pyx_k_TA_HT_DCPERIOD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_DCPHASE, __pyx_k_TA_HT_DCPHASE, sizeof(__pyx_k_TA_HT_DCPHASE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_PHASOR, __pyx_k_TA_HT_PHASOR, sizeof(__pyx_k_TA_HT_PHASOR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_SINE, __pyx_k_TA_HT_SINE, sizeof(__pyx_k_TA_HT_SINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_TRENDLINE, __pyx_k_TA_HT_TRENDLINE, sizeof(__pyx_k_TA_HT_TRENDLINE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_HT_TRENDMODE, __pyx_k_TA_HT_TRENDMODE, sizeof(__pyx_k_TA_HT_TRENDMODE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_KAMA, __pyx_k_TA_KAMA, sizeof(__pyx_k_TA_KAMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG, __pyx_k_TA_LINEARREG, sizeof(__pyx_k_TA_LINEARREG), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_ANGLE, __pyx_k_TA_LINEARREG_ANGLE, sizeof(__pyx_k_TA_LINEARREG_ANGLE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_INTERCEPT, __pyx_k_TA_LINEARREG_INTERCEPT, sizeof(__pyx_k_TA_LINEARREG_INTERCEPT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LINEARREG_SLOPE, __pyx_k_TA_LINEARREG_SLOPE, sizeof(__pyx_k_TA_LINEARREG_SLOPE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LN, __pyx_k_TA_LN, sizeof(__pyx_k_TA_LN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_LOG10, __pyx_k_TA_LOG10, sizeof(__pyx_k_TA_LOG10), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MA, __pyx_k_TA_MA, sizeof(__pyx_k_TA_MA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACD, __pyx_k_TA_MACD, sizeof(__pyx_k_TA_MACD), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACDEXT, __pyx_k_TA_MACDEXT, sizeof(__pyx_k_TA_MACDEXT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MACDFIX, __pyx_k_TA_MACDFIX, sizeof(__pyx_k_TA_MACDFIX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAMA, __pyx_k_TA_MAMA, sizeof(__pyx_k_TA_MAMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAVP, __pyx_k_TA_MAVP, sizeof(__pyx_k_TA_MAVP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAX, __pyx_k_TA_MAX, sizeof(__pyx_k_TA_MAX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MAXINDEX, __pyx_k_TA_MAXINDEX, sizeof(__pyx_k_TA_MAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MEDPRICE, __pyx_k_TA_MEDPRICE, sizeof(__pyx_k_TA_MEDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MFI, __pyx_k_TA_MFI, sizeof(__pyx_k_TA_MFI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIDPOINT, __pyx_k_TA_MIDPOINT, sizeof(__pyx_k_TA_MIDPOINT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIDPRICE, __pyx_k_TA_MIDPRICE, sizeof(__pyx_k_TA_MIDPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MIN, __pyx_k_TA_MIN, sizeof(__pyx_k_TA_MIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MININDEX, __pyx_k_TA_MININDEX, sizeof(__pyx_k_TA_MININDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINMAX, __pyx_k_TA_MINMAX, sizeof(__pyx_k_TA_MINMAX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINMAXINDEX, __pyx_k_TA_MINMAXINDEX, sizeof(__pyx_k_TA_MINMAXINDEX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINUS_DI, __pyx_k_TA_MINUS_DI, sizeof(__pyx_k_TA_MINUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MINUS_DM, __pyx_k_TA_MINUS_DM, sizeof(__pyx_k_TA_MINUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MOM, __pyx_k_TA_MOM, sizeof(__pyx_k_TA_MOM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_MULT, __pyx_k_TA_MULT, sizeof(__pyx_k_TA_MULT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_NATR, __pyx_k_TA_NATR, sizeof(__pyx_k_TA_NATR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_OBV, __pyx_k_TA_OBV, sizeof(__pyx_k_TA_OBV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PLUS_DI, __pyx_k_TA_PLUS_DI, sizeof(__pyx_k_TA_PLUS_DI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PLUS_DM, __pyx_k_TA_PLUS_DM, sizeof(__pyx_k_TA_PLUS_DM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_PPO, __pyx_k_TA_PPO, sizeof(__pyx_k_TA_PPO), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROC, __pyx_k_TA_ROC, sizeof(__pyx_k_TA_ROC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCP, __pyx_k_TA_ROCP, sizeof(__pyx_k_TA_ROCP), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCR, __pyx_k_TA_ROCR, sizeof(__pyx_k_TA_ROCR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ROCR100, __pyx_k_TA_ROCR100, sizeof(__pyx_k_TA_ROCR100), 0, 0, 1, 1}, - {&__pyx_n_s_TA_RSI, __pyx_k_TA_RSI, sizeof(__pyx_k_TA_RSI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SAR, __pyx_k_TA_SAR, sizeof(__pyx_k_TA_SAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SAREXT, __pyx_k_TA_SAREXT, sizeof(__pyx_k_TA_SAREXT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SIN, __pyx_k_TA_SIN, sizeof(__pyx_k_TA_SIN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SINH, __pyx_k_TA_SINH, sizeof(__pyx_k_TA_SINH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SMA, __pyx_k_TA_SMA, sizeof(__pyx_k_TA_SMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SQRT, __pyx_k_TA_SQRT, sizeof(__pyx_k_TA_SQRT), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STDDEV, __pyx_k_TA_STDDEV, sizeof(__pyx_k_TA_STDDEV), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCH, __pyx_k_TA_STOCH, sizeof(__pyx_k_TA_STOCH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCHF, __pyx_k_TA_STOCHF, sizeof(__pyx_k_TA_STOCHF), 0, 0, 1, 1}, - {&__pyx_n_s_TA_STOCHRSI, __pyx_k_TA_STOCHRSI, sizeof(__pyx_k_TA_STOCHRSI), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SUB, __pyx_k_TA_SUB, sizeof(__pyx_k_TA_SUB), 0, 0, 1, 1}, - {&__pyx_n_s_TA_SUM, __pyx_k_TA_SUM, sizeof(__pyx_k_TA_SUM), 0, 0, 1, 1}, - {&__pyx_n_s_TA_T3, __pyx_k_TA_T3, sizeof(__pyx_k_TA_T3), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TAN, __pyx_k_TA_TAN, sizeof(__pyx_k_TA_TAN), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TANH, __pyx_k_TA_TANH, sizeof(__pyx_k_TA_TANH), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TEMA, __pyx_k_TA_TEMA, sizeof(__pyx_k_TA_TEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRANGE, __pyx_k_TA_TRANGE, sizeof(__pyx_k_TA_TRANGE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRIMA, __pyx_k_TA_TRIMA, sizeof(__pyx_k_TA_TRIMA), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TRIX, __pyx_k_TA_TRIX, sizeof(__pyx_k_TA_TRIX), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TSF, __pyx_k_TA_TSF, sizeof(__pyx_k_TA_TSF), 0, 0, 1, 1}, - {&__pyx_n_s_TA_TYPPRICE, __pyx_k_TA_TYPPRICE, sizeof(__pyx_k_TA_TYPPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_ULTOSC, __pyx_k_TA_ULTOSC, sizeof(__pyx_k_TA_ULTOSC), 0, 0, 1, 1}, - {&__pyx_n_s_TA_VAR, __pyx_k_TA_VAR, sizeof(__pyx_k_TA_VAR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WCLPRICE, __pyx_k_TA_WCLPRICE, sizeof(__pyx_k_TA_WCLPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WILLR, __pyx_k_TA_WILLR, sizeof(__pyx_k_TA_WILLR), 0, 0, 1, 1}, - {&__pyx_n_s_TA_WMA, __pyx_k_TA_WMA, sizeof(__pyx_k_TA_WMA), 0, 0, 1, 1}, - {&__pyx_n_s_TEMA, __pyx_k_TEMA, sizeof(__pyx_k_TEMA), 0, 0, 1, 1}, - {&__pyx_n_s_TRANGE, __pyx_k_TRANGE, sizeof(__pyx_k_TRANGE), 0, 0, 1, 1}, - {&__pyx_n_s_TRIMA, __pyx_k_TRIMA, sizeof(__pyx_k_TRIMA), 0, 0, 1, 1}, - {&__pyx_n_s_TRIX, __pyx_k_TRIX, sizeof(__pyx_k_TRIX), 0, 0, 1, 1}, - {&__pyx_n_s_TSF, __pyx_k_TSF, sizeof(__pyx_k_TSF), 0, 0, 1, 1}, - {&__pyx_n_s_TYPPRICE, __pyx_k_TYPPRICE, sizeof(__pyx_k_TYPPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_ULTOSC, __pyx_k_ULTOSC, sizeof(__pyx_k_ULTOSC), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_k_Users_jbenedik_Dev_ta_lib_talib, sizeof(__pyx_k_Users_jbenedik_Dev_ta_lib_talib), 0, 0, 1, 0}, - {&__pyx_n_s_VAR, __pyx_k_VAR, sizeof(__pyx_k_VAR), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_WCLPRICE, __pyx_k_WCLPRICE, sizeof(__pyx_k_WCLPRICE), 0, 0, 1, 1}, - {&__pyx_n_s_WILLR, __pyx_k_WILLR, sizeof(__pyx_k_WILLR), 0, 0, 1, 1}, - {&__pyx_n_s_WMA, __pyx_k_WMA, sizeof(__pyx_k_WMA), 0, 0, 1, 1}, - {&__pyx_n_s_acceleration, __pyx_k_acceleration, sizeof(__pyx_k_acceleration), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationinitlong, __pyx_k_accelerationinitlong, sizeof(__pyx_k_accelerationinitlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationinitshort, __pyx_k_accelerationinitshort, sizeof(__pyx_k_accelerationinitshort), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationlong, __pyx_k_accelerationlong, sizeof(__pyx_k_accelerationlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationmaxlong, __pyx_k_accelerationmaxlong, sizeof(__pyx_k_accelerationmaxlong), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationmaxshort, __pyx_k_accelerationmaxshort, sizeof(__pyx_k_accelerationmaxshort), 0, 0, 1, 1}, - {&__pyx_n_s_accelerationshort, __pyx_k_accelerationshort, sizeof(__pyx_k_accelerationshort), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_begidx, __pyx_k_begidx, sizeof(__pyx_k_begidx), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_close_data, __pyx_k_close_data, sizeof(__pyx_k_close_data), 0, 0, 1, 1}, - {&__pyx_kp_s_close_has_wrong_dimensions, __pyx_k_close_has_wrong_dimensions, sizeof(__pyx_k_close_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_close_is_not_double, __pyx_k_close_is_not_double, sizeof(__pyx_k_close_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_endidx, __pyx_k_endidx, sizeof(__pyx_k_endidx), 0, 0, 1, 1}, - {&__pyx_n_s_fastd_matype, __pyx_k_fastd_matype, sizeof(__pyx_k_fastd_matype), 0, 0, 1, 1}, - {&__pyx_n_s_fastd_period, __pyx_k_fastd_period, sizeof(__pyx_k_fastd_period), 0, 0, 1, 1}, - {&__pyx_n_s_fastk_period, __pyx_k_fastk_period, sizeof(__pyx_k_fastk_period), 0, 0, 1, 1}, - {&__pyx_n_s_fastlimit, __pyx_k_fastlimit, sizeof(__pyx_k_fastlimit), 0, 0, 1, 1}, - {&__pyx_n_s_fastmatype, __pyx_k_fastmatype, sizeof(__pyx_k_fastmatype), 0, 0, 1, 1}, - {&__pyx_n_s_fastperiod, __pyx_k_fastperiod, sizeof(__pyx_k_fastperiod), 0, 0, 1, 1}, - {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1}, - {&__pyx_n_s_high_data, __pyx_k_high_data, sizeof(__pyx_k_high_data), 0, 0, 1, 1}, - {&__pyx_kp_s_high_has_wrong_dimensions, __pyx_k_high_has_wrong_dimensions, sizeof(__pyx_k_high_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_high_is_not_double, __pyx_k_high_is_not_double, sizeof(__pyx_k_high_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_kp_s_input_lengths_are_different, __pyx_k_input_lengths_are_different, sizeof(__pyx_k_input_lengths_are_different), 0, 0, 1, 0}, - {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, - {&__pyx_n_s_lookback, __pyx_k_lookback, sizeof(__pyx_k_lookback), 0, 0, 1, 1}, - {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1}, - {&__pyx_n_s_low_data, __pyx_k_low_data, sizeof(__pyx_k_low_data), 0, 0, 1, 1}, - {&__pyx_kp_s_low_has_wrong_dimensions, __pyx_k_low_has_wrong_dimensions, sizeof(__pyx_k_low_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_low_is_not_double, __pyx_k_low_is_not_double, sizeof(__pyx_k_low_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_matype, __pyx_k_matype, sizeof(__pyx_k_matype), 0, 0, 1, 1}, - {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, - {&__pyx_n_s_maxperiod, __pyx_k_maxperiod, sizeof(__pyx_k_maxperiod), 0, 0, 1, 1}, - {&__pyx_n_s_minperiod, __pyx_k_minperiod, sizeof(__pyx_k_minperiod), 0, 0, 1, 1}, - {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, - {&__pyx_n_s_nbdev, __pyx_k_nbdev, sizeof(__pyx_k_nbdev), 0, 0, 1, 1}, - {&__pyx_n_s_nbdevdn, __pyx_k_nbdevdn, sizeof(__pyx_k_nbdevdn), 0, 0, 1, 1}, - {&__pyx_n_s_nbdevup, __pyx_k_nbdevup, sizeof(__pyx_k_nbdevup), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_offsetonreverse, __pyx_k_offsetonreverse, sizeof(__pyx_k_offsetonreverse), 0, 0, 1, 1}, - {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, - {&__pyx_n_s_open_data, __pyx_k_open_data, sizeof(__pyx_k_open_data), 0, 0, 1, 1}, - {&__pyx_kp_s_open_has_wrong_dimensions, __pyx_k_open_has_wrong_dimensions, sizeof(__pyx_k_open_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_open_is_not_double, __pyx_k_open_is_not_double, sizeof(__pyx_k_open_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_outaroondown, __pyx_k_outaroondown, sizeof(__pyx_k_outaroondown), 0, 0, 1, 1}, - {&__pyx_n_s_outaroonup, __pyx_k_outaroonup, sizeof(__pyx_k_outaroonup), 0, 0, 1, 1}, - {&__pyx_n_s_outbegidx, __pyx_k_outbegidx, sizeof(__pyx_k_outbegidx), 0, 0, 1, 1}, - {&__pyx_n_s_outfama, __pyx_k_outfama, sizeof(__pyx_k_outfama), 0, 0, 1, 1}, - {&__pyx_n_s_outfastd, __pyx_k_outfastd, sizeof(__pyx_k_outfastd), 0, 0, 1, 1}, - {&__pyx_n_s_outfastk, __pyx_k_outfastk, sizeof(__pyx_k_outfastk), 0, 0, 1, 1}, - {&__pyx_n_s_outinphase, __pyx_k_outinphase, sizeof(__pyx_k_outinphase), 0, 0, 1, 1}, - {&__pyx_n_s_outinteger, __pyx_k_outinteger, sizeof(__pyx_k_outinteger), 0, 0, 1, 1}, - {&__pyx_n_s_outleadsine, __pyx_k_outleadsine, sizeof(__pyx_k_outleadsine), 0, 0, 1, 1}, - {&__pyx_n_s_outmacd, __pyx_k_outmacd, sizeof(__pyx_k_outmacd), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdhist, __pyx_k_outmacdhist, sizeof(__pyx_k_outmacdhist), 0, 0, 1, 1}, - {&__pyx_n_s_outmacdsignal, __pyx_k_outmacdsignal, sizeof(__pyx_k_outmacdsignal), 0, 0, 1, 1}, - {&__pyx_n_s_outmama, __pyx_k_outmama, sizeof(__pyx_k_outmama), 0, 0, 1, 1}, - {&__pyx_n_s_outmax, __pyx_k_outmax, sizeof(__pyx_k_outmax), 0, 0, 1, 1}, - {&__pyx_n_s_outmaxidx, __pyx_k_outmaxidx, sizeof(__pyx_k_outmaxidx), 0, 0, 1, 1}, - {&__pyx_n_s_outmin, __pyx_k_outmin, sizeof(__pyx_k_outmin), 0, 0, 1, 1}, - {&__pyx_n_s_outminidx, __pyx_k_outminidx, sizeof(__pyx_k_outminidx), 0, 0, 1, 1}, - {&__pyx_n_s_outnbelement, __pyx_k_outnbelement, sizeof(__pyx_k_outnbelement), 0, 0, 1, 1}, - {&__pyx_n_s_outquadrature, __pyx_k_outquadrature, sizeof(__pyx_k_outquadrature), 0, 0, 1, 1}, - {&__pyx_n_s_outreal, __pyx_k_outreal, sizeof(__pyx_k_outreal), 0, 0, 1, 1}, - {&__pyx_n_s_outreallowerband, __pyx_k_outreallowerband, sizeof(__pyx_k_outreallowerband), 0, 0, 1, 1}, - {&__pyx_n_s_outrealmiddleband, __pyx_k_outrealmiddleband, sizeof(__pyx_k_outrealmiddleband), 0, 0, 1, 1}, - {&__pyx_n_s_outrealupperband, __pyx_k_outrealupperband, sizeof(__pyx_k_outrealupperband), 0, 0, 1, 1}, - {&__pyx_n_s_outsine, __pyx_k_outsine, sizeof(__pyx_k_outsine), 0, 0, 1, 1}, - {&__pyx_n_s_outslowd, __pyx_k_outslowd, sizeof(__pyx_k_outslowd), 0, 0, 1, 1}, - {&__pyx_n_s_outslowk, __pyx_k_outslowk, sizeof(__pyx_k_outslowk), 0, 0, 1, 1}, - {&__pyx_n_s_penetration, __pyx_k_penetration, sizeof(__pyx_k_penetration), 0, 0, 1, 1}, - {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, - {&__pyx_n_s_periods_data, __pyx_k_periods_data, sizeof(__pyx_k_periods_data), 0, 0, 1, 1}, - {&__pyx_kp_s_periods_has_wrong_dimensions, __pyx_k_periods_has_wrong_dimensions, sizeof(__pyx_k_periods_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_periods_is_not_double, __pyx_k_periods_is_not_double, sizeof(__pyx_k_periods_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, - {&__pyx_n_s_real0, __pyx_k_real0, sizeof(__pyx_k_real0), 0, 0, 1, 1}, - {&__pyx_n_s_real0_data, __pyx_k_real0_data, sizeof(__pyx_k_real0_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real0_has_wrong_dimensions, __pyx_k_real0_has_wrong_dimensions, sizeof(__pyx_k_real0_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real0_is_not_double, __pyx_k_real0_is_not_double, sizeof(__pyx_k_real0_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_real1, __pyx_k_real1, sizeof(__pyx_k_real1), 0, 0, 1, 1}, - {&__pyx_n_s_real1_data, __pyx_k_real1_data, sizeof(__pyx_k_real1_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real1_has_wrong_dimensions, __pyx_k_real1_has_wrong_dimensions, sizeof(__pyx_k_real1_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real1_is_not_double, __pyx_k_real1_is_not_double, sizeof(__pyx_k_real1_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_real_data, __pyx_k_real_data, sizeof(__pyx_k_real_data), 0, 0, 1, 1}, - {&__pyx_kp_s_real_has_wrong_dimensions, __pyx_k_real_has_wrong_dimensions, sizeof(__pyx_k_real_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_real_is_not_double, __pyx_k_real_is_not_double, sizeof(__pyx_k_real_is_not_double), 0, 0, 1, 0}, - {&__pyx_n_s_retCode, __pyx_k_retCode, sizeof(__pyx_k_retCode), 0, 0, 1, 1}, - {&__pyx_n_s_signalmatype, __pyx_k_signalmatype, sizeof(__pyx_k_signalmatype), 0, 0, 1, 1}, - {&__pyx_n_s_signalperiod, __pyx_k_signalperiod, sizeof(__pyx_k_signalperiod), 0, 0, 1, 1}, - {&__pyx_n_s_slowd_matype, __pyx_k_slowd_matype, sizeof(__pyx_k_slowd_matype), 0, 0, 1, 1}, - {&__pyx_n_s_slowd_period, __pyx_k_slowd_period, sizeof(__pyx_k_slowd_period), 0, 0, 1, 1}, - {&__pyx_n_s_slowk_matype, __pyx_k_slowk_matype, sizeof(__pyx_k_slowk_matype), 0, 0, 1, 1}, - {&__pyx_n_s_slowk_period, __pyx_k_slowk_period, sizeof(__pyx_k_slowk_period), 0, 0, 1, 1}, - {&__pyx_n_s_slowlimit, __pyx_k_slowlimit, sizeof(__pyx_k_slowlimit), 0, 0, 1, 1}, - {&__pyx_n_s_slowmatype, __pyx_k_slowmatype, sizeof(__pyx_k_slowmatype), 0, 0, 1, 1}, - {&__pyx_n_s_slowperiod, __pyx_k_slowperiod, sizeof(__pyx_k_slowperiod), 0, 0, 1, 1}, - {&__pyx_n_s_startvalue, __pyx_k_startvalue, sizeof(__pyx_k_startvalue), 0, 0, 1, 1}, - {&__pyx_n_s_talib_stream, __pyx_k_talib_stream, sizeof(__pyx_k_talib_stream), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod, __pyx_k_timeperiod, sizeof(__pyx_k_timeperiod), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod1, __pyx_k_timeperiod1, sizeof(__pyx_k_timeperiod1), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod2, __pyx_k_timeperiod2, sizeof(__pyx_k_timeperiod2), 0, 0, 1, 1}, - {&__pyx_n_s_timeperiod3, __pyx_k_timeperiod3, sizeof(__pyx_k_timeperiod3), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, - {&__pyx_n_s_vfactor, __pyx_k_vfactor, sizeof(__pyx_k_vfactor), 0, 0, 1, 1}, - {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, - {&__pyx_n_s_volume_data, __pyx_k_volume_data, sizeof(__pyx_k_volume_data), 0, 0, 1, 1}, - {&__pyx_kp_s_volume_has_wrong_dimensions, __pyx_k_volume_has_wrong_dimensions, sizeof(__pyx_k_volume_has_wrong_dimensions), 0, 0, 1, 0}, - {&__pyx_kp_s_volume_is_not_double, __pyx_k_volume_is_not_double, sizeof(__pyx_k_volume_is_not_double), 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 44, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "talib/stream.pyx":44 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "talib/stream.pyx":46 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "talib/stream.pyx":81 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "talib/stream.pyx":83 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "talib/stream.pyx":88 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "talib/stream.pyx":90 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - - /* "talib/stream.pyx":95 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "talib/stream.pyx":97 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - - /* "talib/stream.pyx":102 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "talib/stream.pyx":104 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "talib/stream.pyx":110 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "talib/stream.pyx":112 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "talib/stream.pyx":114 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AD( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - - /* "talib/stream.pyx":144 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "talib/stream.pyx":146 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "talib/stream.pyx":151 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "talib/stream.pyx":153 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "talib/stream.pyx":159 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADD( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "talib/stream.pyx":193 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "talib/stream.pyx":195 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - - /* "talib/stream.pyx":200 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - - /* "talib/stream.pyx":202 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - - /* "talib/stream.pyx":207 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "talib/stream.pyx":209 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - - /* "talib/stream.pyx":214 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - - /* "talib/stream.pyx":216 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "talib/stream.pyx":222 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "talib/stream.pyx":224 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "talib/stream.pyx":226 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADOSC( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , fastperiod , slowperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - - /* "talib/stream.pyx":258 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - - /* "talib/stream.pyx":260 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - - /* "talib/stream.pyx":265 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - - /* "talib/stream.pyx":267 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - - /* "talib/stream.pyx":272 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - - /* "talib/stream.pyx":274 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - - /* "talib/stream.pyx":280 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - - /* "talib/stream.pyx":282 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - - /* "talib/stream.pyx":314 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - - /* "talib/stream.pyx":316 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - - /* "talib/stream.pyx":321 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - - /* "talib/stream.pyx":323 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "talib/stream.pyx":328 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - - /* "talib/stream.pyx":330 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - - /* "talib/stream.pyx":336 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - - /* "talib/stream.pyx":338 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ADXR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - - /* "talib/stream.pyx":370 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - - /* "talib/stream.pyx":372 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - - /* "talib/stream.pyx":409 - * double outaroonup - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - - /* "talib/stream.pyx":411 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - - /* "talib/stream.pyx":416 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - - /* "talib/stream.pyx":418 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - - /* "talib/stream.pyx":424 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outaroondown = NaN - * outaroonup = NaN - */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - - /* "talib/stream.pyx":456 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - - /* "talib/stream.pyx":458 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - - /* "talib/stream.pyx":463 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - - /* "talib/stream.pyx":465 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - - /* "talib/stream.pyx":471 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AROONOSC( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - - /* "talib/stream.pyx":499 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - - /* "talib/stream.pyx":501 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - - /* "talib/stream.pyx":533 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - - /* "talib/stream.pyx":535 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - - /* "talib/stream.pyx":571 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - - /* "talib/stream.pyx":573 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - - /* "talib/stream.pyx":578 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - - /* "talib/stream.pyx":580 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - - /* "talib/stream.pyx":585 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - - /* "talib/stream.pyx":587 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - - /* "talib/stream.pyx":593 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - - /* "talib/stream.pyx":595 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - - /* "talib/stream.pyx":626 - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - - /* "talib/stream.pyx":628 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - - /* "talib/stream.pyx":633 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - - /* "talib/stream.pyx":635 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - - /* "talib/stream.pyx":640 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - - /* "talib/stream.pyx":642 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - - /* "talib/stream.pyx":647 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - - /* "talib/stream.pyx":649 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - - /* "talib/stream.pyx":655 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - - /* "talib/stream.pyx":657 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - - /* "talib/stream.pyx":659 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_AVGPRICE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - - /* "talib/stream.pyx":696 - * double outreallowerband - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - - /* "talib/stream.pyx":698 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); - - /* "talib/stream.pyx":736 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - - /* "talib/stream.pyx":738 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); - - /* "talib/stream.pyx":743 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - - /* "talib/stream.pyx":745 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); - - /* "talib/stream.pyx":751 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_BETA( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - - /* "talib/stream.pyx":782 - * double outreal - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - - /* "talib/stream.pyx":784 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__89); - __Pyx_GIVEREF(__pyx_tuple__89); - - /* "talib/stream.pyx":789 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); - - /* "talib/stream.pyx":791 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); - - /* "talib/stream.pyx":796 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - - /* "talib/stream.pyx":798 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); - - /* "talib/stream.pyx":803 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - - /* "talib/stream.pyx":805 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__95); - __Pyx_GIVEREF(__pyx_tuple__95); - - /* "talib/stream.pyx":811 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - - /* "talib/stream.pyx":813 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__97); - __Pyx_GIVEREF(__pyx_tuple__97); - - /* "talib/stream.pyx":815 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_BOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - - /* "talib/stream.pyx":847 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__99); - __Pyx_GIVEREF(__pyx_tuple__99); - - /* "talib/stream.pyx":849 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - - /* "talib/stream.pyx":854 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__101); - __Pyx_GIVEREF(__pyx_tuple__101); - - /* "talib/stream.pyx":856 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - - /* "talib/stream.pyx":861 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__103); - __Pyx_GIVEREF(__pyx_tuple__103); - - /* "talib/stream.pyx":863 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - - /* "talib/stream.pyx":869 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__105); - __Pyx_GIVEREF(__pyx_tuple__105); - - /* "talib/stream.pyx":871 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CCI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - - /* "talib/stream.pyx":902 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 902, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__107); - __Pyx_GIVEREF(__pyx_tuple__107); - - /* "talib/stream.pyx":904 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - - /* "talib/stream.pyx":909 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__109); - __Pyx_GIVEREF(__pyx_tuple__109); - - /* "talib/stream.pyx":911 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - - /* "talib/stream.pyx":916 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__111); - __Pyx_GIVEREF(__pyx_tuple__111); - - /* "talib/stream.pyx":918 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - - /* "talib/stream.pyx":923 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__113); - __Pyx_GIVEREF(__pyx_tuple__113); - - /* "talib/stream.pyx":925 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - - /* "talib/stream.pyx":931 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__115); - __Pyx_GIVEREF(__pyx_tuple__115); - - /* "talib/stream.pyx":933 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - - /* "talib/stream.pyx":935 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__117); - __Pyx_GIVEREF(__pyx_tuple__117); - - /* "talib/stream.pyx":966 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - - /* "talib/stream.pyx":968 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__119); - __Pyx_GIVEREF(__pyx_tuple__119); - - /* "talib/stream.pyx":973 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - - /* "talib/stream.pyx":975 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__121); - __Pyx_GIVEREF(__pyx_tuple__121); - - /* "talib/stream.pyx":980 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - - /* "talib/stream.pyx":982 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__123); - __Pyx_GIVEREF(__pyx_tuple__123); - - /* "talib/stream.pyx":987 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - - /* "talib/stream.pyx":989 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - - /* "talib/stream.pyx":995 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__126); - __Pyx_GIVEREF(__pyx_tuple__126); - - /* "talib/stream.pyx":997 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__127); - __Pyx_GIVEREF(__pyx_tuple__127); - - /* "talib/stream.pyx":999 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3BLACKCROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__128); - __Pyx_GIVEREF(__pyx_tuple__128); - - /* "talib/stream.pyx":1030 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - - /* "talib/stream.pyx":1032 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__130); - __Pyx_GIVEREF(__pyx_tuple__130); - - /* "talib/stream.pyx":1037 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__131); - __Pyx_GIVEREF(__pyx_tuple__131); - - /* "talib/stream.pyx":1039 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__132); - __Pyx_GIVEREF(__pyx_tuple__132); - - /* "talib/stream.pyx":1044 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__133); - __Pyx_GIVEREF(__pyx_tuple__133); - - /* "talib/stream.pyx":1046 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__134); - __Pyx_GIVEREF(__pyx_tuple__134); - - /* "talib/stream.pyx":1051 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__135); - __Pyx_GIVEREF(__pyx_tuple__135); - - /* "talib/stream.pyx":1053 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__136); - __Pyx_GIVEREF(__pyx_tuple__136); - - /* "talib/stream.pyx":1059 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__137); - __Pyx_GIVEREF(__pyx_tuple__137); - - /* "talib/stream.pyx":1061 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__138); - __Pyx_GIVEREF(__pyx_tuple__138); - - /* "talib/stream.pyx":1063 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3INSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__139); - __Pyx_GIVEREF(__pyx_tuple__139); - - /* "talib/stream.pyx":1094 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 1094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__140); - __Pyx_GIVEREF(__pyx_tuple__140); - - /* "talib/stream.pyx":1096 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__141); - __Pyx_GIVEREF(__pyx_tuple__141); - - /* "talib/stream.pyx":1101 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__142); - __Pyx_GIVEREF(__pyx_tuple__142); - - /* "talib/stream.pyx":1103 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__143); - __Pyx_GIVEREF(__pyx_tuple__143); - - /* "talib/stream.pyx":1108 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__144); - __Pyx_GIVEREF(__pyx_tuple__144); - - /* "talib/stream.pyx":1110 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 1110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__145); - __Pyx_GIVEREF(__pyx_tuple__145); - - /* "talib/stream.pyx":1115 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__146); - __Pyx_GIVEREF(__pyx_tuple__146); - - /* "talib/stream.pyx":1117 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__147); - __Pyx_GIVEREF(__pyx_tuple__147); - - /* "talib/stream.pyx":1123 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__148); - __Pyx_GIVEREF(__pyx_tuple__148); - - /* "talib/stream.pyx":1125 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__149 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__149); - __Pyx_GIVEREF(__pyx_tuple__149); - - /* "talib/stream.pyx":1127 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3LINESTRIKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__150); - __Pyx_GIVEREF(__pyx_tuple__150); - - /* "talib/stream.pyx":1158 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__151); - __Pyx_GIVEREF(__pyx_tuple__151); - - /* "talib/stream.pyx":1160 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 1160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__152); - __Pyx_GIVEREF(__pyx_tuple__152); - - /* "talib/stream.pyx":1165 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__153); - __Pyx_GIVEREF(__pyx_tuple__153); - - /* "talib/stream.pyx":1167 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__154); - __Pyx_GIVEREF(__pyx_tuple__154); - - /* "talib/stream.pyx":1172 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 1172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__155); - __Pyx_GIVEREF(__pyx_tuple__155); - - /* "talib/stream.pyx":1174 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__156); - __Pyx_GIVEREF(__pyx_tuple__156); - - /* "talib/stream.pyx":1179 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 1179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__157); - __Pyx_GIVEREF(__pyx_tuple__157); - - /* "talib/stream.pyx":1181 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 1181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__158); - __Pyx_GIVEREF(__pyx_tuple__158); - - /* "talib/stream.pyx":1187 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__159); - __Pyx_GIVEREF(__pyx_tuple__159); - - /* "talib/stream.pyx":1189 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__160 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 1189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__160); - __Pyx_GIVEREF(__pyx_tuple__160); - - /* "talib/stream.pyx":1191 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3OUTSIDE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__161); - __Pyx_GIVEREF(__pyx_tuple__161); - - /* "talib/stream.pyx":1222 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__162); - __Pyx_GIVEREF(__pyx_tuple__162); - - /* "talib/stream.pyx":1224 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__163); - __Pyx_GIVEREF(__pyx_tuple__163); - - /* "talib/stream.pyx":1229 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 1229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__164); - __Pyx_GIVEREF(__pyx_tuple__164); - - /* "talib/stream.pyx":1231 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__165); - __Pyx_GIVEREF(__pyx_tuple__165); - - /* "talib/stream.pyx":1236 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__166); - __Pyx_GIVEREF(__pyx_tuple__166); - - /* "talib/stream.pyx":1238 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__167); - __Pyx_GIVEREF(__pyx_tuple__167); - - /* "talib/stream.pyx":1243 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__168); - __Pyx_GIVEREF(__pyx_tuple__168); - - /* "talib/stream.pyx":1245 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__169 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__169); - __Pyx_GIVEREF(__pyx_tuple__169); - - /* "talib/stream.pyx":1251 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 1251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__170); - __Pyx_GIVEREF(__pyx_tuple__170); - - /* "talib/stream.pyx":1253 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__171); - __Pyx_GIVEREF(__pyx_tuple__171); - - /* "talib/stream.pyx":1255 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3STARSINSOUTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 1255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__172); - __Pyx_GIVEREF(__pyx_tuple__172); - - /* "talib/stream.pyx":1286 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__173); - __Pyx_GIVEREF(__pyx_tuple__173); - - /* "talib/stream.pyx":1288 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__174); - __Pyx_GIVEREF(__pyx_tuple__174); - - /* "talib/stream.pyx":1293 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__175); - __Pyx_GIVEREF(__pyx_tuple__175); - - /* "talib/stream.pyx":1295 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__176); - __Pyx_GIVEREF(__pyx_tuple__176); - - /* "talib/stream.pyx":1300 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__177); - __Pyx_GIVEREF(__pyx_tuple__177); - - /* "talib/stream.pyx":1302 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__178); - __Pyx_GIVEREF(__pyx_tuple__178); - - /* "talib/stream.pyx":1307 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__179); - __Pyx_GIVEREF(__pyx_tuple__179); - - /* "talib/stream.pyx":1309 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 1309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__180); - __Pyx_GIVEREF(__pyx_tuple__180); - - /* "talib/stream.pyx":1315 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__181 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__181); - __Pyx_GIVEREF(__pyx_tuple__181); - - /* "talib/stream.pyx":1317 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__182); - __Pyx_GIVEREF(__pyx_tuple__182); - - /* "talib/stream.pyx":1319 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDL3WHITESOLDIERS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__183); - __Pyx_GIVEREF(__pyx_tuple__183); - - /* "talib/stream.pyx":1352 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 1352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__184); - __Pyx_GIVEREF(__pyx_tuple__184); - - /* "talib/stream.pyx":1354 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 1354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__185); - __Pyx_GIVEREF(__pyx_tuple__185); - - /* "talib/stream.pyx":1359 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__186); - __Pyx_GIVEREF(__pyx_tuple__186); - - /* "talib/stream.pyx":1361 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__187); - __Pyx_GIVEREF(__pyx_tuple__187); - - /* "talib/stream.pyx":1366 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 1366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__188); - __Pyx_GIVEREF(__pyx_tuple__188); - - /* "talib/stream.pyx":1368 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__189); - __Pyx_GIVEREF(__pyx_tuple__189); - - /* "talib/stream.pyx":1373 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__190 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__190); - __Pyx_GIVEREF(__pyx_tuple__190); - - /* "talib/stream.pyx":1375 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 1375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__191); - __Pyx_GIVEREF(__pyx_tuple__191); - - /* "talib/stream.pyx":1381 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__192); - __Pyx_GIVEREF(__pyx_tuple__192); - - /* "talib/stream.pyx":1383 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__193); - __Pyx_GIVEREF(__pyx_tuple__193); - - /* "talib/stream.pyx":1385 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLABANDONEDBABY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__194); - __Pyx_GIVEREF(__pyx_tuple__194); - - /* "talib/stream.pyx":1416 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 1416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__195); - __Pyx_GIVEREF(__pyx_tuple__195); - - /* "talib/stream.pyx":1418 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__196); - __Pyx_GIVEREF(__pyx_tuple__196); - - /* "talib/stream.pyx":1423 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__197); - __Pyx_GIVEREF(__pyx_tuple__197); - - /* "talib/stream.pyx":1425 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 1425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__198); - __Pyx_GIVEREF(__pyx_tuple__198); - - /* "talib/stream.pyx":1430 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__199); - __Pyx_GIVEREF(__pyx_tuple__199); - - /* "talib/stream.pyx":1432 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 1432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__200); - __Pyx_GIVEREF(__pyx_tuple__200); - - /* "talib/stream.pyx":1437 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__201); - __Pyx_GIVEREF(__pyx_tuple__201); - - /* "talib/stream.pyx":1439 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__202); - __Pyx_GIVEREF(__pyx_tuple__202); - - /* "talib/stream.pyx":1445 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 1445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__203); - __Pyx_GIVEREF(__pyx_tuple__203); - - /* "talib/stream.pyx":1447 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__204); - __Pyx_GIVEREF(__pyx_tuple__204); - - /* "talib/stream.pyx":1449 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLADVANCEBLOCK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__205); - __Pyx_GIVEREF(__pyx_tuple__205); - - /* "talib/stream.pyx":1480 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 1480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__206); - __Pyx_GIVEREF(__pyx_tuple__206); - - /* "talib/stream.pyx":1482 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__207); - __Pyx_GIVEREF(__pyx_tuple__207); - - /* "talib/stream.pyx":1487 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 1487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__208); - __Pyx_GIVEREF(__pyx_tuple__208); - - /* "talib/stream.pyx":1489 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__209); - __Pyx_GIVEREF(__pyx_tuple__209); - - /* "talib/stream.pyx":1494 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 1494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__210); - __Pyx_GIVEREF(__pyx_tuple__210); - - /* "talib/stream.pyx":1496 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__211); - __Pyx_GIVEREF(__pyx_tuple__211); - - /* "talib/stream.pyx":1501 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__212); - __Pyx_GIVEREF(__pyx_tuple__212); - - /* "talib/stream.pyx":1503 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__213); - __Pyx_GIVEREF(__pyx_tuple__213); - - /* "talib/stream.pyx":1509 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__214); - __Pyx_GIVEREF(__pyx_tuple__214); - - /* "talib/stream.pyx":1511 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 1511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__215); - __Pyx_GIVEREF(__pyx_tuple__215); - - /* "talib/stream.pyx":1513 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLBELTHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__216); - __Pyx_GIVEREF(__pyx_tuple__216); - - /* "talib/stream.pyx":1544 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__217); - __Pyx_GIVEREF(__pyx_tuple__217); - - /* "talib/stream.pyx":1546 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__218); - __Pyx_GIVEREF(__pyx_tuple__218); - - /* "talib/stream.pyx":1551 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__219); - __Pyx_GIVEREF(__pyx_tuple__219); - - /* "talib/stream.pyx":1553 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__220); - __Pyx_GIVEREF(__pyx_tuple__220); - - /* "talib/stream.pyx":1558 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__221); - __Pyx_GIVEREF(__pyx_tuple__221); - - /* "talib/stream.pyx":1560 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__222); - __Pyx_GIVEREF(__pyx_tuple__222); - - /* "talib/stream.pyx":1565 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 1565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__223); - __Pyx_GIVEREF(__pyx_tuple__223); - - /* "talib/stream.pyx":1567 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__224); - __Pyx_GIVEREF(__pyx_tuple__224); - - /* "talib/stream.pyx":1573 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 1573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__225); - __Pyx_GIVEREF(__pyx_tuple__225); - - /* "talib/stream.pyx":1575 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__226); - __Pyx_GIVEREF(__pyx_tuple__226); - - /* "talib/stream.pyx":1577 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLBREAKAWAY( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 1577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__227); - __Pyx_GIVEREF(__pyx_tuple__227); - - /* "talib/stream.pyx":1608 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__228); - __Pyx_GIVEREF(__pyx_tuple__228); - - /* "talib/stream.pyx":1610 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__229 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__229); - __Pyx_GIVEREF(__pyx_tuple__229); - - /* "talib/stream.pyx":1615 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__230 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__230); - __Pyx_GIVEREF(__pyx_tuple__230); - - /* "talib/stream.pyx":1617 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__231 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__231); - __Pyx_GIVEREF(__pyx_tuple__231); - - /* "talib/stream.pyx":1622 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__232); - __Pyx_GIVEREF(__pyx_tuple__232); - - /* "talib/stream.pyx":1624 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__233); - __Pyx_GIVEREF(__pyx_tuple__233); - - /* "talib/stream.pyx":1629 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__234 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__234); - __Pyx_GIVEREF(__pyx_tuple__234); - - /* "talib/stream.pyx":1631 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__235 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 1631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__235); - __Pyx_GIVEREF(__pyx_tuple__235); - - /* "talib/stream.pyx":1637 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__236 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__236); - __Pyx_GIVEREF(__pyx_tuple__236); - - /* "talib/stream.pyx":1639 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__237 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 1639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__237); - __Pyx_GIVEREF(__pyx_tuple__237); - - /* "talib/stream.pyx":1641 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCLOSINGMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__238 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__238); - __Pyx_GIVEREF(__pyx_tuple__238); - - /* "talib/stream.pyx":1672 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__239 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__239); - __Pyx_GIVEREF(__pyx_tuple__239); - - /* "talib/stream.pyx":1674 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__240 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 1674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__240); - __Pyx_GIVEREF(__pyx_tuple__240); - - /* "talib/stream.pyx":1679 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__241 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 1679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__241); - __Pyx_GIVEREF(__pyx_tuple__241); - - /* "talib/stream.pyx":1681 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__242 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 1681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__242); - __Pyx_GIVEREF(__pyx_tuple__242); - - /* "talib/stream.pyx":1686 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__243 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 1686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__243); - __Pyx_GIVEREF(__pyx_tuple__243); - - /* "talib/stream.pyx":1688 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__244 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 1688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__244); - __Pyx_GIVEREF(__pyx_tuple__244); - - /* "talib/stream.pyx":1693 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__245 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__245); - __Pyx_GIVEREF(__pyx_tuple__245); - - /* "talib/stream.pyx":1695 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__246 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__246); - __Pyx_GIVEREF(__pyx_tuple__246); - - /* "talib/stream.pyx":1701 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__247 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 1701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__247); - __Pyx_GIVEREF(__pyx_tuple__247); - - /* "talib/stream.pyx":1703 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__248 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 1703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__248); - __Pyx_GIVEREF(__pyx_tuple__248); - - /* "talib/stream.pyx":1705 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCONCEALBABYSWALL( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__249 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__249); - __Pyx_GIVEREF(__pyx_tuple__249); - - /* "talib/stream.pyx":1736 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__250 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 1736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__250); - __Pyx_GIVEREF(__pyx_tuple__250); - - /* "talib/stream.pyx":1738 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__251 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 1738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__251); - __Pyx_GIVEREF(__pyx_tuple__251); - - /* "talib/stream.pyx":1743 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__252 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 1743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__252); - __Pyx_GIVEREF(__pyx_tuple__252); - - /* "talib/stream.pyx":1745 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__253 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 1745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__253); - __Pyx_GIVEREF(__pyx_tuple__253); - - /* "talib/stream.pyx":1750 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 1750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__254); - __Pyx_GIVEREF(__pyx_tuple__254); - - /* "talib/stream.pyx":1752 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 1752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__255); - __Pyx_GIVEREF(__pyx_tuple__255); - - /* "talib/stream.pyx":1757 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__256); - __Pyx_GIVEREF(__pyx_tuple__256); - - /* "talib/stream.pyx":1759 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 1759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__257); - __Pyx_GIVEREF(__pyx_tuple__257); - - /* "talib/stream.pyx":1765 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__258); - __Pyx_GIVEREF(__pyx_tuple__258); - - /* "talib/stream.pyx":1767 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 1767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__259); - __Pyx_GIVEREF(__pyx_tuple__259); - - /* "talib/stream.pyx":1769 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLCOUNTERATTACK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__260); - __Pyx_GIVEREF(__pyx_tuple__260); - - /* "talib/stream.pyx":1802 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 1802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__261); - __Pyx_GIVEREF(__pyx_tuple__261); - - /* "talib/stream.pyx":1804 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__262); - __Pyx_GIVEREF(__pyx_tuple__262); - - /* "talib/stream.pyx":1809 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 1809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__263); - __Pyx_GIVEREF(__pyx_tuple__263); - - /* "talib/stream.pyx":1811 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__264); - __Pyx_GIVEREF(__pyx_tuple__264); - - /* "talib/stream.pyx":1816 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__265 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 1816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__265); - __Pyx_GIVEREF(__pyx_tuple__265); - - /* "talib/stream.pyx":1818 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__266 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__266); - __Pyx_GIVEREF(__pyx_tuple__266); - - /* "talib/stream.pyx":1823 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__267 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 1823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__267); - __Pyx_GIVEREF(__pyx_tuple__267); - - /* "talib/stream.pyx":1825 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__268 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__268); - __Pyx_GIVEREF(__pyx_tuple__268); - - /* "talib/stream.pyx":1831 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__269 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 1831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__269); - __Pyx_GIVEREF(__pyx_tuple__269); - - /* "talib/stream.pyx":1833 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__270 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__270); - __Pyx_GIVEREF(__pyx_tuple__270); - - /* "talib/stream.pyx":1835 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDARKCLOUDCOVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__271 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__271); - __Pyx_GIVEREF(__pyx_tuple__271); - - /* "talib/stream.pyx":1866 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__272 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__272); - __Pyx_GIVEREF(__pyx_tuple__272); - - /* "talib/stream.pyx":1868 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__273 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 1868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__273); - __Pyx_GIVEREF(__pyx_tuple__273); - - /* "talib/stream.pyx":1873 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__274 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__274); - __Pyx_GIVEREF(__pyx_tuple__274); - - /* "talib/stream.pyx":1875 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__275 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 1875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__275); - __Pyx_GIVEREF(__pyx_tuple__275); - - /* "talib/stream.pyx":1880 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__276 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 1880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__276); - __Pyx_GIVEREF(__pyx_tuple__276); - - /* "talib/stream.pyx":1882 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__277 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 1882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__277); - __Pyx_GIVEREF(__pyx_tuple__277); - - /* "talib/stream.pyx":1887 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__278 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 1887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__278); - __Pyx_GIVEREF(__pyx_tuple__278); - - /* "talib/stream.pyx":1889 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__279 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 1889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__279); - __Pyx_GIVEREF(__pyx_tuple__279); - - /* "talib/stream.pyx":1895 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__280 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__280); - __Pyx_GIVEREF(__pyx_tuple__280); - - /* "talib/stream.pyx":1897 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__281 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 1897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__281); - __Pyx_GIVEREF(__pyx_tuple__281); - - /* "talib/stream.pyx":1899 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__282 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__282); - __Pyx_GIVEREF(__pyx_tuple__282); - - /* "talib/stream.pyx":1930 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__283 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 1930, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__283); - __Pyx_GIVEREF(__pyx_tuple__283); - - /* "talib/stream.pyx":1932 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__284 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__284); - __Pyx_GIVEREF(__pyx_tuple__284); - - /* "talib/stream.pyx":1937 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__285 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 1937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__285); - __Pyx_GIVEREF(__pyx_tuple__285); - - /* "talib/stream.pyx":1939 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__286 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__286); - __Pyx_GIVEREF(__pyx_tuple__286); - - /* "talib/stream.pyx":1944 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__287 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 1944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__287); - __Pyx_GIVEREF(__pyx_tuple__287); - - /* "talib/stream.pyx":1946 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__288 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 1946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__288); - __Pyx_GIVEREF(__pyx_tuple__288); - - /* "talib/stream.pyx":1951 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__289 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 1951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__289); - __Pyx_GIVEREF(__pyx_tuple__289); - - /* "talib/stream.pyx":1953 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__290 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__290); - __Pyx_GIVEREF(__pyx_tuple__290); - - /* "talib/stream.pyx":1959 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__291 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 1959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__291); - __Pyx_GIVEREF(__pyx_tuple__291); - - /* "talib/stream.pyx":1961 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__292 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__292); - __Pyx_GIVEREF(__pyx_tuple__292); - - /* "talib/stream.pyx":1963 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__293 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 1963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__293); - __Pyx_GIVEREF(__pyx_tuple__293); - - /* "talib/stream.pyx":1994 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__294 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 1994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__294); - __Pyx_GIVEREF(__pyx_tuple__294); - - /* "talib/stream.pyx":1996 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__295 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 1996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__295); - __Pyx_GIVEREF(__pyx_tuple__295); - - /* "talib/stream.pyx":2001 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__296 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__296); - __Pyx_GIVEREF(__pyx_tuple__296); - - /* "talib/stream.pyx":2003 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__297 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 2003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__297); - __Pyx_GIVEREF(__pyx_tuple__297); - - /* "talib/stream.pyx":2008 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__298 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__298); - __Pyx_GIVEREF(__pyx_tuple__298); - - /* "talib/stream.pyx":2010 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__299 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 2010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__299); - __Pyx_GIVEREF(__pyx_tuple__299); - - /* "talib/stream.pyx":2015 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__300 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 2015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__300); - __Pyx_GIVEREF(__pyx_tuple__300); - - /* "talib/stream.pyx":2017 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__301 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 2017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__301); - __Pyx_GIVEREF(__pyx_tuple__301); - - /* "talib/stream.pyx":2023 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__302 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__302); - __Pyx_GIVEREF(__pyx_tuple__302); - - /* "talib/stream.pyx":2025 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__303 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 2025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__303); - __Pyx_GIVEREF(__pyx_tuple__303); - - /* "talib/stream.pyx":2027 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLDRAGONFLYDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__304 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__304); - __Pyx_GIVEREF(__pyx_tuple__304); - - /* "talib/stream.pyx":2058 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__305 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__305); - __Pyx_GIVEREF(__pyx_tuple__305); - - /* "talib/stream.pyx":2060 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__306 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 2060, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__306); - __Pyx_GIVEREF(__pyx_tuple__306); - - /* "talib/stream.pyx":2065 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__307 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__307); - __Pyx_GIVEREF(__pyx_tuple__307); - - /* "talib/stream.pyx":2067 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__308 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__308); - __Pyx_GIVEREF(__pyx_tuple__308); - - /* "talib/stream.pyx":2072 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__309 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__309); - __Pyx_GIVEREF(__pyx_tuple__309); - - /* "talib/stream.pyx":2074 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__310 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 2074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__310); - __Pyx_GIVEREF(__pyx_tuple__310); - - /* "talib/stream.pyx":2079 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__311 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 2079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__311); - __Pyx_GIVEREF(__pyx_tuple__311); - - /* "talib/stream.pyx":2081 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__312 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__312); - __Pyx_GIVEREF(__pyx_tuple__312); - - /* "talib/stream.pyx":2087 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__313 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 2087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__313); - __Pyx_GIVEREF(__pyx_tuple__313); - - /* "talib/stream.pyx":2089 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__314 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__314); - __Pyx_GIVEREF(__pyx_tuple__314); - - /* "talib/stream.pyx":2091 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLENGULFING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__315 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 2091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__315); - __Pyx_GIVEREF(__pyx_tuple__315); - - /* "talib/stream.pyx":2124 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__316 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__316); - __Pyx_GIVEREF(__pyx_tuple__316); - - /* "talib/stream.pyx":2126 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__317 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 2126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__317); - __Pyx_GIVEREF(__pyx_tuple__317); - - /* "talib/stream.pyx":2131 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__318 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__318); - __Pyx_GIVEREF(__pyx_tuple__318); - - /* "talib/stream.pyx":2133 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__319 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 2133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__319); - __Pyx_GIVEREF(__pyx_tuple__319); - - /* "talib/stream.pyx":2138 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__320 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 2138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__320); - __Pyx_GIVEREF(__pyx_tuple__320); - - /* "talib/stream.pyx":2140 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__321 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 2140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__321); - __Pyx_GIVEREF(__pyx_tuple__321); - - /* "talib/stream.pyx":2145 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__322 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 2145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__322); - __Pyx_GIVEREF(__pyx_tuple__322); - - /* "talib/stream.pyx":2147 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__323 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__323); - __Pyx_GIVEREF(__pyx_tuple__323); - - /* "talib/stream.pyx":2153 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__324 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 2153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__324); - __Pyx_GIVEREF(__pyx_tuple__324); - - /* "talib/stream.pyx":2155 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__325 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 2155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__325); - __Pyx_GIVEREF(__pyx_tuple__325); - - /* "talib/stream.pyx":2157 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__326 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__326); - __Pyx_GIVEREF(__pyx_tuple__326); - - /* "talib/stream.pyx":2190 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__327 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 2190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__327); - __Pyx_GIVEREF(__pyx_tuple__327); - - /* "talib/stream.pyx":2192 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__328 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__328); - __Pyx_GIVEREF(__pyx_tuple__328); - - /* "talib/stream.pyx":2197 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__329 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 2197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__329); - __Pyx_GIVEREF(__pyx_tuple__329); - - /* "talib/stream.pyx":2199 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__330 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__330); - __Pyx_GIVEREF(__pyx_tuple__330); - - /* "talib/stream.pyx":2204 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__331 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 2204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__331); - __Pyx_GIVEREF(__pyx_tuple__331); - - /* "talib/stream.pyx":2206 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__332 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__332); - __Pyx_GIVEREF(__pyx_tuple__332); - - /* "talib/stream.pyx":2211 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__333 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 2211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__333); - __Pyx_GIVEREF(__pyx_tuple__333); - - /* "talib/stream.pyx":2213 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__334 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__334); - __Pyx_GIVEREF(__pyx_tuple__334); - - /* "talib/stream.pyx":2219 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__335 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__335); - __Pyx_GIVEREF(__pyx_tuple__335); - - /* "talib/stream.pyx":2221 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__336 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 2221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__336); - __Pyx_GIVEREF(__pyx_tuple__336); - - /* "talib/stream.pyx":2223 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLEVENINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__337 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 2223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__337); - __Pyx_GIVEREF(__pyx_tuple__337); - - /* "talib/stream.pyx":2254 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__338 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__338); - __Pyx_GIVEREF(__pyx_tuple__338); - - /* "talib/stream.pyx":2256 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__339 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 2256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__339); - __Pyx_GIVEREF(__pyx_tuple__339); - - /* "talib/stream.pyx":2261 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__340 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 2261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__340); - __Pyx_GIVEREF(__pyx_tuple__340); - - /* "talib/stream.pyx":2263 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__341 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 2263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__341); - __Pyx_GIVEREF(__pyx_tuple__341); - - /* "talib/stream.pyx":2268 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__342 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__342); - __Pyx_GIVEREF(__pyx_tuple__342); - - /* "talib/stream.pyx":2270 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__343 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 2270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__343); - __Pyx_GIVEREF(__pyx_tuple__343); - - /* "talib/stream.pyx":2275 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__344 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__344); - __Pyx_GIVEREF(__pyx_tuple__344); - - /* "talib/stream.pyx":2277 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__345 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 2277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__345); - __Pyx_GIVEREF(__pyx_tuple__345); - - /* "talib/stream.pyx":2283 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__346 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 2283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__346); - __Pyx_GIVEREF(__pyx_tuple__346); - - /* "talib/stream.pyx":2285 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__347 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 2285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__347); - __Pyx_GIVEREF(__pyx_tuple__347); - - /* "talib/stream.pyx":2287 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLGAPSIDESIDEWHITE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__348 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(0, 2287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__348); - __Pyx_GIVEREF(__pyx_tuple__348); - - /* "talib/stream.pyx":2318 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__349 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__349); - __Pyx_GIVEREF(__pyx_tuple__349); - - /* "talib/stream.pyx":2320 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__350 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__350); - __Pyx_GIVEREF(__pyx_tuple__350); - - /* "talib/stream.pyx":2325 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__351 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 2325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__351); - __Pyx_GIVEREF(__pyx_tuple__351); - - /* "talib/stream.pyx":2327 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__352 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 2327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__352); - __Pyx_GIVEREF(__pyx_tuple__352); - - /* "talib/stream.pyx":2332 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__353 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 2332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__353); - __Pyx_GIVEREF(__pyx_tuple__353); - - /* "talib/stream.pyx":2334 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__354 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 2334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__354); - __Pyx_GIVEREF(__pyx_tuple__354); - - /* "talib/stream.pyx":2339 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__355 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 2339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__355); - __Pyx_GIVEREF(__pyx_tuple__355); - - /* "talib/stream.pyx":2341 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__356 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 2341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__356); - __Pyx_GIVEREF(__pyx_tuple__356); - - /* "talib/stream.pyx":2347 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__357 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 2347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__357); - __Pyx_GIVEREF(__pyx_tuple__357); - - /* "talib/stream.pyx":2349 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__358 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 2349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__358); - __Pyx_GIVEREF(__pyx_tuple__358); - - /* "talib/stream.pyx":2351 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLGRAVESTONEDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__359 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__359); - __Pyx_GIVEREF(__pyx_tuple__359); - - /* "talib/stream.pyx":2382 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__360 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__360); - __Pyx_GIVEREF(__pyx_tuple__360); - - /* "talib/stream.pyx":2384 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__361 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 2384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__361); - __Pyx_GIVEREF(__pyx_tuple__361); - - /* "talib/stream.pyx":2389 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__362 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 2389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__362); - __Pyx_GIVEREF(__pyx_tuple__362); - - /* "talib/stream.pyx":2391 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__363 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 2391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__363); - __Pyx_GIVEREF(__pyx_tuple__363); - - /* "talib/stream.pyx":2396 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__364 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(0, 2396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__364); - __Pyx_GIVEREF(__pyx_tuple__364); - - /* "talib/stream.pyx":2398 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__365 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 2398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__365); - __Pyx_GIVEREF(__pyx_tuple__365); - - /* "talib/stream.pyx":2403 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__366 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(0, 2403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__366); - __Pyx_GIVEREF(__pyx_tuple__366); - - /* "talib/stream.pyx":2405 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__367 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 2405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__367); - __Pyx_GIVEREF(__pyx_tuple__367); - - /* "talib/stream.pyx":2411 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__368 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(0, 2411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__368); - __Pyx_GIVEREF(__pyx_tuple__368); - - /* "talib/stream.pyx":2413 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__369 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__369); - __Pyx_GIVEREF(__pyx_tuple__369); - - /* "talib/stream.pyx":2415 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__370 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 2415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__370); - __Pyx_GIVEREF(__pyx_tuple__370); - - /* "talib/stream.pyx":2446 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__371 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 2446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__371); - __Pyx_GIVEREF(__pyx_tuple__371); - - /* "talib/stream.pyx":2448 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__372 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(0, 2448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__372); - __Pyx_GIVEREF(__pyx_tuple__372); - - /* "talib/stream.pyx":2453 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__373 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 2453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__373); - __Pyx_GIVEREF(__pyx_tuple__373); - - /* "talib/stream.pyx":2455 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__374 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__374); - __Pyx_GIVEREF(__pyx_tuple__374); - - /* "talib/stream.pyx":2460 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__375 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 2460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__375); - __Pyx_GIVEREF(__pyx_tuple__375); - - /* "talib/stream.pyx":2462 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__376 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 2462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__376); - __Pyx_GIVEREF(__pyx_tuple__376); - - /* "talib/stream.pyx":2467 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__377 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 2467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__377); - __Pyx_GIVEREF(__pyx_tuple__377); - - /* "talib/stream.pyx":2469 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__378 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 2469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__378); - __Pyx_GIVEREF(__pyx_tuple__378); - - /* "talib/stream.pyx":2475 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__379 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 2475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__379); - __Pyx_GIVEREF(__pyx_tuple__379); - - /* "talib/stream.pyx":2477 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__380 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 2477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__380); - __Pyx_GIVEREF(__pyx_tuple__380); - - /* "talib/stream.pyx":2479 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHANGINGMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__381 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__381); - __Pyx_GIVEREF(__pyx_tuple__381); - - /* "talib/stream.pyx":2510 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__382 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(0, 2510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__382); - __Pyx_GIVEREF(__pyx_tuple__382); - - /* "talib/stream.pyx":2512 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__383 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 2512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__383); - __Pyx_GIVEREF(__pyx_tuple__383); - - /* "talib/stream.pyx":2517 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__384 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(0, 2517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__384); - __Pyx_GIVEREF(__pyx_tuple__384); - - /* "talib/stream.pyx":2519 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__385 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 2519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__385); - __Pyx_GIVEREF(__pyx_tuple__385); - - /* "talib/stream.pyx":2524 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__386 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(0, 2524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__386); - __Pyx_GIVEREF(__pyx_tuple__386); - - /* "talib/stream.pyx":2526 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__387 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 2526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__387); - __Pyx_GIVEREF(__pyx_tuple__387); - - /* "talib/stream.pyx":2531 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__388 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(0, 2531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__388); - __Pyx_GIVEREF(__pyx_tuple__388); - - /* "talib/stream.pyx":2533 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__389 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 2533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__389); - __Pyx_GIVEREF(__pyx_tuple__389); - - /* "talib/stream.pyx":2539 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__390 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(0, 2539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__390); - __Pyx_GIVEREF(__pyx_tuple__390); - - /* "talib/stream.pyx":2541 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__391 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 2541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__391); - __Pyx_GIVEREF(__pyx_tuple__391); - - /* "talib/stream.pyx":2543 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHARAMI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__392 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(0, 2543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__392); - __Pyx_GIVEREF(__pyx_tuple__392); - - /* "talib/stream.pyx":2574 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__393 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__393); - __Pyx_GIVEREF(__pyx_tuple__393); - - /* "talib/stream.pyx":2576 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__394 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(0, 2576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__394); - __Pyx_GIVEREF(__pyx_tuple__394); - - /* "talib/stream.pyx":2581 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__395 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 2581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__395); - __Pyx_GIVEREF(__pyx_tuple__395); - - /* "talib/stream.pyx":2583 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__396 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__396); - __Pyx_GIVEREF(__pyx_tuple__396); - - /* "talib/stream.pyx":2588 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__397 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(0, 2588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__397); - __Pyx_GIVEREF(__pyx_tuple__397); - - /* "talib/stream.pyx":2590 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__398 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(0, 2590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__398); - __Pyx_GIVEREF(__pyx_tuple__398); - - /* "talib/stream.pyx":2595 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__399 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(0, 2595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__399); - __Pyx_GIVEREF(__pyx_tuple__399); - - /* "talib/stream.pyx":2597 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__400 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(0, 2597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__400); - __Pyx_GIVEREF(__pyx_tuple__400); - - /* "talib/stream.pyx":2603 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__401 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(0, 2603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__401); - __Pyx_GIVEREF(__pyx_tuple__401); - - /* "talib/stream.pyx":2605 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__402 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(0, 2605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__402); - __Pyx_GIVEREF(__pyx_tuple__402); - - /* "talib/stream.pyx":2607 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHARAMICROSS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__403 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(0, 2607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__403); - __Pyx_GIVEREF(__pyx_tuple__403); - - /* "talib/stream.pyx":2638 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__404 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(0, 2638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__404); - __Pyx_GIVEREF(__pyx_tuple__404); - - /* "talib/stream.pyx":2640 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__405 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(0, 2640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__405); - __Pyx_GIVEREF(__pyx_tuple__405); - - /* "talib/stream.pyx":2645 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__406 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(0, 2645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__406); - __Pyx_GIVEREF(__pyx_tuple__406); - - /* "talib/stream.pyx":2647 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__407 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(0, 2647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__407); - __Pyx_GIVEREF(__pyx_tuple__407); - - /* "talib/stream.pyx":2652 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__408 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(0, 2652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__408); - __Pyx_GIVEREF(__pyx_tuple__408); - - /* "talib/stream.pyx":2654 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__409 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(0, 2654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__409); - __Pyx_GIVEREF(__pyx_tuple__409); - - /* "talib/stream.pyx":2659 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__410 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(0, 2659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__410); - __Pyx_GIVEREF(__pyx_tuple__410); - - /* "talib/stream.pyx":2661 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__411 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(0, 2661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__411); - __Pyx_GIVEREF(__pyx_tuple__411); - - /* "talib/stream.pyx":2667 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__412 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(0, 2667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__412); - __Pyx_GIVEREF(__pyx_tuple__412); - - /* "talib/stream.pyx":2669 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__413 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(0, 2669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__413); - __Pyx_GIVEREF(__pyx_tuple__413); - - /* "talib/stream.pyx":2671 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIGHWAVE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__414 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(0, 2671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__414); - __Pyx_GIVEREF(__pyx_tuple__414); - - /* "talib/stream.pyx":2702 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__415 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__415); - __Pyx_GIVEREF(__pyx_tuple__415); - - /* "talib/stream.pyx":2704 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__416 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(0, 2704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__416); - __Pyx_GIVEREF(__pyx_tuple__416); - - /* "talib/stream.pyx":2709 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__417 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(0, 2709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__417); - __Pyx_GIVEREF(__pyx_tuple__417); - - /* "talib/stream.pyx":2711 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__418 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(0, 2711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__418); - __Pyx_GIVEREF(__pyx_tuple__418); - - /* "talib/stream.pyx":2716 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__419 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(0, 2716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__419); - __Pyx_GIVEREF(__pyx_tuple__419); - - /* "talib/stream.pyx":2718 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__420 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(0, 2718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__420); - __Pyx_GIVEREF(__pyx_tuple__420); - - /* "talib/stream.pyx":2723 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__421 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__421); - __Pyx_GIVEREF(__pyx_tuple__421); - - /* "talib/stream.pyx":2725 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__422 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(0, 2725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__422); - __Pyx_GIVEREF(__pyx_tuple__422); - - /* "talib/stream.pyx":2731 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__423 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(0, 2731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__423); - __Pyx_GIVEREF(__pyx_tuple__423); - - /* "talib/stream.pyx":2733 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__424 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(0, 2733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__424); - __Pyx_GIVEREF(__pyx_tuple__424); - - /* "talib/stream.pyx":2735 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__425 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__425); - __Pyx_GIVEREF(__pyx_tuple__425); - - /* "talib/stream.pyx":2766 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__426 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(0, 2766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__426); - __Pyx_GIVEREF(__pyx_tuple__426); - - /* "talib/stream.pyx":2768 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__427 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(0, 2768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__427); - __Pyx_GIVEREF(__pyx_tuple__427); - - /* "talib/stream.pyx":2773 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__428 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__428); - __Pyx_GIVEREF(__pyx_tuple__428); - - /* "talib/stream.pyx":2775 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__429 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(0, 2775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__429); - __Pyx_GIVEREF(__pyx_tuple__429); - - /* "talib/stream.pyx":2780 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__430 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__430); - __Pyx_GIVEREF(__pyx_tuple__430); - - /* "talib/stream.pyx":2782 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__431 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(0, 2782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__431); - __Pyx_GIVEREF(__pyx_tuple__431); - - /* "talib/stream.pyx":2787 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__432 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(0, 2787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__432); - __Pyx_GIVEREF(__pyx_tuple__432); - - /* "talib/stream.pyx":2789 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__433 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(0, 2789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__433); - __Pyx_GIVEREF(__pyx_tuple__433); - - /* "talib/stream.pyx":2795 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__434 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(0, 2795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__434); - __Pyx_GIVEREF(__pyx_tuple__434); - - /* "talib/stream.pyx":2797 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__435 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(0, 2797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__435); - __Pyx_GIVEREF(__pyx_tuple__435); - - /* "talib/stream.pyx":2799 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHIKKAKEMOD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__436 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(0, 2799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__436); - __Pyx_GIVEREF(__pyx_tuple__436); - - /* "talib/stream.pyx":2830 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__437 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(0, 2830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__437); - __Pyx_GIVEREF(__pyx_tuple__437); - - /* "talib/stream.pyx":2832 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__438 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(0, 2832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__438); - __Pyx_GIVEREF(__pyx_tuple__438); - - /* "talib/stream.pyx":2837 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__439 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(0, 2837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__439); - __Pyx_GIVEREF(__pyx_tuple__439); - - /* "talib/stream.pyx":2839 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__440 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__440); - __Pyx_GIVEREF(__pyx_tuple__440); - - /* "talib/stream.pyx":2844 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__441 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__441); - __Pyx_GIVEREF(__pyx_tuple__441); - - /* "talib/stream.pyx":2846 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__442 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(0, 2846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__442); - __Pyx_GIVEREF(__pyx_tuple__442); - - /* "talib/stream.pyx":2851 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__443 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(0, 2851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__443); - __Pyx_GIVEREF(__pyx_tuple__443); - - /* "talib/stream.pyx":2853 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__444 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(0, 2853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__444); - __Pyx_GIVEREF(__pyx_tuple__444); - - /* "talib/stream.pyx":2859 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__445 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(0, 2859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__445); - __Pyx_GIVEREF(__pyx_tuple__445); - - /* "talib/stream.pyx":2861 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__446 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__446); - __Pyx_GIVEREF(__pyx_tuple__446); - - /* "talib/stream.pyx":2863 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLHOMINGPIGEON( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__447 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__447); - __Pyx_GIVEREF(__pyx_tuple__447); - - /* "talib/stream.pyx":2894 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__448 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(0, 2894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__448); - __Pyx_GIVEREF(__pyx_tuple__448); - - /* "talib/stream.pyx":2896 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__449 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(0, 2896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__449); - __Pyx_GIVEREF(__pyx_tuple__449); - - /* "talib/stream.pyx":2901 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__450 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(0, 2901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__450); - __Pyx_GIVEREF(__pyx_tuple__450); - - /* "talib/stream.pyx":2903 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__451 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(0, 2903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__451); - __Pyx_GIVEREF(__pyx_tuple__451); - - /* "talib/stream.pyx":2908 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__452 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(0, 2908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__452); - __Pyx_GIVEREF(__pyx_tuple__452); - - /* "talib/stream.pyx":2910 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__453 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(0, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__453); - __Pyx_GIVEREF(__pyx_tuple__453); - - /* "talib/stream.pyx":2915 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__454 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(0, 2915, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__454); - __Pyx_GIVEREF(__pyx_tuple__454); - - /* "talib/stream.pyx":2917 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__455 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__455); - __Pyx_GIVEREF(__pyx_tuple__455); - - /* "talib/stream.pyx":2923 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__456 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(0, 2923, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__456); - __Pyx_GIVEREF(__pyx_tuple__456); - - /* "talib/stream.pyx":2925 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__457 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(0, 2925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__457); - __Pyx_GIVEREF(__pyx_tuple__457); - - /* "talib/stream.pyx":2927 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLIDENTICAL3CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__458 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(0, 2927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__458); - __Pyx_GIVEREF(__pyx_tuple__458); - - /* "talib/stream.pyx":2958 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__459 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(0, 2958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__459); - __Pyx_GIVEREF(__pyx_tuple__459); - - /* "talib/stream.pyx":2960 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__460 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(0, 2960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__460); - __Pyx_GIVEREF(__pyx_tuple__460); - - /* "talib/stream.pyx":2965 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__461 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(0, 2965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__461); - __Pyx_GIVEREF(__pyx_tuple__461); - - /* "talib/stream.pyx":2967 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__462 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(0, 2967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__462); - __Pyx_GIVEREF(__pyx_tuple__462); - - /* "talib/stream.pyx":2972 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__463 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(0, 2972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__463); - __Pyx_GIVEREF(__pyx_tuple__463); - - /* "talib/stream.pyx":2974 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__464 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(0, 2974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__464); - __Pyx_GIVEREF(__pyx_tuple__464); - - /* "talib/stream.pyx":2979 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__465 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__465); - __Pyx_GIVEREF(__pyx_tuple__465); - - /* "talib/stream.pyx":2981 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__466 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(0, 2981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__466); - __Pyx_GIVEREF(__pyx_tuple__466); - - /* "talib/stream.pyx":2987 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__467 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(0, 2987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__467); - __Pyx_GIVEREF(__pyx_tuple__467); - - /* "talib/stream.pyx":2989 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__468 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(0, 2989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__468); - __Pyx_GIVEREF(__pyx_tuple__468); - - /* "talib/stream.pyx":2991 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLINNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__469 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(0, 2991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__469); - __Pyx_GIVEREF(__pyx_tuple__469); - - /* "talib/stream.pyx":3022 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__470 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(0, 3022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__470); - __Pyx_GIVEREF(__pyx_tuple__470); - - /* "talib/stream.pyx":3024 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__471 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(0, 3024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__471); - __Pyx_GIVEREF(__pyx_tuple__471); - - /* "talib/stream.pyx":3029 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__472 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(0, 3029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__472); - __Pyx_GIVEREF(__pyx_tuple__472); - - /* "talib/stream.pyx":3031 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__473 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__473); - __Pyx_GIVEREF(__pyx_tuple__473); - - /* "talib/stream.pyx":3036 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__474 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(0, 3036, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__474); - __Pyx_GIVEREF(__pyx_tuple__474); - - /* "talib/stream.pyx":3038 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__475 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(0, 3038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__475); - __Pyx_GIVEREF(__pyx_tuple__475); - - /* "talib/stream.pyx":3043 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__476 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(0, 3043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__476); - __Pyx_GIVEREF(__pyx_tuple__476); - - /* "talib/stream.pyx":3045 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__477 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(0, 3045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__477); - __Pyx_GIVEREF(__pyx_tuple__477); - - /* "talib/stream.pyx":3051 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__478 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(0, 3051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__478); - __Pyx_GIVEREF(__pyx_tuple__478); - - /* "talib/stream.pyx":3053 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__479 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(0, 3053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__479); - __Pyx_GIVEREF(__pyx_tuple__479); - - /* "talib/stream.pyx":3055 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLINVERTEDHAMMER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__480 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__480); - __Pyx_GIVEREF(__pyx_tuple__480); - - /* "talib/stream.pyx":3086 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__481 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(0, 3086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__481); - __Pyx_GIVEREF(__pyx_tuple__481); - - /* "talib/stream.pyx":3088 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__482 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(0, 3088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__482); - __Pyx_GIVEREF(__pyx_tuple__482); - - /* "talib/stream.pyx":3093 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__483 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(0, 3093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__483); - __Pyx_GIVEREF(__pyx_tuple__483); - - /* "talib/stream.pyx":3095 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__484 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(0, 3095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__484); - __Pyx_GIVEREF(__pyx_tuple__484); - - /* "talib/stream.pyx":3100 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__485 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(0, 3100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__485); - __Pyx_GIVEREF(__pyx_tuple__485); - - /* "talib/stream.pyx":3102 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__486 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(0, 3102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__486); - __Pyx_GIVEREF(__pyx_tuple__486); - - /* "talib/stream.pyx":3107 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__487 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__487); - __Pyx_GIVEREF(__pyx_tuple__487); - - /* "talib/stream.pyx":3109 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__488 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__488); - __Pyx_GIVEREF(__pyx_tuple__488); - - /* "talib/stream.pyx":3115 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__489 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__489); - __Pyx_GIVEREF(__pyx_tuple__489); - - /* "talib/stream.pyx":3117 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__490 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__490); - __Pyx_GIVEREF(__pyx_tuple__490); - - /* "talib/stream.pyx":3119 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLKICKING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__491 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(0, 3119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__491); - __Pyx_GIVEREF(__pyx_tuple__491); - - /* "talib/stream.pyx":3150 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__492 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(0, 3150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__492); - __Pyx_GIVEREF(__pyx_tuple__492); - - /* "talib/stream.pyx":3152 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__493 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__493); - __Pyx_GIVEREF(__pyx_tuple__493); - - /* "talib/stream.pyx":3157 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__494 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(0, 3157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__494); - __Pyx_GIVEREF(__pyx_tuple__494); - - /* "talib/stream.pyx":3159 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__495 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__495); - __Pyx_GIVEREF(__pyx_tuple__495); - - /* "talib/stream.pyx":3164 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__496 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(0, 3164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__496); - __Pyx_GIVEREF(__pyx_tuple__496); - - /* "talib/stream.pyx":3166 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__497 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(0, 3166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__497); - __Pyx_GIVEREF(__pyx_tuple__497); - - /* "talib/stream.pyx":3171 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__498 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(0, 3171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__498); - __Pyx_GIVEREF(__pyx_tuple__498); - - /* "talib/stream.pyx":3173 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__499 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(0, 3173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__499); - __Pyx_GIVEREF(__pyx_tuple__499); - - /* "talib/stream.pyx":3179 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__500 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(0, 3179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__500); - __Pyx_GIVEREF(__pyx_tuple__500); - - /* "talib/stream.pyx":3181 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__501 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__501); - __Pyx_GIVEREF(__pyx_tuple__501); - - /* "talib/stream.pyx":3183 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLKICKINGBYLENGTH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__502 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(0, 3183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__502); - __Pyx_GIVEREF(__pyx_tuple__502); - - /* "talib/stream.pyx":3214 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__503 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(0, 3214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__503); - __Pyx_GIVEREF(__pyx_tuple__503); - - /* "talib/stream.pyx":3216 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__504 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(0, 3216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__504); - __Pyx_GIVEREF(__pyx_tuple__504); - - /* "talib/stream.pyx":3221 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__505 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__505); - __Pyx_GIVEREF(__pyx_tuple__505); - - /* "talib/stream.pyx":3223 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__506 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(0, 3223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__506); - __Pyx_GIVEREF(__pyx_tuple__506); - - /* "talib/stream.pyx":3228 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__507 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(0, 3228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__507); - __Pyx_GIVEREF(__pyx_tuple__507); - - /* "talib/stream.pyx":3230 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__508 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(0, 3230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__508); - __Pyx_GIVEREF(__pyx_tuple__508); - - /* "talib/stream.pyx":3235 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__509 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(0, 3235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__509); - __Pyx_GIVEREF(__pyx_tuple__509); - - /* "talib/stream.pyx":3237 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__510 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(0, 3237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__510); - __Pyx_GIVEREF(__pyx_tuple__510); - - /* "talib/stream.pyx":3243 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__511 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(0, 3243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__511); - __Pyx_GIVEREF(__pyx_tuple__511); - - /* "talib/stream.pyx":3245 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__512 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(0, 3245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__512); - __Pyx_GIVEREF(__pyx_tuple__512); - - /* "talib/stream.pyx":3247 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLADDERBOTTOM( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__513 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(0, 3247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__513); - __Pyx_GIVEREF(__pyx_tuple__513); - - /* "talib/stream.pyx":3278 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__514 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(0, 3278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__514); - __Pyx_GIVEREF(__pyx_tuple__514); - - /* "talib/stream.pyx":3280 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__515 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__515)) __PYX_ERR(0, 3280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__515); - __Pyx_GIVEREF(__pyx_tuple__515); - - /* "talib/stream.pyx":3285 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__516 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(0, 3285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__516); - __Pyx_GIVEREF(__pyx_tuple__516); - - /* "talib/stream.pyx":3287 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__517 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(0, 3287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__517); - __Pyx_GIVEREF(__pyx_tuple__517); - - /* "talib/stream.pyx":3292 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__518 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(0, 3292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__518); - __Pyx_GIVEREF(__pyx_tuple__518); - - /* "talib/stream.pyx":3294 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__519 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(0, 3294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__519); - __Pyx_GIVEREF(__pyx_tuple__519); - - /* "talib/stream.pyx":3299 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__520 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(0, 3299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__520); - __Pyx_GIVEREF(__pyx_tuple__520); - - /* "talib/stream.pyx":3301 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__521 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(0, 3301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__521); - __Pyx_GIVEREF(__pyx_tuple__521); - - /* "talib/stream.pyx":3307 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__522 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(0, 3307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__522); - __Pyx_GIVEREF(__pyx_tuple__522); - - /* "talib/stream.pyx":3309 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__523 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__523)) __PYX_ERR(0, 3309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__523); - __Pyx_GIVEREF(__pyx_tuple__523); - - /* "talib/stream.pyx":3311 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLONGLEGGEDDOJI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__524 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(0, 3311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__524); - __Pyx_GIVEREF(__pyx_tuple__524); - - /* "talib/stream.pyx":3342 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__525 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__525)) __PYX_ERR(0, 3342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__525); - __Pyx_GIVEREF(__pyx_tuple__525); - - /* "talib/stream.pyx":3344 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__526 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(0, 3344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__526); - __Pyx_GIVEREF(__pyx_tuple__526); - - /* "talib/stream.pyx":3349 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__527 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(0, 3349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__527); - __Pyx_GIVEREF(__pyx_tuple__527); - - /* "talib/stream.pyx":3351 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__528 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(0, 3351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__528); - __Pyx_GIVEREF(__pyx_tuple__528); - - /* "talib/stream.pyx":3356 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__529 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(0, 3356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__529); - __Pyx_GIVEREF(__pyx_tuple__529); - - /* "talib/stream.pyx":3358 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__530 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(0, 3358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__530); - __Pyx_GIVEREF(__pyx_tuple__530); - - /* "talib/stream.pyx":3363 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__531 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(0, 3363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__531); - __Pyx_GIVEREF(__pyx_tuple__531); - - /* "talib/stream.pyx":3365 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__532 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(0, 3365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__532); - __Pyx_GIVEREF(__pyx_tuple__532); - - /* "talib/stream.pyx":3371 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__533 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__533)) __PYX_ERR(0, 3371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__533); - __Pyx_GIVEREF(__pyx_tuple__533); - - /* "talib/stream.pyx":3373 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__534 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(0, 3373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__534); - __Pyx_GIVEREF(__pyx_tuple__534); - - /* "talib/stream.pyx":3375 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLLONGLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__535 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(0, 3375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__535); - __Pyx_GIVEREF(__pyx_tuple__535); - - /* "talib/stream.pyx":3406 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__536 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(0, 3406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__536); - __Pyx_GIVEREF(__pyx_tuple__536); - - /* "talib/stream.pyx":3408 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__537 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(0, 3408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__537); - __Pyx_GIVEREF(__pyx_tuple__537); - - /* "talib/stream.pyx":3413 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__538 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(0, 3413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__538); - __Pyx_GIVEREF(__pyx_tuple__538); - - /* "talib/stream.pyx":3415 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__539 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(0, 3415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__539); - __Pyx_GIVEREF(__pyx_tuple__539); - - /* "talib/stream.pyx":3420 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__540 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(0, 3420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__540); - __Pyx_GIVEREF(__pyx_tuple__540); - - /* "talib/stream.pyx":3422 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__541 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(0, 3422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__541); - __Pyx_GIVEREF(__pyx_tuple__541); - - /* "talib/stream.pyx":3427 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__542 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(0, 3427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__542); - __Pyx_GIVEREF(__pyx_tuple__542); - - /* "talib/stream.pyx":3429 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__543 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(0, 3429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__543); - __Pyx_GIVEREF(__pyx_tuple__543); - - /* "talib/stream.pyx":3435 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__544 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(0, 3435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__544); - __Pyx_GIVEREF(__pyx_tuple__544); - - /* "talib/stream.pyx":3437 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__545 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(0, 3437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__545); - __Pyx_GIVEREF(__pyx_tuple__545); - - /* "talib/stream.pyx":3439 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMARUBOZU( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__546 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(0, 3439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__546); - __Pyx_GIVEREF(__pyx_tuple__546); - - /* "talib/stream.pyx":3470 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__547 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(0, 3470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__547); - __Pyx_GIVEREF(__pyx_tuple__547); - - /* "talib/stream.pyx":3472 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__548 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(0, 3472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__548); - __Pyx_GIVEREF(__pyx_tuple__548); - - /* "talib/stream.pyx":3477 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__549 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(0, 3477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__549); - __Pyx_GIVEREF(__pyx_tuple__549); - - /* "talib/stream.pyx":3479 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__550 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(0, 3479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__550); - __Pyx_GIVEREF(__pyx_tuple__550); - - /* "talib/stream.pyx":3484 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__551 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(0, 3484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__551); - __Pyx_GIVEREF(__pyx_tuple__551); - - /* "talib/stream.pyx":3486 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__552 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(0, 3486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__552); - __Pyx_GIVEREF(__pyx_tuple__552); - - /* "talib/stream.pyx":3491 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__553 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(0, 3491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__553); - __Pyx_GIVEREF(__pyx_tuple__553); - - /* "talib/stream.pyx":3493 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__554 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(0, 3493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__554); - __Pyx_GIVEREF(__pyx_tuple__554); - - /* "talib/stream.pyx":3499 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__555 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__555)) __PYX_ERR(0, 3499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__555); - __Pyx_GIVEREF(__pyx_tuple__555); - - /* "talib/stream.pyx":3501 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__556 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(0, 3501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__556); - __Pyx_GIVEREF(__pyx_tuple__556); - - /* "talib/stream.pyx":3503 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMATCHINGLOW( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__557 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__557)) __PYX_ERR(0, 3503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__557); - __Pyx_GIVEREF(__pyx_tuple__557); - - /* "talib/stream.pyx":3536 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__558 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(0, 3536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__558); - __Pyx_GIVEREF(__pyx_tuple__558); - - /* "talib/stream.pyx":3538 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__559 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__559)) __PYX_ERR(0, 3538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__559); - __Pyx_GIVEREF(__pyx_tuple__559); - - /* "talib/stream.pyx":3543 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__560 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(0, 3543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__560); - __Pyx_GIVEREF(__pyx_tuple__560); - - /* "talib/stream.pyx":3545 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__561 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__561)) __PYX_ERR(0, 3545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__561); - __Pyx_GIVEREF(__pyx_tuple__561); - - /* "talib/stream.pyx":3550 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__562 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__562)) __PYX_ERR(0, 3550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__562); - __Pyx_GIVEREF(__pyx_tuple__562); - - /* "talib/stream.pyx":3552 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__563 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(0, 3552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__563); - __Pyx_GIVEREF(__pyx_tuple__563); - - /* "talib/stream.pyx":3557 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__564 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(0, 3557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__564); - __Pyx_GIVEREF(__pyx_tuple__564); - - /* "talib/stream.pyx":3559 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__565 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__565)) __PYX_ERR(0, 3559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__565); - __Pyx_GIVEREF(__pyx_tuple__565); - - /* "talib/stream.pyx":3565 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__566 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(0, 3565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__566); - __Pyx_GIVEREF(__pyx_tuple__566); - - /* "talib/stream.pyx":3567 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__567 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(0, 3567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__567); - __Pyx_GIVEREF(__pyx_tuple__567); - - /* "talib/stream.pyx":3569 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMATHOLD( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__568 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(0, 3569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__568); - __Pyx_GIVEREF(__pyx_tuple__568); - - /* "talib/stream.pyx":3602 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__569 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(0, 3602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__569); - __Pyx_GIVEREF(__pyx_tuple__569); - - /* "talib/stream.pyx":3604 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__570 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__570)) __PYX_ERR(0, 3604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__570); - __Pyx_GIVEREF(__pyx_tuple__570); - - /* "talib/stream.pyx":3609 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__571 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(0, 3609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__571); - __Pyx_GIVEREF(__pyx_tuple__571); - - /* "talib/stream.pyx":3611 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__572 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__572)) __PYX_ERR(0, 3611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__572); - __Pyx_GIVEREF(__pyx_tuple__572); - - /* "talib/stream.pyx":3616 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__573 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__573)) __PYX_ERR(0, 3616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__573); - __Pyx_GIVEREF(__pyx_tuple__573); - - /* "talib/stream.pyx":3618 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__574 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__574)) __PYX_ERR(0, 3618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__574); - __Pyx_GIVEREF(__pyx_tuple__574); - - /* "talib/stream.pyx":3623 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__575 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(0, 3623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__575); - __Pyx_GIVEREF(__pyx_tuple__575); - - /* "talib/stream.pyx":3625 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__576 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__576)) __PYX_ERR(0, 3625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__576); - __Pyx_GIVEREF(__pyx_tuple__576); - - /* "talib/stream.pyx":3631 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__577 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(0, 3631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__577); - __Pyx_GIVEREF(__pyx_tuple__577); - - /* "talib/stream.pyx":3633 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__578 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__578)) __PYX_ERR(0, 3633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__578); - __Pyx_GIVEREF(__pyx_tuple__578); - - /* "talib/stream.pyx":3635 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGDOJISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__579 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(0, 3635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__579); - __Pyx_GIVEREF(__pyx_tuple__579); - - /* "talib/stream.pyx":3668 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__580 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__580)) __PYX_ERR(0, 3668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__580); - __Pyx_GIVEREF(__pyx_tuple__580); - - /* "talib/stream.pyx":3670 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__581 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(0, 3670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__581); - __Pyx_GIVEREF(__pyx_tuple__581); - - /* "talib/stream.pyx":3675 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__582 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__582)) __PYX_ERR(0, 3675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__582); - __Pyx_GIVEREF(__pyx_tuple__582); - - /* "talib/stream.pyx":3677 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__583 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(0, 3677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__583); - __Pyx_GIVEREF(__pyx_tuple__583); - - /* "talib/stream.pyx":3682 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__584 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__584)) __PYX_ERR(0, 3682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__584); - __Pyx_GIVEREF(__pyx_tuple__584); - - /* "talib/stream.pyx":3684 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__585 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(0, 3684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__585); - __Pyx_GIVEREF(__pyx_tuple__585); - - /* "talib/stream.pyx":3689 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__586 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__586)) __PYX_ERR(0, 3689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__586); - __Pyx_GIVEREF(__pyx_tuple__586); - - /* "talib/stream.pyx":3691 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__587 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(0, 3691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__587); - __Pyx_GIVEREF(__pyx_tuple__587); - - /* "talib/stream.pyx":3697 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__588 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__588)) __PYX_ERR(0, 3697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__588); - __Pyx_GIVEREF(__pyx_tuple__588); - - /* "talib/stream.pyx":3699 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__589 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__589)) __PYX_ERR(0, 3699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__589); - __Pyx_GIVEREF(__pyx_tuple__589); - - /* "talib/stream.pyx":3701 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLMORNINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , penetration , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__590 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__590)) __PYX_ERR(0, 3701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__590); - __Pyx_GIVEREF(__pyx_tuple__590); - - /* "talib/stream.pyx":3732 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__591 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__591)) __PYX_ERR(0, 3732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__591); - __Pyx_GIVEREF(__pyx_tuple__591); - - /* "talib/stream.pyx":3734 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__592 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__592)) __PYX_ERR(0, 3734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__592); - __Pyx_GIVEREF(__pyx_tuple__592); - - /* "talib/stream.pyx":3739 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__593 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__593)) __PYX_ERR(0, 3739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__593); - __Pyx_GIVEREF(__pyx_tuple__593); - - /* "talib/stream.pyx":3741 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__594 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__594)) __PYX_ERR(0, 3741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__594); - __Pyx_GIVEREF(__pyx_tuple__594); - - /* "talib/stream.pyx":3746 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__595 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(0, 3746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__595); - __Pyx_GIVEREF(__pyx_tuple__595); - - /* "talib/stream.pyx":3748 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__596 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__596)) __PYX_ERR(0, 3748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__596); - __Pyx_GIVEREF(__pyx_tuple__596); - - /* "talib/stream.pyx":3753 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__597 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__597)) __PYX_ERR(0, 3753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__597); - __Pyx_GIVEREF(__pyx_tuple__597); - - /* "talib/stream.pyx":3755 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__598 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(0, 3755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__598); - __Pyx_GIVEREF(__pyx_tuple__598); - - /* "talib/stream.pyx":3761 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__599 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__599)) __PYX_ERR(0, 3761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__599); - __Pyx_GIVEREF(__pyx_tuple__599); - - /* "talib/stream.pyx":3763 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__600 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(0, 3763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__600); - __Pyx_GIVEREF(__pyx_tuple__600); - - /* "talib/stream.pyx":3765 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLONNECK( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__601 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__601)) __PYX_ERR(0, 3765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__601); - __Pyx_GIVEREF(__pyx_tuple__601); - - /* "talib/stream.pyx":3796 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__602 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(0, 3796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__602); - __Pyx_GIVEREF(__pyx_tuple__602); - - /* "talib/stream.pyx":3798 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__603 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__603)) __PYX_ERR(0, 3798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__603); - __Pyx_GIVEREF(__pyx_tuple__603); - - /* "talib/stream.pyx":3803 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__604 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__604)) __PYX_ERR(0, 3803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__604); - __Pyx_GIVEREF(__pyx_tuple__604); - - /* "talib/stream.pyx":3805 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__605 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__605)) __PYX_ERR(0, 3805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__605); - __Pyx_GIVEREF(__pyx_tuple__605); - - /* "talib/stream.pyx":3810 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__606 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(0, 3810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__606); - __Pyx_GIVEREF(__pyx_tuple__606); - - /* "talib/stream.pyx":3812 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__607 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__607)) __PYX_ERR(0, 3812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__607); - __Pyx_GIVEREF(__pyx_tuple__607); - - /* "talib/stream.pyx":3817 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__608 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(0, 3817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__608); - __Pyx_GIVEREF(__pyx_tuple__608); - - /* "talib/stream.pyx":3819 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__609 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__609)) __PYX_ERR(0, 3819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__609); - __Pyx_GIVEREF(__pyx_tuple__609); - - /* "talib/stream.pyx":3825 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__610 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(0, 3825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__610); - __Pyx_GIVEREF(__pyx_tuple__610); - - /* "talib/stream.pyx":3827 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__611 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__611)) __PYX_ERR(0, 3827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__611); - __Pyx_GIVEREF(__pyx_tuple__611); - - /* "talib/stream.pyx":3829 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLPIERCING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__612 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(0, 3829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__612); - __Pyx_GIVEREF(__pyx_tuple__612); - - /* "talib/stream.pyx":3860 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__613 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__613)) __PYX_ERR(0, 3860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__613); - __Pyx_GIVEREF(__pyx_tuple__613); - - /* "talib/stream.pyx":3862 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__614 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(0, 3862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__614); - __Pyx_GIVEREF(__pyx_tuple__614); - - /* "talib/stream.pyx":3867 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__615 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__615)) __PYX_ERR(0, 3867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__615); - __Pyx_GIVEREF(__pyx_tuple__615); - - /* "talib/stream.pyx":3869 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__616 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(0, 3869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__616); - __Pyx_GIVEREF(__pyx_tuple__616); - - /* "talib/stream.pyx":3874 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__617 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__617)) __PYX_ERR(0, 3874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__617); - __Pyx_GIVEREF(__pyx_tuple__617); - - /* "talib/stream.pyx":3876 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__618 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__618)) __PYX_ERR(0, 3876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__618); - __Pyx_GIVEREF(__pyx_tuple__618); - - /* "talib/stream.pyx":3881 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__619 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__619)) __PYX_ERR(0, 3881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__619); - __Pyx_GIVEREF(__pyx_tuple__619); - - /* "talib/stream.pyx":3883 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__620 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__620)) __PYX_ERR(0, 3883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__620); - __Pyx_GIVEREF(__pyx_tuple__620); - - /* "talib/stream.pyx":3889 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__621 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__621)) __PYX_ERR(0, 3889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__621); - __Pyx_GIVEREF(__pyx_tuple__621); - - /* "talib/stream.pyx":3891 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__622 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(0, 3891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__622); - __Pyx_GIVEREF(__pyx_tuple__622); - - /* "talib/stream.pyx":3893 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLRICKSHAWMAN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__623 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__623)) __PYX_ERR(0, 3893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__623); - __Pyx_GIVEREF(__pyx_tuple__623); - - /* "talib/stream.pyx":3924 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__624 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(0, 3924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__624); - __Pyx_GIVEREF(__pyx_tuple__624); - - /* "talib/stream.pyx":3926 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__625 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(0, 3926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__625); - __Pyx_GIVEREF(__pyx_tuple__625); - - /* "talib/stream.pyx":3931 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__626 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__626)) __PYX_ERR(0, 3931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__626); - __Pyx_GIVEREF(__pyx_tuple__626); - - /* "talib/stream.pyx":3933 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__627 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(0, 3933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__627); - __Pyx_GIVEREF(__pyx_tuple__627); - - /* "talib/stream.pyx":3938 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__628 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__628)) __PYX_ERR(0, 3938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__628); - __Pyx_GIVEREF(__pyx_tuple__628); - - /* "talib/stream.pyx":3940 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__629 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(0, 3940, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__629); - __Pyx_GIVEREF(__pyx_tuple__629); - - /* "talib/stream.pyx":3945 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__630 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(0, 3945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__630); - __Pyx_GIVEREF(__pyx_tuple__630); - - /* "talib/stream.pyx":3947 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__631 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(0, 3947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__631); - __Pyx_GIVEREF(__pyx_tuple__631); - - /* "talib/stream.pyx":3953 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__632 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(0, 3953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__632); - __Pyx_GIVEREF(__pyx_tuple__632); - - /* "talib/stream.pyx":3955 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__633 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(0, 3955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__633); - __Pyx_GIVEREF(__pyx_tuple__633); - - /* "talib/stream.pyx":3957 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLRISEFALL3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__634 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(0, 3957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__634); - __Pyx_GIVEREF(__pyx_tuple__634); - - /* "talib/stream.pyx":3988 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__635 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(0, 3988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__635); - __Pyx_GIVEREF(__pyx_tuple__635); - - /* "talib/stream.pyx":3990 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__636 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(0, 3990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__636); - __Pyx_GIVEREF(__pyx_tuple__636); - - /* "talib/stream.pyx":3995 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__637 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(0, 3995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__637); - __Pyx_GIVEREF(__pyx_tuple__637); - - /* "talib/stream.pyx":3997 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__638 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(0, 3997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__638); - __Pyx_GIVEREF(__pyx_tuple__638); - - /* "talib/stream.pyx":4002 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__639 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(0, 4002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__639); - __Pyx_GIVEREF(__pyx_tuple__639); - - /* "talib/stream.pyx":4004 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__640 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__640)) __PYX_ERR(0, 4004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__640); - __Pyx_GIVEREF(__pyx_tuple__640); - - /* "talib/stream.pyx":4009 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__641 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(0, 4009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__641); - __Pyx_GIVEREF(__pyx_tuple__641); - - /* "talib/stream.pyx":4011 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__642 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(0, 4011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__642); - __Pyx_GIVEREF(__pyx_tuple__642); - - /* "talib/stream.pyx":4017 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__643 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__643)) __PYX_ERR(0, 4017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__643); - __Pyx_GIVEREF(__pyx_tuple__643); - - /* "talib/stream.pyx":4019 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__644 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(0, 4019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__644); - __Pyx_GIVEREF(__pyx_tuple__644); - - /* "talib/stream.pyx":4021 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSEPARATINGLINES( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__645 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__645)) __PYX_ERR(0, 4021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__645); - __Pyx_GIVEREF(__pyx_tuple__645); - - /* "talib/stream.pyx":4052 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__646 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__646)) __PYX_ERR(0, 4052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__646); - __Pyx_GIVEREF(__pyx_tuple__646); - - /* "talib/stream.pyx":4054 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__647 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(0, 4054, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__647); - __Pyx_GIVEREF(__pyx_tuple__647); - - /* "talib/stream.pyx":4059 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__648 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__648)) __PYX_ERR(0, 4059, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__648); - __Pyx_GIVEREF(__pyx_tuple__648); - - /* "talib/stream.pyx":4061 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__649 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(0, 4061, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__649); - __Pyx_GIVEREF(__pyx_tuple__649); - - /* "talib/stream.pyx":4066 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__650 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__650)) __PYX_ERR(0, 4066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__650); - __Pyx_GIVEREF(__pyx_tuple__650); - - /* "talib/stream.pyx":4068 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__651 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(0, 4068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__651); - __Pyx_GIVEREF(__pyx_tuple__651); - - /* "talib/stream.pyx":4073 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__652 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__652)) __PYX_ERR(0, 4073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__652); - __Pyx_GIVEREF(__pyx_tuple__652); - - /* "talib/stream.pyx":4075 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__653 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(0, 4075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__653); - __Pyx_GIVEREF(__pyx_tuple__653); - - /* "talib/stream.pyx":4081 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__654 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__654)) __PYX_ERR(0, 4081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__654); - __Pyx_GIVEREF(__pyx_tuple__654); - - /* "talib/stream.pyx":4083 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__655 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(0, 4083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__655); - __Pyx_GIVEREF(__pyx_tuple__655); - - /* "talib/stream.pyx":4085 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSHOOTINGSTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__656 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__656)) __PYX_ERR(0, 4085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__656); - __Pyx_GIVEREF(__pyx_tuple__656); - - /* "talib/stream.pyx":4116 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__657 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(0, 4116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__657); - __Pyx_GIVEREF(__pyx_tuple__657); - - /* "talib/stream.pyx":4118 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__658 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__658)) __PYX_ERR(0, 4118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__658); - __Pyx_GIVEREF(__pyx_tuple__658); - - /* "talib/stream.pyx":4123 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__659 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(0, 4123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__659); - __Pyx_GIVEREF(__pyx_tuple__659); - - /* "talib/stream.pyx":4125 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__660 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__660)) __PYX_ERR(0, 4125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__660); - __Pyx_GIVEREF(__pyx_tuple__660); - - /* "talib/stream.pyx":4130 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__661 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(0, 4130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__661); - __Pyx_GIVEREF(__pyx_tuple__661); - - /* "talib/stream.pyx":4132 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__662 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__662)) __PYX_ERR(0, 4132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__662); - __Pyx_GIVEREF(__pyx_tuple__662); - - /* "talib/stream.pyx":4137 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__663 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(0, 4137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__663); - __Pyx_GIVEREF(__pyx_tuple__663); - - /* "talib/stream.pyx":4139 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__664 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__664)) __PYX_ERR(0, 4139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__664); - __Pyx_GIVEREF(__pyx_tuple__664); - - /* "talib/stream.pyx":4145 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__665 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(0, 4145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__665); - __Pyx_GIVEREF(__pyx_tuple__665); - - /* "talib/stream.pyx":4147 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__666 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__666)) __PYX_ERR(0, 4147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__666); - __Pyx_GIVEREF(__pyx_tuple__666); - - /* "talib/stream.pyx":4149 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSHORTLINE( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__667 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(0, 4149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__667); - __Pyx_GIVEREF(__pyx_tuple__667); - - /* "talib/stream.pyx":4180 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__668 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__668)) __PYX_ERR(0, 4180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__668); - __Pyx_GIVEREF(__pyx_tuple__668); - - /* "talib/stream.pyx":4182 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__669 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(0, 4182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__669); - __Pyx_GIVEREF(__pyx_tuple__669); - - /* "talib/stream.pyx":4187 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__670 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__670)) __PYX_ERR(0, 4187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__670); - __Pyx_GIVEREF(__pyx_tuple__670); - - /* "talib/stream.pyx":4189 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__671 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(0, 4189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__671); - __Pyx_GIVEREF(__pyx_tuple__671); - - /* "talib/stream.pyx":4194 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__672 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__672)) __PYX_ERR(0, 4194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__672); - __Pyx_GIVEREF(__pyx_tuple__672); - - /* "talib/stream.pyx":4196 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__673 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(0, 4196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__673); - __Pyx_GIVEREF(__pyx_tuple__673); - - /* "talib/stream.pyx":4201 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__674 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__674)) __PYX_ERR(0, 4201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__674); - __Pyx_GIVEREF(__pyx_tuple__674); - - /* "talib/stream.pyx":4203 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__675 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(0, 4203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__675); - __Pyx_GIVEREF(__pyx_tuple__675); - - /* "talib/stream.pyx":4209 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__676 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__676)) __PYX_ERR(0, 4209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__676); - __Pyx_GIVEREF(__pyx_tuple__676); - - /* "talib/stream.pyx":4211 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__677 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(0, 4211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__677); - __Pyx_GIVEREF(__pyx_tuple__677); - - /* "talib/stream.pyx":4213 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSPINNINGTOP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__678 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__678)) __PYX_ERR(0, 4213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__678); - __Pyx_GIVEREF(__pyx_tuple__678); - - /* "talib/stream.pyx":4244 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__679 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__679)) __PYX_ERR(0, 4244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__679); - __Pyx_GIVEREF(__pyx_tuple__679); - - /* "talib/stream.pyx":4246 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__680 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__680)) __PYX_ERR(0, 4246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__680); - __Pyx_GIVEREF(__pyx_tuple__680); - - /* "talib/stream.pyx":4251 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__681 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__681)) __PYX_ERR(0, 4251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__681); - __Pyx_GIVEREF(__pyx_tuple__681); - - /* "talib/stream.pyx":4253 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__682 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__682)) __PYX_ERR(0, 4253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__682); - __Pyx_GIVEREF(__pyx_tuple__682); - - /* "talib/stream.pyx":4258 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__683 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__683)) __PYX_ERR(0, 4258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__683); - __Pyx_GIVEREF(__pyx_tuple__683); - - /* "talib/stream.pyx":4260 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__684 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__684)) __PYX_ERR(0, 4260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__684); - __Pyx_GIVEREF(__pyx_tuple__684); - - /* "talib/stream.pyx":4265 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__685 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__685)) __PYX_ERR(0, 4265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__685); - __Pyx_GIVEREF(__pyx_tuple__685); - - /* "talib/stream.pyx":4267 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__686 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(0, 4267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__686); - __Pyx_GIVEREF(__pyx_tuple__686); - - /* "talib/stream.pyx":4273 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__687 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__687)) __PYX_ERR(0, 4273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__687); - __Pyx_GIVEREF(__pyx_tuple__687); - - /* "talib/stream.pyx":4275 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__688 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__688)) __PYX_ERR(0, 4275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__688); - __Pyx_GIVEREF(__pyx_tuple__688); - - /* "talib/stream.pyx":4277 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSTALLEDPATTERN( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__689 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__689)) __PYX_ERR(0, 4277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__689); - __Pyx_GIVEREF(__pyx_tuple__689); - - /* "talib/stream.pyx":4308 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__690 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__690)) __PYX_ERR(0, 4308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__690); - __Pyx_GIVEREF(__pyx_tuple__690); - - /* "talib/stream.pyx":4310 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__691 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__691)) __PYX_ERR(0, 4310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__691); - __Pyx_GIVEREF(__pyx_tuple__691); - - /* "talib/stream.pyx":4315 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__692 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__692)) __PYX_ERR(0, 4315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__692); - __Pyx_GIVEREF(__pyx_tuple__692); - - /* "talib/stream.pyx":4317 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__693 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__693)) __PYX_ERR(0, 4317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__693); - __Pyx_GIVEREF(__pyx_tuple__693); - - /* "talib/stream.pyx":4322 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__694 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__694)) __PYX_ERR(0, 4322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__694); - __Pyx_GIVEREF(__pyx_tuple__694); - - /* "talib/stream.pyx":4324 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__695 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__695)) __PYX_ERR(0, 4324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__695); - __Pyx_GIVEREF(__pyx_tuple__695); - - /* "talib/stream.pyx":4329 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__696 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__696)) __PYX_ERR(0, 4329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__696); - __Pyx_GIVEREF(__pyx_tuple__696); - - /* "talib/stream.pyx":4331 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__697 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__697)) __PYX_ERR(0, 4331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__697); - __Pyx_GIVEREF(__pyx_tuple__697); - - /* "talib/stream.pyx":4337 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__698 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__698)) __PYX_ERR(0, 4337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__698); - __Pyx_GIVEREF(__pyx_tuple__698); - - /* "talib/stream.pyx":4339 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__699 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__699)) __PYX_ERR(0, 4339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__699); - __Pyx_GIVEREF(__pyx_tuple__699); - - /* "talib/stream.pyx":4341 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLSTICKSANDWICH( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__700 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__700)) __PYX_ERR(0, 4341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__700); - __Pyx_GIVEREF(__pyx_tuple__700); - - /* "talib/stream.pyx":4372 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__701 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__701)) __PYX_ERR(0, 4372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__701); - __Pyx_GIVEREF(__pyx_tuple__701); - - /* "talib/stream.pyx":4374 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__702 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__702)) __PYX_ERR(0, 4374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__702); - __Pyx_GIVEREF(__pyx_tuple__702); - - /* "talib/stream.pyx":4379 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__703 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__703)) __PYX_ERR(0, 4379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__703); - __Pyx_GIVEREF(__pyx_tuple__703); - - /* "talib/stream.pyx":4381 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__704 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__704)) __PYX_ERR(0, 4381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__704); - __Pyx_GIVEREF(__pyx_tuple__704); - - /* "talib/stream.pyx":4386 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__705 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__705)) __PYX_ERR(0, 4386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__705); - __Pyx_GIVEREF(__pyx_tuple__705); - - /* "talib/stream.pyx":4388 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__706 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__706)) __PYX_ERR(0, 4388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__706); - __Pyx_GIVEREF(__pyx_tuple__706); - - /* "talib/stream.pyx":4393 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__707 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__707)) __PYX_ERR(0, 4393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__707); - __Pyx_GIVEREF(__pyx_tuple__707); - - /* "talib/stream.pyx":4395 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__708 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__708)) __PYX_ERR(0, 4395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__708); - __Pyx_GIVEREF(__pyx_tuple__708); - - /* "talib/stream.pyx":4401 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__709 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__709)) __PYX_ERR(0, 4401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__709); - __Pyx_GIVEREF(__pyx_tuple__709); - - /* "talib/stream.pyx":4403 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__710 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__710)) __PYX_ERR(0, 4403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__710); - __Pyx_GIVEREF(__pyx_tuple__710); - - /* "talib/stream.pyx":4405 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTAKURI( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__711 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__711)) __PYX_ERR(0, 4405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__711); - __Pyx_GIVEREF(__pyx_tuple__711); - - /* "talib/stream.pyx":4436 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__712 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__712)) __PYX_ERR(0, 4436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__712); - __Pyx_GIVEREF(__pyx_tuple__712); - - /* "talib/stream.pyx":4438 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__713 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__713)) __PYX_ERR(0, 4438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__713); - __Pyx_GIVEREF(__pyx_tuple__713); - - /* "talib/stream.pyx":4443 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__714 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__714)) __PYX_ERR(0, 4443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__714); - __Pyx_GIVEREF(__pyx_tuple__714); - - /* "talib/stream.pyx":4445 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__715 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__715)) __PYX_ERR(0, 4445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__715); - __Pyx_GIVEREF(__pyx_tuple__715); - - /* "talib/stream.pyx":4450 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__716)) __PYX_ERR(0, 4450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__716); - __Pyx_GIVEREF(__pyx_tuple__716); - - /* "talib/stream.pyx":4452 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__717)) __PYX_ERR(0, 4452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__717); - __Pyx_GIVEREF(__pyx_tuple__717); - - /* "talib/stream.pyx":4457 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__718)) __PYX_ERR(0, 4457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__718); - __Pyx_GIVEREF(__pyx_tuple__718); - - /* "talib/stream.pyx":4459 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__719)) __PYX_ERR(0, 4459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__719); - __Pyx_GIVEREF(__pyx_tuple__719); - - /* "talib/stream.pyx":4465 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__720)) __PYX_ERR(0, 4465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__720); - __Pyx_GIVEREF(__pyx_tuple__720); - - /* "talib/stream.pyx":4467 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__721 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__721)) __PYX_ERR(0, 4467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__721); - __Pyx_GIVEREF(__pyx_tuple__721); - - /* "talib/stream.pyx":4469 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTASUKIGAP( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__722 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__722)) __PYX_ERR(0, 4469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__722); - __Pyx_GIVEREF(__pyx_tuple__722); - - /* "talib/stream.pyx":4500 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__723 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__723)) __PYX_ERR(0, 4500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__723); - __Pyx_GIVEREF(__pyx_tuple__723); - - /* "talib/stream.pyx":4502 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__724 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__724)) __PYX_ERR(0, 4502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__724); - __Pyx_GIVEREF(__pyx_tuple__724); - - /* "talib/stream.pyx":4507 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__725 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__725)) __PYX_ERR(0, 4507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__725); - __Pyx_GIVEREF(__pyx_tuple__725); - - /* "talib/stream.pyx":4509 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__726 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__726)) __PYX_ERR(0, 4509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__726); - __Pyx_GIVEREF(__pyx_tuple__726); - - /* "talib/stream.pyx":4514 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__727 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__727)) __PYX_ERR(0, 4514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__727); - __Pyx_GIVEREF(__pyx_tuple__727); - - /* "talib/stream.pyx":4516 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__728 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__728)) __PYX_ERR(0, 4516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__728); - __Pyx_GIVEREF(__pyx_tuple__728); - - /* "talib/stream.pyx":4521 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__729 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__729)) __PYX_ERR(0, 4521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__729); - __Pyx_GIVEREF(__pyx_tuple__729); - - /* "talib/stream.pyx":4523 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__730 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__730)) __PYX_ERR(0, 4523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__730); - __Pyx_GIVEREF(__pyx_tuple__730); - - /* "talib/stream.pyx":4529 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__731 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__731)) __PYX_ERR(0, 4529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__731); - __Pyx_GIVEREF(__pyx_tuple__731); - - /* "talib/stream.pyx":4531 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__732 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__732)) __PYX_ERR(0, 4531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__732); - __Pyx_GIVEREF(__pyx_tuple__732); - - /* "talib/stream.pyx":4533 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTHRUSTING( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__733 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__733)) __PYX_ERR(0, 4533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__733); - __Pyx_GIVEREF(__pyx_tuple__733); - - /* "talib/stream.pyx":4564 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__734 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__734)) __PYX_ERR(0, 4564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__734); - __Pyx_GIVEREF(__pyx_tuple__734); - - /* "talib/stream.pyx":4566 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__735 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__735)) __PYX_ERR(0, 4566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__735); - __Pyx_GIVEREF(__pyx_tuple__735); - - /* "talib/stream.pyx":4571 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__736 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__736)) __PYX_ERR(0, 4571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__736); - __Pyx_GIVEREF(__pyx_tuple__736); - - /* "talib/stream.pyx":4573 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__737 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__737)) __PYX_ERR(0, 4573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__737); - __Pyx_GIVEREF(__pyx_tuple__737); - - /* "talib/stream.pyx":4578 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__738 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__738)) __PYX_ERR(0, 4578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__738); - __Pyx_GIVEREF(__pyx_tuple__738); - - /* "talib/stream.pyx":4580 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__739 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__739)) __PYX_ERR(0, 4580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__739); - __Pyx_GIVEREF(__pyx_tuple__739); - - /* "talib/stream.pyx":4585 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__740 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__740)) __PYX_ERR(0, 4585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__740); - __Pyx_GIVEREF(__pyx_tuple__740); - - /* "talib/stream.pyx":4587 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__741 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__741)) __PYX_ERR(0, 4587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__741); - __Pyx_GIVEREF(__pyx_tuple__741); - - /* "talib/stream.pyx":4593 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__742 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__742)) __PYX_ERR(0, 4593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__742); - __Pyx_GIVEREF(__pyx_tuple__742); - - /* "talib/stream.pyx":4595 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__743 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__743)) __PYX_ERR(0, 4595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__743); - __Pyx_GIVEREF(__pyx_tuple__743); - - /* "talib/stream.pyx":4597 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLTRISTAR( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__744 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__744)) __PYX_ERR(0, 4597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__744); - __Pyx_GIVEREF(__pyx_tuple__744); - - /* "talib/stream.pyx":4628 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__745 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__745)) __PYX_ERR(0, 4628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__745); - __Pyx_GIVEREF(__pyx_tuple__745); - - /* "talib/stream.pyx":4630 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__746 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__746)) __PYX_ERR(0, 4630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__746); - __Pyx_GIVEREF(__pyx_tuple__746); - - /* "talib/stream.pyx":4635 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__747 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__747)) __PYX_ERR(0, 4635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__747); - __Pyx_GIVEREF(__pyx_tuple__747); - - /* "talib/stream.pyx":4637 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__748 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__748)) __PYX_ERR(0, 4637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__748); - __Pyx_GIVEREF(__pyx_tuple__748); - - /* "talib/stream.pyx":4642 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__749 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__749)) __PYX_ERR(0, 4642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__749); - __Pyx_GIVEREF(__pyx_tuple__749); - - /* "talib/stream.pyx":4644 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__750 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__750)) __PYX_ERR(0, 4644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__750); - __Pyx_GIVEREF(__pyx_tuple__750); - - /* "talib/stream.pyx":4649 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__751 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__751)) __PYX_ERR(0, 4649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__751); - __Pyx_GIVEREF(__pyx_tuple__751); - - /* "talib/stream.pyx":4651 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__752 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__752)) __PYX_ERR(0, 4651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__752); - __Pyx_GIVEREF(__pyx_tuple__752); - - /* "talib/stream.pyx":4657 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__753 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__753)) __PYX_ERR(0, 4657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__753); - __Pyx_GIVEREF(__pyx_tuple__753); - - /* "talib/stream.pyx":4659 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__754 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__754)) __PYX_ERR(0, 4659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__754); - __Pyx_GIVEREF(__pyx_tuple__754); - - /* "talib/stream.pyx":4661 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLUNIQUE3RIVER( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__755 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__755)) __PYX_ERR(0, 4661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__755); - __Pyx_GIVEREF(__pyx_tuple__755); - - /* "talib/stream.pyx":4692 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__756 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__756)) __PYX_ERR(0, 4692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__756); - __Pyx_GIVEREF(__pyx_tuple__756); - - /* "talib/stream.pyx":4694 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__757 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__757)) __PYX_ERR(0, 4694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__757); - __Pyx_GIVEREF(__pyx_tuple__757); - - /* "talib/stream.pyx":4699 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__758 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__758)) __PYX_ERR(0, 4699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__758); - __Pyx_GIVEREF(__pyx_tuple__758); - - /* "talib/stream.pyx":4701 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__759 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__759)) __PYX_ERR(0, 4701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__759); - __Pyx_GIVEREF(__pyx_tuple__759); - - /* "talib/stream.pyx":4706 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__760 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__760)) __PYX_ERR(0, 4706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__760); - __Pyx_GIVEREF(__pyx_tuple__760); - - /* "talib/stream.pyx":4708 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__761 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__761)) __PYX_ERR(0, 4708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__761); - __Pyx_GIVEREF(__pyx_tuple__761); - - /* "talib/stream.pyx":4713 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__762 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__762)) __PYX_ERR(0, 4713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__762); - __Pyx_GIVEREF(__pyx_tuple__762); - - /* "talib/stream.pyx":4715 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__763 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__763)) __PYX_ERR(0, 4715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__763); - __Pyx_GIVEREF(__pyx_tuple__763); - - /* "talib/stream.pyx":4721 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__764 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__764)) __PYX_ERR(0, 4721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__764); - __Pyx_GIVEREF(__pyx_tuple__764); - - /* "talib/stream.pyx":4723 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__765 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__765)) __PYX_ERR(0, 4723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__765); - __Pyx_GIVEREF(__pyx_tuple__765); - - /* "talib/stream.pyx":4725 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLUPSIDEGAP2CROWS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__766 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__766)) __PYX_ERR(0, 4725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__766); - __Pyx_GIVEREF(__pyx_tuple__766); - - /* "talib/stream.pyx":4756 - * int outinteger - * if PyArray_TYPE(open) != np.NPY_DOUBLE: - * raise Exception("open is not double") # <<<<<<<<<<<<<< - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") - */ - __pyx_tuple__767 = PyTuple_Pack(1, __pyx_kp_s_open_is_not_double); if (unlikely(!__pyx_tuple__767)) __PYX_ERR(0, 4756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__767); - __Pyx_GIVEREF(__pyx_tuple__767); - - /* "talib/stream.pyx":4758 - * raise Exception("open is not double") - * if open.ndim != 1: - * raise Exception("open has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(open) & np.NPY_C_CONTIGUOUS): - * open = PyArray_GETCONTIGUOUS(open) - */ - __pyx_tuple__768 = PyTuple_Pack(1, __pyx_kp_s_open_has_wrong_dimensions); if (unlikely(!__pyx_tuple__768)) __PYX_ERR(0, 4758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__768); - __Pyx_GIVEREF(__pyx_tuple__768); - - /* "talib/stream.pyx":4763 - * open_data = open.data - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__769 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__769)) __PYX_ERR(0, 4763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__769); - __Pyx_GIVEREF(__pyx_tuple__769); - - /* "talib/stream.pyx":4765 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__770 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__770)) __PYX_ERR(0, 4765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__770); - __Pyx_GIVEREF(__pyx_tuple__770); - - /* "talib/stream.pyx":4770 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__771 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__771)) __PYX_ERR(0, 4770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__771); - __Pyx_GIVEREF(__pyx_tuple__771); - - /* "talib/stream.pyx":4772 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__772 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__772)) __PYX_ERR(0, 4772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__772); - __Pyx_GIVEREF(__pyx_tuple__772); - - /* "talib/stream.pyx":4777 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__773 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__773)) __PYX_ERR(0, 4777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__773); - __Pyx_GIVEREF(__pyx_tuple__773); - - /* "talib/stream.pyx":4779 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__774 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__774)) __PYX_ERR(0, 4779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__774); - __Pyx_GIVEREF(__pyx_tuple__774); - - /* "talib/stream.pyx":4785 - * length = open.shape[0] - * if length != high.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != low.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__775 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__775)) __PYX_ERR(0, 4785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__775); - __Pyx_GIVEREF(__pyx_tuple__775); - - /* "talib/stream.pyx":4787 - * raise Exception("input lengths are different") - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__776 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__776)) __PYX_ERR(0, 4787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__776); - __Pyx_GIVEREF(__pyx_tuple__776); - - /* "talib/stream.pyx":4789 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outinteger = 0 - * retCode = lib.TA_CDLXSIDEGAP3METHODS( length - 1 , length - 1 , open_data , high_data , low_data , close_data , &outbegidx , &outnbelement , &outinteger ) - */ - __pyx_tuple__777 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__777)) __PYX_ERR(0, 4789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__777); - __Pyx_GIVEREF(__pyx_tuple__777); - - /* "talib/stream.pyx":4817 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__778 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__778)) __PYX_ERR(0, 4817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__778); - __Pyx_GIVEREF(__pyx_tuple__778); - - /* "talib/stream.pyx":4819 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__779 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__779)) __PYX_ERR(0, 4819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__779); - __Pyx_GIVEREF(__pyx_tuple__779); - - /* "talib/stream.pyx":4853 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__780 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__780)) __PYX_ERR(0, 4853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__780); - __Pyx_GIVEREF(__pyx_tuple__780); - - /* "talib/stream.pyx":4855 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__781 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__781)) __PYX_ERR(0, 4855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__781); - __Pyx_GIVEREF(__pyx_tuple__781); - - /* "talib/stream.pyx":4891 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__782 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__782)) __PYX_ERR(0, 4891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__782); - __Pyx_GIVEREF(__pyx_tuple__782); - - /* "talib/stream.pyx":4893 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__783 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__783)) __PYX_ERR(0, 4893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__783); - __Pyx_GIVEREF(__pyx_tuple__783); - - /* "talib/stream.pyx":4898 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__784 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__784)) __PYX_ERR(0, 4898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__784); - __Pyx_GIVEREF(__pyx_tuple__784); - - /* "talib/stream.pyx":4900 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__785 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__785)) __PYX_ERR(0, 4900, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__785); - __Pyx_GIVEREF(__pyx_tuple__785); - - /* "talib/stream.pyx":4906 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_CORREL( length - 1 , length - 1 , real0_data , real1_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__786 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__786)) __PYX_ERR(0, 4906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__786); - __Pyx_GIVEREF(__pyx_tuple__786); - - /* "talib/stream.pyx":4934 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__787 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__787)) __PYX_ERR(0, 4934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__787); - __Pyx_GIVEREF(__pyx_tuple__787); - - /* "talib/stream.pyx":4936 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__788 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__788)) __PYX_ERR(0, 4936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__788); - __Pyx_GIVEREF(__pyx_tuple__788); - - /* "talib/stream.pyx":4968 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__789 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__789)) __PYX_ERR(0, 4968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__789); - __Pyx_GIVEREF(__pyx_tuple__789); - - /* "talib/stream.pyx":4970 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__790 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__790)) __PYX_ERR(0, 4970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__790); - __Pyx_GIVEREF(__pyx_tuple__790); - - /* "talib/stream.pyx":5004 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__791 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__791)) __PYX_ERR(0, 5004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__791); - __Pyx_GIVEREF(__pyx_tuple__791); - - /* "talib/stream.pyx":5006 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__792 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__792)) __PYX_ERR(0, 5006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__792); - __Pyx_GIVEREF(__pyx_tuple__792); - - /* "talib/stream.pyx":5040 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__793 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__793)) __PYX_ERR(0, 5040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__793); - __Pyx_GIVEREF(__pyx_tuple__793); - - /* "talib/stream.pyx":5042 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__794 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__794)) __PYX_ERR(0, 5042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__794); - __Pyx_GIVEREF(__pyx_tuple__794); - - /* "talib/stream.pyx":5047 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__795 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__795)) __PYX_ERR(0, 5047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__795); - __Pyx_GIVEREF(__pyx_tuple__795); - - /* "talib/stream.pyx":5049 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__796 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__796)) __PYX_ERR(0, 5049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__796); - __Pyx_GIVEREF(__pyx_tuple__796); - - /* "talib/stream.pyx":5055 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_DIV( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__797 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__797)) __PYX_ERR(0, 5055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__797); - __Pyx_GIVEREF(__pyx_tuple__797); - - /* "talib/stream.pyx":5087 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__798 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__798)) __PYX_ERR(0, 5087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__798); - __Pyx_GIVEREF(__pyx_tuple__798); - - /* "talib/stream.pyx":5089 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__799 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__799)) __PYX_ERR(0, 5089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__799); - __Pyx_GIVEREF(__pyx_tuple__799); - - /* "talib/stream.pyx":5094 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__800 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__800)) __PYX_ERR(0, 5094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__800); - __Pyx_GIVEREF(__pyx_tuple__800); - - /* "talib/stream.pyx":5096 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__801 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__801)) __PYX_ERR(0, 5096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__801); - __Pyx_GIVEREF(__pyx_tuple__801); - - /* "talib/stream.pyx":5101 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__802 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__802)) __PYX_ERR(0, 5101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__802); - __Pyx_GIVEREF(__pyx_tuple__802); - - /* "talib/stream.pyx":5103 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__803 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__803)) __PYX_ERR(0, 5103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__803); - __Pyx_GIVEREF(__pyx_tuple__803); - - /* "talib/stream.pyx":5109 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__804 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__804)) __PYX_ERR(0, 5109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__804); - __Pyx_GIVEREF(__pyx_tuple__804); - - /* "talib/stream.pyx":5111 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_DX( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__805 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__805)) __PYX_ERR(0, 5111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__805); - __Pyx_GIVEREF(__pyx_tuple__805); - - /* "talib/stream.pyx":5141 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__806 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__806)) __PYX_ERR(0, 5141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__806); - __Pyx_GIVEREF(__pyx_tuple__806); - - /* "talib/stream.pyx":5143 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__807 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__807)) __PYX_ERR(0, 5143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__807); - __Pyx_GIVEREF(__pyx_tuple__807); - - /* "talib/stream.pyx":5175 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__808 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__808)) __PYX_ERR(0, 5175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__808); - __Pyx_GIVEREF(__pyx_tuple__808); - - /* "talib/stream.pyx":5177 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__809 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__809)) __PYX_ERR(0, 5177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__809); - __Pyx_GIVEREF(__pyx_tuple__809); - - /* "talib/stream.pyx":5209 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__810 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__810)) __PYX_ERR(0, 5209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__810); - __Pyx_GIVEREF(__pyx_tuple__810); - - /* "talib/stream.pyx":5211 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__811 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__811)) __PYX_ERR(0, 5211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__811); - __Pyx_GIVEREF(__pyx_tuple__811); - - /* "talib/stream.pyx":5243 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__812 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__812)) __PYX_ERR(0, 5243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__812); - __Pyx_GIVEREF(__pyx_tuple__812); - - /* "talib/stream.pyx":5245 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__813 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__813)) __PYX_ERR(0, 5245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__813); - __Pyx_GIVEREF(__pyx_tuple__813); - - /* "talib/stream.pyx":5277 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__814 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__814)) __PYX_ERR(0, 5277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__814); - __Pyx_GIVEREF(__pyx_tuple__814); - - /* "talib/stream.pyx":5279 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__815 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__815)) __PYX_ERR(0, 5279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__815); - __Pyx_GIVEREF(__pyx_tuple__815); - - /* "talib/stream.pyx":5313 - * double outquadrature - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__816 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__816)) __PYX_ERR(0, 5313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__816); - __Pyx_GIVEREF(__pyx_tuple__816); - - /* "talib/stream.pyx":5315 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__817 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__817)) __PYX_ERR(0, 5315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__817); - __Pyx_GIVEREF(__pyx_tuple__817); - - /* "talib/stream.pyx":5350 - * double outleadsine - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__818 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__818)) __PYX_ERR(0, 5350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__818); - __Pyx_GIVEREF(__pyx_tuple__818); - - /* "talib/stream.pyx":5352 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__819 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__819)) __PYX_ERR(0, 5352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__819); - __Pyx_GIVEREF(__pyx_tuple__819); - - /* "talib/stream.pyx":5385 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__820 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__820)) __PYX_ERR(0, 5385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__820); - __Pyx_GIVEREF(__pyx_tuple__820); - - /* "talib/stream.pyx":5387 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__821 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__821)) __PYX_ERR(0, 5387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__821); - __Pyx_GIVEREF(__pyx_tuple__821); - - /* "talib/stream.pyx":5419 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__822 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__822)) __PYX_ERR(0, 5419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__822); - __Pyx_GIVEREF(__pyx_tuple__822); - - /* "talib/stream.pyx":5421 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__823 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__823)) __PYX_ERR(0, 5421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__823); - __Pyx_GIVEREF(__pyx_tuple__823); - - /* "talib/stream.pyx":5455 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__824 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__824)) __PYX_ERR(0, 5455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__824); - __Pyx_GIVEREF(__pyx_tuple__824); - - /* "talib/stream.pyx":5457 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__825 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__825)) __PYX_ERR(0, 5457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__825); - __Pyx_GIVEREF(__pyx_tuple__825); - - /* "talib/stream.pyx":5491 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__826 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__826)) __PYX_ERR(0, 5491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__826); - __Pyx_GIVEREF(__pyx_tuple__826); - - /* "talib/stream.pyx":5493 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__827 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__827)) __PYX_ERR(0, 5493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__827); - __Pyx_GIVEREF(__pyx_tuple__827); - - /* "talib/stream.pyx":5527 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__828 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__828)) __PYX_ERR(0, 5527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__828); - __Pyx_GIVEREF(__pyx_tuple__828); - - /* "talib/stream.pyx":5529 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__829 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__829)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__829); - __Pyx_GIVEREF(__pyx_tuple__829); - - /* "talib/stream.pyx":5563 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__830 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__830)) __PYX_ERR(0, 5563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__830); - __Pyx_GIVEREF(__pyx_tuple__830); - - /* "talib/stream.pyx":5565 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__831 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__831)) __PYX_ERR(0, 5565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__831); - __Pyx_GIVEREF(__pyx_tuple__831); - - /* "talib/stream.pyx":5599 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__832 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__832)) __PYX_ERR(0, 5599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__832); - __Pyx_GIVEREF(__pyx_tuple__832); - - /* "talib/stream.pyx":5601 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__833 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__833)) __PYX_ERR(0, 5601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__833); - __Pyx_GIVEREF(__pyx_tuple__833); - - /* "talib/stream.pyx":5633 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__834 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__834)) __PYX_ERR(0, 5633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__834); - __Pyx_GIVEREF(__pyx_tuple__834); - - /* "talib/stream.pyx":5635 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__835 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__835)) __PYX_ERR(0, 5635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__835); - __Pyx_GIVEREF(__pyx_tuple__835); - - /* "talib/stream.pyx":5667 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__836 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__836)) __PYX_ERR(0, 5667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__836); - __Pyx_GIVEREF(__pyx_tuple__836); - - /* "talib/stream.pyx":5669 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__837 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__837)) __PYX_ERR(0, 5669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__837); - __Pyx_GIVEREF(__pyx_tuple__837); - - /* "talib/stream.pyx":5704 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__838 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__838)) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__838); - __Pyx_GIVEREF(__pyx_tuple__838); - - /* "talib/stream.pyx":5706 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__839 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__839)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__839); - __Pyx_GIVEREF(__pyx_tuple__839); - - /* "talib/stream.pyx":5746 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__840 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__840)) __PYX_ERR(0, 5746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__840); - __Pyx_GIVEREF(__pyx_tuple__840); - - /* "talib/stream.pyx":5748 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__841 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__841)) __PYX_ERR(0, 5748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__841); - __Pyx_GIVEREF(__pyx_tuple__841); - - /* "talib/stream.pyx":5793 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__842 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__842)) __PYX_ERR(0, 5793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__842); - __Pyx_GIVEREF(__pyx_tuple__842); - - /* "talib/stream.pyx":5795 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__843 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__843)) __PYX_ERR(0, 5795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__843); - __Pyx_GIVEREF(__pyx_tuple__843); - - /* "talib/stream.pyx":5835 - * double outmacdhist - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__844 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__844)) __PYX_ERR(0, 5835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__844); - __Pyx_GIVEREF(__pyx_tuple__844); - - /* "talib/stream.pyx":5837 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__845 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__845)) __PYX_ERR(0, 5837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__845); - __Pyx_GIVEREF(__pyx_tuple__845); - - /* "talib/stream.pyx":5876 - * double outfama - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__846 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__846)) __PYX_ERR(0, 5876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__846); - __Pyx_GIVEREF(__pyx_tuple__846); - - /* "talib/stream.pyx":5878 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__847 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__847)) __PYX_ERR(0, 5878, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__847); - __Pyx_GIVEREF(__pyx_tuple__847); - - /* "talib/stream.pyx":5917 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__848 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__848)) __PYX_ERR(0, 5917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__848); - __Pyx_GIVEREF(__pyx_tuple__848); - - /* "talib/stream.pyx":5919 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__849 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__849)) __PYX_ERR(0, 5919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__849); - __Pyx_GIVEREF(__pyx_tuple__849); - - /* "talib/stream.pyx":5924 - * real_data = real.data - * if PyArray_TYPE(periods) != np.NPY_DOUBLE: - * raise Exception("periods is not double") # <<<<<<<<<<<<<< - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") - */ - __pyx_tuple__850 = PyTuple_Pack(1, __pyx_kp_s_periods_is_not_double); if (unlikely(!__pyx_tuple__850)) __PYX_ERR(0, 5924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__850); - __Pyx_GIVEREF(__pyx_tuple__850); - - /* "talib/stream.pyx":5926 - * raise Exception("periods is not double") - * if periods.ndim != 1: - * raise Exception("periods has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(periods) & np.NPY_C_CONTIGUOUS): - * periods = PyArray_GETCONTIGUOUS(periods) - */ - __pyx_tuple__851 = PyTuple_Pack(1, __pyx_kp_s_periods_has_wrong_dimensions); if (unlikely(!__pyx_tuple__851)) __PYX_ERR(0, 5926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__851); - __Pyx_GIVEREF(__pyx_tuple__851); - - /* "talib/stream.pyx":5932 - * length = real.shape[0] - * if length != periods.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MAVP( length - 1 , length - 1 , real_data , periods_data , minperiod , maxperiod , matype , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__852 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__852)) __PYX_ERR(0, 5932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__852); - __Pyx_GIVEREF(__pyx_tuple__852); - - /* "talib/stream.pyx":5962 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__853 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__853)) __PYX_ERR(0, 5962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__853); - __Pyx_GIVEREF(__pyx_tuple__853); - - /* "talib/stream.pyx":5964 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__854 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__854)) __PYX_ERR(0, 5964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__854); - __Pyx_GIVEREF(__pyx_tuple__854); - - /* "talib/stream.pyx":5998 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__855 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__855)) __PYX_ERR(0, 5998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__855); - __Pyx_GIVEREF(__pyx_tuple__855); - - /* "talib/stream.pyx":6000 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__856 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__856)) __PYX_ERR(0, 6000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__856); - __Pyx_GIVEREF(__pyx_tuple__856); - - /* "talib/stream.pyx":6033 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__857 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__857)) __PYX_ERR(0, 6033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__857); - __Pyx_GIVEREF(__pyx_tuple__857); - - /* "talib/stream.pyx":6035 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__858 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__858)) __PYX_ERR(0, 6035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__858); - __Pyx_GIVEREF(__pyx_tuple__858); - - /* "talib/stream.pyx":6040 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__859 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__859)) __PYX_ERR(0, 6040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__859); - __Pyx_GIVEREF(__pyx_tuple__859); - - /* "talib/stream.pyx":6042 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__860 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__860)) __PYX_ERR(0, 6042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__860); - __Pyx_GIVEREF(__pyx_tuple__860); - - /* "talib/stream.pyx":6048 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MEDPRICE( length - 1 , length - 1 , high_data , low_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__861 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__861)) __PYX_ERR(0, 6048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__861); - __Pyx_GIVEREF(__pyx_tuple__861); - - /* "talib/stream.pyx":6081 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__862 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__862)) __PYX_ERR(0, 6081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__862); - __Pyx_GIVEREF(__pyx_tuple__862); - - /* "talib/stream.pyx":6083 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__863 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__863)) __PYX_ERR(0, 6083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__863); - __Pyx_GIVEREF(__pyx_tuple__863); - - /* "talib/stream.pyx":6088 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__864 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__864)) __PYX_ERR(0, 6088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__864); - __Pyx_GIVEREF(__pyx_tuple__864); - - /* "talib/stream.pyx":6090 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__865 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__865)) __PYX_ERR(0, 6090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__865); - __Pyx_GIVEREF(__pyx_tuple__865); - - /* "talib/stream.pyx":6095 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__866 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__866)) __PYX_ERR(0, 6095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__866); - __Pyx_GIVEREF(__pyx_tuple__866); - - /* "talib/stream.pyx":6097 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__867 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__867)) __PYX_ERR(0, 6097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__867); - __Pyx_GIVEREF(__pyx_tuple__867); - - /* "talib/stream.pyx":6102 - * close_data = close.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__868 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__868)) __PYX_ERR(0, 6102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__868); - __Pyx_GIVEREF(__pyx_tuple__868); - - /* "talib/stream.pyx":6104 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__869 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__869)) __PYX_ERR(0, 6104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__869); - __Pyx_GIVEREF(__pyx_tuple__869); - - /* "talib/stream.pyx":6110 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__870 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__870)) __PYX_ERR(0, 6110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__870); - __Pyx_GIVEREF(__pyx_tuple__870); - - /* "talib/stream.pyx":6112 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != volume.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__871 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__871)) __PYX_ERR(0, 6112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__871); - __Pyx_GIVEREF(__pyx_tuple__871); - - /* "talib/stream.pyx":6114 - * raise Exception("input lengths are different") - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MFI( length - 1 , length - 1 , high_data , low_data , close_data , volume_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__872 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__872)) __PYX_ERR(0, 6114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__872); - __Pyx_GIVEREF(__pyx_tuple__872); - - /* "talib/stream.pyx":6144 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__873 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__873)) __PYX_ERR(0, 6144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__873); - __Pyx_GIVEREF(__pyx_tuple__873); - - /* "talib/stream.pyx":6146 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__874 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__874)) __PYX_ERR(0, 6146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__874); - __Pyx_GIVEREF(__pyx_tuple__874); - - /* "talib/stream.pyx":6181 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__875 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__875)) __PYX_ERR(0, 6181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__875); - __Pyx_GIVEREF(__pyx_tuple__875); - - /* "talib/stream.pyx":6183 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__876 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__876)) __PYX_ERR(0, 6183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__876); - __Pyx_GIVEREF(__pyx_tuple__876); - - /* "talib/stream.pyx":6188 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__877 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__877)) __PYX_ERR(0, 6188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__877); - __Pyx_GIVEREF(__pyx_tuple__877); - - /* "talib/stream.pyx":6190 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__878 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__878)) __PYX_ERR(0, 6190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__878); - __Pyx_GIVEREF(__pyx_tuple__878); - - /* "talib/stream.pyx":6196 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MIDPRICE( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__879 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__879)) __PYX_ERR(0, 6196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__879); - __Pyx_GIVEREF(__pyx_tuple__879); - - /* "talib/stream.pyx":6226 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__880 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__880)) __PYX_ERR(0, 6226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__880); - __Pyx_GIVEREF(__pyx_tuple__880); - - /* "talib/stream.pyx":6228 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__881 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__881)) __PYX_ERR(0, 6228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__881); - __Pyx_GIVEREF(__pyx_tuple__881); - - /* "talib/stream.pyx":6262 - * int outinteger - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__882 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__882)) __PYX_ERR(0, 6262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__882); - __Pyx_GIVEREF(__pyx_tuple__882); - - /* "talib/stream.pyx":6264 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__883 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__883)) __PYX_ERR(0, 6264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__883); - __Pyx_GIVEREF(__pyx_tuple__883); - - /* "talib/stream.pyx":6300 - * double outmax - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__884 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__884)) __PYX_ERR(0, 6300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__884); - __Pyx_GIVEREF(__pyx_tuple__884); - - /* "talib/stream.pyx":6302 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__885 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__885)) __PYX_ERR(0, 6302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__885); - __Pyx_GIVEREF(__pyx_tuple__885); - - /* "talib/stream.pyx":6339 - * int outmaxidx - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__886 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__886)) __PYX_ERR(0, 6339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__886); - __Pyx_GIVEREF(__pyx_tuple__886); - - /* "talib/stream.pyx":6341 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__887 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__887)) __PYX_ERR(0, 6341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__887); - __Pyx_GIVEREF(__pyx_tuple__887); - - /* "talib/stream.pyx":6378 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__888 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__888)) __PYX_ERR(0, 6378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__888); - __Pyx_GIVEREF(__pyx_tuple__888); - - /* "talib/stream.pyx":6380 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__889 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__889)) __PYX_ERR(0, 6380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__889); - __Pyx_GIVEREF(__pyx_tuple__889); - - /* "talib/stream.pyx":6385 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__890 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__890)) __PYX_ERR(0, 6385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__890); - __Pyx_GIVEREF(__pyx_tuple__890); - - /* "talib/stream.pyx":6387 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__891 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__891)) __PYX_ERR(0, 6387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__891); - __Pyx_GIVEREF(__pyx_tuple__891); - - /* "talib/stream.pyx":6392 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__892 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__892)) __PYX_ERR(0, 6392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__892); - __Pyx_GIVEREF(__pyx_tuple__892); - - /* "talib/stream.pyx":6394 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__893 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__893)) __PYX_ERR(0, 6394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__893); - __Pyx_GIVEREF(__pyx_tuple__893); - - /* "talib/stream.pyx":6400 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__894 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__894)) __PYX_ERR(0, 6400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__894); - __Pyx_GIVEREF(__pyx_tuple__894); - - /* "talib/stream.pyx":6402 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MINUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__895 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__895)) __PYX_ERR(0, 6402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__895); - __Pyx_GIVEREF(__pyx_tuple__895); - - /* "talib/stream.pyx":6433 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__896 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__896)) __PYX_ERR(0, 6433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__896); - __Pyx_GIVEREF(__pyx_tuple__896); - - /* "talib/stream.pyx":6435 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__897 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__897)) __PYX_ERR(0, 6435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__897); - __Pyx_GIVEREF(__pyx_tuple__897); - - /* "talib/stream.pyx":6440 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__898 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__898)) __PYX_ERR(0, 6440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__898); - __Pyx_GIVEREF(__pyx_tuple__898); - - /* "talib/stream.pyx":6442 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__899 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__899)) __PYX_ERR(0, 6442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__899); - __Pyx_GIVEREF(__pyx_tuple__899); - - /* "talib/stream.pyx":6448 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MINUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__900 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__900)) __PYX_ERR(0, 6448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__900); - __Pyx_GIVEREF(__pyx_tuple__900); - - /* "talib/stream.pyx":6478 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__901 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__901)) __PYX_ERR(0, 6478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__901); - __Pyx_GIVEREF(__pyx_tuple__901); - - /* "talib/stream.pyx":6480 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__902 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__902)) __PYX_ERR(0, 6480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__902); - __Pyx_GIVEREF(__pyx_tuple__902); - - /* "talib/stream.pyx":6514 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__903 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__903)) __PYX_ERR(0, 6514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__903); - __Pyx_GIVEREF(__pyx_tuple__903); - - /* "talib/stream.pyx":6516 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__904 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__904)) __PYX_ERR(0, 6516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__904); - __Pyx_GIVEREF(__pyx_tuple__904); - - /* "talib/stream.pyx":6521 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__905 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__905)) __PYX_ERR(0, 6521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__905); - __Pyx_GIVEREF(__pyx_tuple__905); - - /* "talib/stream.pyx":6523 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__906 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__906)) __PYX_ERR(0, 6523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__906); - __Pyx_GIVEREF(__pyx_tuple__906); - - /* "talib/stream.pyx":6529 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_MULT( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__907 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__907)) __PYX_ERR(0, 6529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__907); - __Pyx_GIVEREF(__pyx_tuple__907); - - /* "talib/stream.pyx":6561 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__908 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__908)) __PYX_ERR(0, 6561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__908); - __Pyx_GIVEREF(__pyx_tuple__908); - - /* "talib/stream.pyx":6563 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__909 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__909)) __PYX_ERR(0, 6563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__909); - __Pyx_GIVEREF(__pyx_tuple__909); - - /* "talib/stream.pyx":6568 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__910 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__910)) __PYX_ERR(0, 6568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__910); - __Pyx_GIVEREF(__pyx_tuple__910); - - /* "talib/stream.pyx":6570 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__911 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__911)) __PYX_ERR(0, 6570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__911); - __Pyx_GIVEREF(__pyx_tuple__911); - - /* "talib/stream.pyx":6575 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__912 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__912)) __PYX_ERR(0, 6575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__912); - __Pyx_GIVEREF(__pyx_tuple__912); - - /* "talib/stream.pyx":6577 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__913 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__913)) __PYX_ERR(0, 6577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__913); - __Pyx_GIVEREF(__pyx_tuple__913); - - /* "talib/stream.pyx":6583 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__914 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__914)) __PYX_ERR(0, 6583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__914); - __Pyx_GIVEREF(__pyx_tuple__914); - - /* "talib/stream.pyx":6585 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_NATR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__915 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__915)) __PYX_ERR(0, 6585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__915); - __Pyx_GIVEREF(__pyx_tuple__915); - - /* "talib/stream.pyx":6615 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__916 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__916)) __PYX_ERR(0, 6615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__916); - __Pyx_GIVEREF(__pyx_tuple__916); - - /* "talib/stream.pyx":6617 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__917 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__917)) __PYX_ERR(0, 6617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__917); - __Pyx_GIVEREF(__pyx_tuple__917); - - /* "talib/stream.pyx":6622 - * real_data = real.data - * if PyArray_TYPE(volume) != np.NPY_DOUBLE: - * raise Exception("volume is not double") # <<<<<<<<<<<<<< - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") - */ - __pyx_tuple__918 = PyTuple_Pack(1, __pyx_kp_s_volume_is_not_double); if (unlikely(!__pyx_tuple__918)) __PYX_ERR(0, 6622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__918); - __Pyx_GIVEREF(__pyx_tuple__918); - - /* "talib/stream.pyx":6624 - * raise Exception("volume is not double") - * if volume.ndim != 1: - * raise Exception("volume has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(volume) & np.NPY_C_CONTIGUOUS): - * volume = PyArray_GETCONTIGUOUS(volume) - */ - __pyx_tuple__919 = PyTuple_Pack(1, __pyx_kp_s_volume_has_wrong_dimensions); if (unlikely(!__pyx_tuple__919)) __PYX_ERR(0, 6624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__919); - __Pyx_GIVEREF(__pyx_tuple__919); - - /* "talib/stream.pyx":6630 - * length = real.shape[0] - * if length != volume.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_OBV( length - 1 , length - 1 , real_data , volume_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__920 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__920)) __PYX_ERR(0, 6630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__920); - __Pyx_GIVEREF(__pyx_tuple__920); - - /* "talib/stream.pyx":6662 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__921 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__921)) __PYX_ERR(0, 6662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__921); - __Pyx_GIVEREF(__pyx_tuple__921); - - /* "talib/stream.pyx":6664 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__922 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__922)) __PYX_ERR(0, 6664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__922); - __Pyx_GIVEREF(__pyx_tuple__922); - - /* "talib/stream.pyx":6669 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__923 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__923)) __PYX_ERR(0, 6669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__923); - __Pyx_GIVEREF(__pyx_tuple__923); - - /* "talib/stream.pyx":6671 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__924 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__924)) __PYX_ERR(0, 6671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__924); - __Pyx_GIVEREF(__pyx_tuple__924); - - /* "talib/stream.pyx":6676 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__925 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__925)) __PYX_ERR(0, 6676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__925); - __Pyx_GIVEREF(__pyx_tuple__925); - - /* "talib/stream.pyx":6678 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__926 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__926)) __PYX_ERR(0, 6678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__926); - __Pyx_GIVEREF(__pyx_tuple__926); - - /* "talib/stream.pyx":6684 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__927 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__927)) __PYX_ERR(0, 6684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__927); - __Pyx_GIVEREF(__pyx_tuple__927); - - /* "talib/stream.pyx":6686 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_PLUS_DI( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__928 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__928)) __PYX_ERR(0, 6686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__928); - __Pyx_GIVEREF(__pyx_tuple__928); - - /* "talib/stream.pyx":6717 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__929 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__929)) __PYX_ERR(0, 6717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__929); - __Pyx_GIVEREF(__pyx_tuple__929); - - /* "talib/stream.pyx":6719 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__930 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__930)) __PYX_ERR(0, 6719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__930); - __Pyx_GIVEREF(__pyx_tuple__930); - - /* "talib/stream.pyx":6724 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__931 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__931)) __PYX_ERR(0, 6724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__931); - __Pyx_GIVEREF(__pyx_tuple__931); - - /* "talib/stream.pyx":6726 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__932 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__932)) __PYX_ERR(0, 6726, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__932); - __Pyx_GIVEREF(__pyx_tuple__932); - - /* "talib/stream.pyx":6732 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_PLUS_DM( length - 1 , length - 1 , high_data , low_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__933 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__933)) __PYX_ERR(0, 6732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__933); - __Pyx_GIVEREF(__pyx_tuple__933); - - /* "talib/stream.pyx":6764 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__934 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__934)) __PYX_ERR(0, 6764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__934); - __Pyx_GIVEREF(__pyx_tuple__934); - - /* "talib/stream.pyx":6766 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__935 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__935)) __PYX_ERR(0, 6766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__935); - __Pyx_GIVEREF(__pyx_tuple__935); - - /* "talib/stream.pyx":6800 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__936 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__936)) __PYX_ERR(0, 6800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__936); - __Pyx_GIVEREF(__pyx_tuple__936); - - /* "talib/stream.pyx":6802 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__937 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__937)) __PYX_ERR(0, 6802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__937); - __Pyx_GIVEREF(__pyx_tuple__937); - - /* "talib/stream.pyx":6836 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__938 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__938)) __PYX_ERR(0, 6836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__938); - __Pyx_GIVEREF(__pyx_tuple__938); - - /* "talib/stream.pyx":6838 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__939 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__939)) __PYX_ERR(0, 6838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__939); - __Pyx_GIVEREF(__pyx_tuple__939); - - /* "talib/stream.pyx":6872 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__940 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__940)) __PYX_ERR(0, 6872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__940); - __Pyx_GIVEREF(__pyx_tuple__940); - - /* "talib/stream.pyx":6874 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__941 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__941)) __PYX_ERR(0, 6874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__941); - __Pyx_GIVEREF(__pyx_tuple__941); - - /* "talib/stream.pyx":6908 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__942 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__942)) __PYX_ERR(0, 6908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__942); - __Pyx_GIVEREF(__pyx_tuple__942); - - /* "talib/stream.pyx":6910 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__943 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__943)) __PYX_ERR(0, 6910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__943); - __Pyx_GIVEREF(__pyx_tuple__943); - - /* "talib/stream.pyx":6944 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__944 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__944)) __PYX_ERR(0, 6944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__944); - __Pyx_GIVEREF(__pyx_tuple__944); - - /* "talib/stream.pyx":6946 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__945 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__945)) __PYX_ERR(0, 6946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__945); - __Pyx_GIVEREF(__pyx_tuple__945); - - /* "talib/stream.pyx":6982 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__946 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__946)) __PYX_ERR(0, 6982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__946); - __Pyx_GIVEREF(__pyx_tuple__946); - - /* "talib/stream.pyx":6984 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__947 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__947)) __PYX_ERR(0, 6984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__947); - __Pyx_GIVEREF(__pyx_tuple__947); - - /* "talib/stream.pyx":6989 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__948 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__948)) __PYX_ERR(0, 6989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__948); - __Pyx_GIVEREF(__pyx_tuple__948); - - /* "talib/stream.pyx":6991 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__949 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__949)) __PYX_ERR(0, 6991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__949); - __Pyx_GIVEREF(__pyx_tuple__949); - - /* "talib/stream.pyx":6997 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SAR( length - 1 , length - 1 , high_data , low_data , acceleration , maximum , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__950 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__950)) __PYX_ERR(0, 6997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__950); - __Pyx_GIVEREF(__pyx_tuple__950); - - /* "talib/stream.pyx":7035 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__951 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__951)) __PYX_ERR(0, 7035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__951); - __Pyx_GIVEREF(__pyx_tuple__951); - - /* "talib/stream.pyx":7037 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__952 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__952)) __PYX_ERR(0, 7037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__952); - __Pyx_GIVEREF(__pyx_tuple__952); - - /* "talib/stream.pyx":7042 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__953 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__953)) __PYX_ERR(0, 7042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__953); - __Pyx_GIVEREF(__pyx_tuple__953); - - /* "talib/stream.pyx":7044 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__954 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__954)) __PYX_ERR(0, 7044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__954); - __Pyx_GIVEREF(__pyx_tuple__954); - - /* "talib/stream.pyx":7050 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SAREXT( length - 1 , length - 1 , high_data , low_data , startvalue , offsetonreverse , accelerationinitlong , accelerationlong , accelerationmaxlong , accelerationinitshort , accelerationshort , accelerationmaxshort , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__955 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__955)) __PYX_ERR(0, 7050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__955); - __Pyx_GIVEREF(__pyx_tuple__955); - - /* "talib/stream.pyx":7078 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__956 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__956)) __PYX_ERR(0, 7078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__956); - __Pyx_GIVEREF(__pyx_tuple__956); - - /* "talib/stream.pyx":7080 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__957 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__957)) __PYX_ERR(0, 7080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__957); - __Pyx_GIVEREF(__pyx_tuple__957); - - /* "talib/stream.pyx":7112 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__958 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__958)) __PYX_ERR(0, 7112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__958); - __Pyx_GIVEREF(__pyx_tuple__958); - - /* "talib/stream.pyx":7114 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__959 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__959)) __PYX_ERR(0, 7114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__959); - __Pyx_GIVEREF(__pyx_tuple__959); - - /* "talib/stream.pyx":7148 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__960 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__960)) __PYX_ERR(0, 7148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__960); - __Pyx_GIVEREF(__pyx_tuple__960); - - /* "talib/stream.pyx":7150 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__961 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__961)) __PYX_ERR(0, 7150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__961); - __Pyx_GIVEREF(__pyx_tuple__961); - - /* "talib/stream.pyx":7182 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__962 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__962)) __PYX_ERR(0, 7182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__962); - __Pyx_GIVEREF(__pyx_tuple__962); - - /* "talib/stream.pyx":7184 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__963 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__963)) __PYX_ERR(0, 7184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__963); - __Pyx_GIVEREF(__pyx_tuple__963); - - /* "talib/stream.pyx":7219 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__964 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__964)) __PYX_ERR(0, 7219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__964); - __Pyx_GIVEREF(__pyx_tuple__964); - - /* "talib/stream.pyx":7221 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__965 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__965)) __PYX_ERR(0, 7221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__965); - __Pyx_GIVEREF(__pyx_tuple__965); - - /* "talib/stream.pyx":7263 - * double outslowd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__966 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__966)) __PYX_ERR(0, 7263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__966); - __Pyx_GIVEREF(__pyx_tuple__966); - - /* "talib/stream.pyx":7265 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__967 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__967)) __PYX_ERR(0, 7265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__967); - __Pyx_GIVEREF(__pyx_tuple__967); - - /* "talib/stream.pyx":7270 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__968 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__968)) __PYX_ERR(0, 7270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__968); - __Pyx_GIVEREF(__pyx_tuple__968); - - /* "talib/stream.pyx":7272 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__969 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__969)) __PYX_ERR(0, 7272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__969); - __Pyx_GIVEREF(__pyx_tuple__969); - - /* "talib/stream.pyx":7277 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__970 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__970)) __PYX_ERR(0, 7277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__970); - __Pyx_GIVEREF(__pyx_tuple__970); - - /* "talib/stream.pyx":7279 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__971 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__971)) __PYX_ERR(0, 7279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__971); - __Pyx_GIVEREF(__pyx_tuple__971); - - /* "talib/stream.pyx":7285 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__972 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__972)) __PYX_ERR(0, 7285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__972); - __Pyx_GIVEREF(__pyx_tuple__972); - - /* "talib/stream.pyx":7287 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outslowk = NaN - * outslowd = NaN - */ - __pyx_tuple__973 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__973)) __PYX_ERR(0, 7287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__973); - __Pyx_GIVEREF(__pyx_tuple__973); - - /* "talib/stream.pyx":7324 - * double outfastd - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__974 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__974)) __PYX_ERR(0, 7324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__974); - __Pyx_GIVEREF(__pyx_tuple__974); - - /* "talib/stream.pyx":7326 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__975 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__975)) __PYX_ERR(0, 7326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__975); - __Pyx_GIVEREF(__pyx_tuple__975); - - /* "talib/stream.pyx":7331 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__976 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__976)) __PYX_ERR(0, 7331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__976); - __Pyx_GIVEREF(__pyx_tuple__976); - - /* "talib/stream.pyx":7333 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__977 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__977)) __PYX_ERR(0, 7333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__977); - __Pyx_GIVEREF(__pyx_tuple__977); - - /* "talib/stream.pyx":7338 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__978 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__978)) __PYX_ERR(0, 7338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__978); - __Pyx_GIVEREF(__pyx_tuple__978); - - /* "talib/stream.pyx":7340 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__979 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__979)) __PYX_ERR(0, 7340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__979); - __Pyx_GIVEREF(__pyx_tuple__979); - - /* "talib/stream.pyx":7346 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__980 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__980)) __PYX_ERR(0, 7346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__980); - __Pyx_GIVEREF(__pyx_tuple__980); - - /* "talib/stream.pyx":7348 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outfastk = NaN - * outfastd = NaN - */ - __pyx_tuple__981 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__981)) __PYX_ERR(0, 7348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__981); - __Pyx_GIVEREF(__pyx_tuple__981); - - /* "talib/stream.pyx":7384 - * double outfastd - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__982 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__982)) __PYX_ERR(0, 7384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__982); - __Pyx_GIVEREF(__pyx_tuple__982); - - /* "talib/stream.pyx":7386 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__983 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__983)) __PYX_ERR(0, 7386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__983); - __Pyx_GIVEREF(__pyx_tuple__983); - - /* "talib/stream.pyx":7421 - * double outreal - * if PyArray_TYPE(real0) != np.NPY_DOUBLE: - * raise Exception("real0 is not double") # <<<<<<<<<<<<<< - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") - */ - __pyx_tuple__984 = PyTuple_Pack(1, __pyx_kp_s_real0_is_not_double); if (unlikely(!__pyx_tuple__984)) __PYX_ERR(0, 7421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__984); - __Pyx_GIVEREF(__pyx_tuple__984); - - /* "talib/stream.pyx":7423 - * raise Exception("real0 is not double") - * if real0.ndim != 1: - * raise Exception("real0 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real0) & np.NPY_C_CONTIGUOUS): - * real0 = PyArray_GETCONTIGUOUS(real0) - */ - __pyx_tuple__985 = PyTuple_Pack(1, __pyx_kp_s_real0_has_wrong_dimensions); if (unlikely(!__pyx_tuple__985)) __PYX_ERR(0, 7423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__985); - __Pyx_GIVEREF(__pyx_tuple__985); - - /* "talib/stream.pyx":7428 - * real0_data = real0.data - * if PyArray_TYPE(real1) != np.NPY_DOUBLE: - * raise Exception("real1 is not double") # <<<<<<<<<<<<<< - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") - */ - __pyx_tuple__986 = PyTuple_Pack(1, __pyx_kp_s_real1_is_not_double); if (unlikely(!__pyx_tuple__986)) __PYX_ERR(0, 7428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__986); - __Pyx_GIVEREF(__pyx_tuple__986); - - /* "talib/stream.pyx":7430 - * raise Exception("real1 is not double") - * if real1.ndim != 1: - * raise Exception("real1 has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real1) & np.NPY_C_CONTIGUOUS): - * real1 = PyArray_GETCONTIGUOUS(real1) - */ - __pyx_tuple__987 = PyTuple_Pack(1, __pyx_kp_s_real1_has_wrong_dimensions); if (unlikely(!__pyx_tuple__987)) __PYX_ERR(0, 7430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__987); - __Pyx_GIVEREF(__pyx_tuple__987); - - /* "talib/stream.pyx":7436 - * length = real0.shape[0] - * if length != real1.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_SUB( length - 1 , length - 1 , real0_data , real1_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__988 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__988)) __PYX_ERR(0, 7436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__988); - __Pyx_GIVEREF(__pyx_tuple__988); - - /* "talib/stream.pyx":7466 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__989 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__989)) __PYX_ERR(0, 7466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__989); - __Pyx_GIVEREF(__pyx_tuple__989); - - /* "talib/stream.pyx":7468 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__990 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__990)) __PYX_ERR(0, 7468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__990); - __Pyx_GIVEREF(__pyx_tuple__990); - - /* "talib/stream.pyx":7503 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__991 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__991)) __PYX_ERR(0, 7503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__991); - __Pyx_GIVEREF(__pyx_tuple__991); - - /* "talib/stream.pyx":7505 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__992 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__992)) __PYX_ERR(0, 7505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__992); - __Pyx_GIVEREF(__pyx_tuple__992); - - /* "talib/stream.pyx":7537 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__993 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__993)) __PYX_ERR(0, 7537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__993); - __Pyx_GIVEREF(__pyx_tuple__993); - - /* "talib/stream.pyx":7539 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__994 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__994)) __PYX_ERR(0, 7539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__994); - __Pyx_GIVEREF(__pyx_tuple__994); - - /* "talib/stream.pyx":7571 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__995 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__995)) __PYX_ERR(0, 7571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__995); - __Pyx_GIVEREF(__pyx_tuple__995); - - /* "talib/stream.pyx":7573 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__996 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__996)) __PYX_ERR(0, 7573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__996); - __Pyx_GIVEREF(__pyx_tuple__996); - - /* "talib/stream.pyx":7607 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__997 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__997)) __PYX_ERR(0, 7607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__997); - __Pyx_GIVEREF(__pyx_tuple__997); - - /* "talib/stream.pyx":7609 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__998 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__998)) __PYX_ERR(0, 7609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__998); - __Pyx_GIVEREF(__pyx_tuple__998); - - /* "talib/stream.pyx":7643 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__999 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__999)) __PYX_ERR(0, 7643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__999); - __Pyx_GIVEREF(__pyx_tuple__999); - - /* "talib/stream.pyx":7645 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1000 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1000)) __PYX_ERR(0, 7645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1000); - __Pyx_GIVEREF(__pyx_tuple__1000); - - /* "talib/stream.pyx":7650 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1001 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1001)) __PYX_ERR(0, 7650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1001); - __Pyx_GIVEREF(__pyx_tuple__1001); - - /* "talib/stream.pyx":7652 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1002 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1002)) __PYX_ERR(0, 7652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1002); - __Pyx_GIVEREF(__pyx_tuple__1002); - - /* "talib/stream.pyx":7657 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1003 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1003)) __PYX_ERR(0, 7657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1003); - __Pyx_GIVEREF(__pyx_tuple__1003); - - /* "talib/stream.pyx":7659 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1004 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1004)) __PYX_ERR(0, 7659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1004); - __Pyx_GIVEREF(__pyx_tuple__1004); - - /* "talib/stream.pyx":7665 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1005 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1005)) __PYX_ERR(0, 7665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1005); - __Pyx_GIVEREF(__pyx_tuple__1005); - - /* "talib/stream.pyx":7667 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TRANGE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__1006 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1006)) __PYX_ERR(0, 7667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1006); - __Pyx_GIVEREF(__pyx_tuple__1006); - - /* "talib/stream.pyx":7697 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1007 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1007)) __PYX_ERR(0, 7697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1007); - __Pyx_GIVEREF(__pyx_tuple__1007); - - /* "talib/stream.pyx":7699 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1008 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1008)) __PYX_ERR(0, 7699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1008); - __Pyx_GIVEREF(__pyx_tuple__1008); - - /* "talib/stream.pyx":7733 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1009 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1009)) __PYX_ERR(0, 7733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1009); - __Pyx_GIVEREF(__pyx_tuple__1009); - - /* "talib/stream.pyx":7735 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1010 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1010)) __PYX_ERR(0, 7735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1010); - __Pyx_GIVEREF(__pyx_tuple__1010); - - /* "talib/stream.pyx":7769 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1011 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1011)) __PYX_ERR(0, 7769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1011); - __Pyx_GIVEREF(__pyx_tuple__1011); - - /* "talib/stream.pyx":7771 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1012 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1012)) __PYX_ERR(0, 7771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1012); - __Pyx_GIVEREF(__pyx_tuple__1012); - - /* "talib/stream.pyx":7805 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1013 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1013)) __PYX_ERR(0, 7805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1013); - __Pyx_GIVEREF(__pyx_tuple__1013); - - /* "talib/stream.pyx":7807 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1014 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1014)) __PYX_ERR(0, 7807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1014); - __Pyx_GIVEREF(__pyx_tuple__1014); - - /* "talib/stream.pyx":7812 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1015 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1015)) __PYX_ERR(0, 7812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1015); - __Pyx_GIVEREF(__pyx_tuple__1015); - - /* "talib/stream.pyx":7814 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1016 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1016)) __PYX_ERR(0, 7814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1016); - __Pyx_GIVEREF(__pyx_tuple__1016); - - /* "talib/stream.pyx":7819 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1017 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1017)) __PYX_ERR(0, 7819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1017); - __Pyx_GIVEREF(__pyx_tuple__1017); - - /* "talib/stream.pyx":7821 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1018 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1018)) __PYX_ERR(0, 7821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1018); - __Pyx_GIVEREF(__pyx_tuple__1018); - - /* "talib/stream.pyx":7827 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1019 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1019)) __PYX_ERR(0, 7827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1019); - __Pyx_GIVEREF(__pyx_tuple__1019); - - /* "talib/stream.pyx":7829 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_TYPPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__1020 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1020)) __PYX_ERR(0, 7829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1020); - __Pyx_GIVEREF(__pyx_tuple__1020); - - /* "talib/stream.pyx":7863 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1021 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1021)) __PYX_ERR(0, 7863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1021); - __Pyx_GIVEREF(__pyx_tuple__1021); - - /* "talib/stream.pyx":7865 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1022 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1022)) __PYX_ERR(0, 7865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1022); - __Pyx_GIVEREF(__pyx_tuple__1022); - - /* "talib/stream.pyx":7870 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1023 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1023)) __PYX_ERR(0, 7870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1023); - __Pyx_GIVEREF(__pyx_tuple__1023); - - /* "talib/stream.pyx":7872 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1024 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1024)) __PYX_ERR(0, 7872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1024); - __Pyx_GIVEREF(__pyx_tuple__1024); - - /* "talib/stream.pyx":7877 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1025 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1025)) __PYX_ERR(0, 7877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1025); - __Pyx_GIVEREF(__pyx_tuple__1025); - - /* "talib/stream.pyx":7879 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1026 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1026)) __PYX_ERR(0, 7879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1026); - __Pyx_GIVEREF(__pyx_tuple__1026); - - /* "talib/stream.pyx":7885 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1027 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1027)) __PYX_ERR(0, 7885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1027); - __Pyx_GIVEREF(__pyx_tuple__1027); - - /* "talib/stream.pyx":7887 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_ULTOSC( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod1 , timeperiod2 , timeperiod3 , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__1028 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1028)) __PYX_ERR(0, 7887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1028); - __Pyx_GIVEREF(__pyx_tuple__1028); - - /* "talib/stream.pyx":7918 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1029 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1029)) __PYX_ERR(0, 7918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1029); - __Pyx_GIVEREF(__pyx_tuple__1029); - - /* "talib/stream.pyx":7920 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1030 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1030)) __PYX_ERR(0, 7920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1030); - __Pyx_GIVEREF(__pyx_tuple__1030); - - /* "talib/stream.pyx":7954 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1031 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1031)) __PYX_ERR(0, 7954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1031); - __Pyx_GIVEREF(__pyx_tuple__1031); - - /* "talib/stream.pyx":7956 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1032 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1032)) __PYX_ERR(0, 7956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1032); - __Pyx_GIVEREF(__pyx_tuple__1032); - - /* "talib/stream.pyx":7961 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1033 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1033)) __PYX_ERR(0, 7961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1033); - __Pyx_GIVEREF(__pyx_tuple__1033); - - /* "talib/stream.pyx":7963 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1034 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1034)) __PYX_ERR(0, 7963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1034); - __Pyx_GIVEREF(__pyx_tuple__1034); - - /* "talib/stream.pyx":7968 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1035 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1035)) __PYX_ERR(0, 7968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1035); - __Pyx_GIVEREF(__pyx_tuple__1035); - - /* "talib/stream.pyx":7970 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1036 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1036)) __PYX_ERR(0, 7970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1036); - __Pyx_GIVEREF(__pyx_tuple__1036); - - /* "talib/stream.pyx":7976 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1037 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1037)) __PYX_ERR(0, 7976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1037); - __Pyx_GIVEREF(__pyx_tuple__1037); - - /* "talib/stream.pyx":7978 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_WCLPRICE( length - 1 , length - 1 , high_data , low_data , close_data , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__1038 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1038)) __PYX_ERR(0, 7978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1038); - __Pyx_GIVEREF(__pyx_tuple__1038); - - /* "talib/stream.pyx":8010 - * double outreal - * if PyArray_TYPE(high) != np.NPY_DOUBLE: - * raise Exception("high is not double") # <<<<<<<<<<<<<< - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") - */ - __pyx_tuple__1039 = PyTuple_Pack(1, __pyx_kp_s_high_is_not_double); if (unlikely(!__pyx_tuple__1039)) __PYX_ERR(0, 8010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1039); - __Pyx_GIVEREF(__pyx_tuple__1039); - - /* "talib/stream.pyx":8012 - * raise Exception("high is not double") - * if high.ndim != 1: - * raise Exception("high has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(high) & np.NPY_C_CONTIGUOUS): - * high = PyArray_GETCONTIGUOUS(high) - */ - __pyx_tuple__1040 = PyTuple_Pack(1, __pyx_kp_s_high_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1040)) __PYX_ERR(0, 8012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1040); - __Pyx_GIVEREF(__pyx_tuple__1040); - - /* "talib/stream.pyx":8017 - * high_data = high.data - * if PyArray_TYPE(low) != np.NPY_DOUBLE: - * raise Exception("low is not double") # <<<<<<<<<<<<<< - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") - */ - __pyx_tuple__1041 = PyTuple_Pack(1, __pyx_kp_s_low_is_not_double); if (unlikely(!__pyx_tuple__1041)) __PYX_ERR(0, 8017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1041); - __Pyx_GIVEREF(__pyx_tuple__1041); - - /* "talib/stream.pyx":8019 - * raise Exception("low is not double") - * if low.ndim != 1: - * raise Exception("low has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(low) & np.NPY_C_CONTIGUOUS): - * low = PyArray_GETCONTIGUOUS(low) - */ - __pyx_tuple__1042 = PyTuple_Pack(1, __pyx_kp_s_low_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1042)) __PYX_ERR(0, 8019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1042); - __Pyx_GIVEREF(__pyx_tuple__1042); - - /* "talib/stream.pyx":8024 - * low_data = low.data - * if PyArray_TYPE(close) != np.NPY_DOUBLE: - * raise Exception("close is not double") # <<<<<<<<<<<<<< - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") - */ - __pyx_tuple__1043 = PyTuple_Pack(1, __pyx_kp_s_close_is_not_double); if (unlikely(!__pyx_tuple__1043)) __PYX_ERR(0, 8024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1043); - __Pyx_GIVEREF(__pyx_tuple__1043); - - /* "talib/stream.pyx":8026 - * raise Exception("close is not double") - * if close.ndim != 1: - * raise Exception("close has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(close) & np.NPY_C_CONTIGUOUS): - * close = PyArray_GETCONTIGUOUS(close) - */ - __pyx_tuple__1044 = PyTuple_Pack(1, __pyx_kp_s_close_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1044)) __PYX_ERR(0, 8026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1044); - __Pyx_GIVEREF(__pyx_tuple__1044); - - /* "talib/stream.pyx":8032 - * length = high.shape[0] - * if length != low.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * if length != close.shape[0]: - * raise Exception("input lengths are different") - */ - __pyx_tuple__1045 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1045)) __PYX_ERR(0, 8032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1045); - __Pyx_GIVEREF(__pyx_tuple__1045); - - /* "talib/stream.pyx":8034 - * raise Exception("input lengths are different") - * if length != close.shape[0]: - * raise Exception("input lengths are different") # <<<<<<<<<<<<<< - * outreal = NaN - * retCode = lib.TA_WILLR( length - 1 , length - 1 , high_data , low_data , close_data , timeperiod , &outbegidx , &outnbelement , &outreal ) - */ - __pyx_tuple__1046 = PyTuple_Pack(1, __pyx_kp_s_input_lengths_are_different); if (unlikely(!__pyx_tuple__1046)) __PYX_ERR(0, 8034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1046); - __Pyx_GIVEREF(__pyx_tuple__1046); - - /* "talib/stream.pyx":8064 - * double outreal - * if PyArray_TYPE(real) != np.NPY_DOUBLE: - * raise Exception("real is not double") # <<<<<<<<<<<<<< - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") - */ - __pyx_tuple__1047 = PyTuple_Pack(1, __pyx_kp_s_real_is_not_double); if (unlikely(!__pyx_tuple__1047)) __PYX_ERR(0, 8064, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1047); - __Pyx_GIVEREF(__pyx_tuple__1047); - - /* "talib/stream.pyx":8066 - * raise Exception("real is not double") - * if real.ndim != 1: - * raise Exception("real has wrong dimensions") # <<<<<<<<<<<<<< - * if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): - * real = PyArray_GETCONTIGUOUS(real) - */ - __pyx_tuple__1048 = PyTuple_Pack(1, __pyx_kp_s_real_has_wrong_dimensions); if (unlikely(!__pyx_tuple__1048)) __PYX_ERR(0, 8066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1048); - __Pyx_GIVEREF(__pyx_tuple__1048); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple__1049 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__1049)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1049); - __Pyx_GIVEREF(__pyx_tuple__1049); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__1050 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__1050)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1050); - __Pyx_GIVEREF(__pyx_tuple__1050); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__1051 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__1051)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1051); - __Pyx_GIVEREF(__pyx_tuple__1051); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_tuple__1052 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__1052)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1052); - __Pyx_GIVEREF(__pyx_tuple__1052); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__1053 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__1053)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1053); - __Pyx_GIVEREF(__pyx_tuple__1053); - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__1054 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__1054)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1054); - __Pyx_GIVEREF(__pyx_tuple__1054); - - /* "talib/stream.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - __pyx_tuple__1055 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1055)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1055); - __Pyx_GIVEREF(__pyx_tuple__1055); - __pyx_codeobj__1056 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1055, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ACOS, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1056)) __PYX_ERR(0, 24, __pyx_L1_error) - - /* "talib/stream.pyx":58 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - __pyx_tuple__1057 = PyTuple_Pack(17, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1057)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1057); - __Pyx_GIVEREF(__pyx_tuple__1057); - __pyx_codeobj__1058 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1057, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AD, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1058)) __PYX_ERR(0, 58, __pyx_L1_error) - - /* "talib/stream.pyx":122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - __pyx_tuple__1059 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1059)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1059); - __Pyx_GIVEREF(__pyx_tuple__1059); - __pyx_codeobj__1060 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1059, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADD, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1060)) __PYX_ERR(0, 122, __pyx_L1_error) - - /* "talib/stream.pyx":167 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - __pyx_tuple__1061 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1061)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1061); - __Pyx_GIVEREF(__pyx_tuple__1061); - __pyx_codeobj__1062 = (PyObject*)__Pyx_PyCode_New(6, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1061, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADOSC, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1062)) __PYX_ERR(0, 167, __pyx_L1_error) - - /* "talib/stream.pyx":234 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1063 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1063)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1063); - __Pyx_GIVEREF(__pyx_tuple__1063); - __pyx_codeobj__1064 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1063, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADX, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1064)) __PYX_ERR(0, 234, __pyx_L1_error) - - /* "talib/stream.pyx":290 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1065 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1065)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1065); - __Pyx_GIVEREF(__pyx_tuple__1065); - __pyx_codeobj__1066 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1065, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ADXR, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1066)) __PYX_ERR(0, 290, __pyx_L1_error) - - /* "talib/stream.pyx":346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_tuple__1067 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1067)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1067); - __Pyx_GIVEREF(__pyx_tuple__1067); - __pyx_codeobj__1068 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1067, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_APO, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1068)) __PYX_ERR(0, 346, __pyx_L1_error) - - /* "talib/stream.pyx":384 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1069 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outaroondown, __pyx_n_s_outaroonup); if (unlikely(!__pyx_tuple__1069)) __PYX_ERR(0, 384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1069); - __Pyx_GIVEREF(__pyx_tuple__1069); - __pyx_codeobj__1070 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1069, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AROON, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1070)) __PYX_ERR(0, 384, __pyx_L1_error) - - /* "talib/stream.pyx":433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1071 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1071)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1071); - __Pyx_GIVEREF(__pyx_tuple__1071); - __pyx_codeobj__1072 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1071, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AROONOSC, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1072)) __PYX_ERR(0, 433, __pyx_L1_error) - - /* "talib/stream.pyx":479 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - __pyx_tuple__1073 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1073)) __PYX_ERR(0, 479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1073); - __Pyx_GIVEREF(__pyx_tuple__1073); - __pyx_codeobj__1074 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1073, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ASIN, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1074)) __PYX_ERR(0, 479, __pyx_L1_error) - - /* "talib/stream.pyx":513 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - __pyx_tuple__1075 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1075)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1075); - __Pyx_GIVEREF(__pyx_tuple__1075); - __pyx_codeobj__1076 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1075, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ATAN, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1076)) __PYX_ERR(0, 513, __pyx_L1_error) - - /* "talib/stream.pyx":547 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1077 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1077)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1077); - __Pyx_GIVEREF(__pyx_tuple__1077); - __pyx_codeobj__1078 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1077, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ATR, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1078)) __PYX_ERR(0, 547, __pyx_L1_error) - - /* "talib/stream.pyx":603 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - __pyx_tuple__1079 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1079)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1079); - __Pyx_GIVEREF(__pyx_tuple__1079); - __pyx_codeobj__1080 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1079, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_AVGPRICE, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1080)) __PYX_ERR(0, 603, __pyx_L1_error) - - /* "talib/stream.pyx":667 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - __pyx_tuple__1081 = PyTuple_Pack(17, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdevup, __pyx_n_s_nbdevdn, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outrealupperband, __pyx_n_s_outrealmiddleband, __pyx_n_s_outreallowerband); if (unlikely(!__pyx_tuple__1081)) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1081); - __Pyx_GIVEREF(__pyx_tuple__1081); - __pyx_codeobj__1082 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1081, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BBANDS, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1082)) __PYX_ERR(0, 667, __pyx_L1_error) - - /* "talib/stream.pyx":712 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - __pyx_tuple__1083 = PyTuple_Pack(14, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1083)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1083); - __Pyx_GIVEREF(__pyx_tuple__1083); - __pyx_codeobj__1084 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1083, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BETA, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1084)) __PYX_ERR(0, 712, __pyx_L1_error) - - /* "talib/stream.pyx":759 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - __pyx_tuple__1085 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1085)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1085); - __Pyx_GIVEREF(__pyx_tuple__1085); - __pyx_codeobj__1086 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1085, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_BOP, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1086)) __PYX_ERR(0, 759, __pyx_L1_error) - - /* "talib/stream.pyx":823 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1087 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1087)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1087); - __Pyx_GIVEREF(__pyx_tuple__1087); - __pyx_codeobj__1088 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1087, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CCI, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1088)) __PYX_ERR(0, 823, __pyx_L1_error) - - /* "talib/stream.pyx":879 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - __pyx_tuple__1089 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1089)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1089); - __Pyx_GIVEREF(__pyx_tuple__1089); - __pyx_codeobj__1090 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1089, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL2CROWS, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1090)) __PYX_ERR(0, 879, __pyx_L1_error) - - /* "talib/stream.pyx":943 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - __pyx_tuple__1091 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1091)) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1091); - __Pyx_GIVEREF(__pyx_tuple__1091); - __pyx_codeobj__1092 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1091, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3BLACKCROWS, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1092)) __PYX_ERR(0, 943, __pyx_L1_error) - - /* "talib/stream.pyx":1007 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - __pyx_tuple__1093 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1093)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1093); - __Pyx_GIVEREF(__pyx_tuple__1093); - __pyx_codeobj__1094 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1093, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3INSIDE, 1007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1094)) __PYX_ERR(0, 1007, __pyx_L1_error) - - /* "talib/stream.pyx":1071 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - __pyx_tuple__1095 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1095)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1095); - __Pyx_GIVEREF(__pyx_tuple__1095); - __pyx_codeobj__1096 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1095, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3LINESTRIKE, 1071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1096)) __PYX_ERR(0, 1071, __pyx_L1_error) - - /* "talib/stream.pyx":1135 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - __pyx_tuple__1097 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1097)) __PYX_ERR(0, 1135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1097); - __Pyx_GIVEREF(__pyx_tuple__1097); - __pyx_codeobj__1098 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1097, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3OUTSIDE, 1135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1098)) __PYX_ERR(0, 1135, __pyx_L1_error) - - /* "talib/stream.pyx":1199 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - __pyx_tuple__1099 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1099)) __PYX_ERR(0, 1199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1099); - __Pyx_GIVEREF(__pyx_tuple__1099); - __pyx_codeobj__1100 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1099, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3STARSINSOUTH, 1199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1100)) __PYX_ERR(0, 1199, __pyx_L1_error) - - /* "talib/stream.pyx":1263 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - __pyx_tuple__1101 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1101)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1101); - __Pyx_GIVEREF(__pyx_tuple__1101); - __pyx_codeobj__1102 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDL3WHITESOLDIERS, 1263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1102)) __PYX_ERR(0, 1263, __pyx_L1_error) - - /* "talib/stream.pyx":1327 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1103 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1103)) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1103); - __Pyx_GIVEREF(__pyx_tuple__1103); - __pyx_codeobj__1104 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLABANDONEDBABY, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1104)) __PYX_ERR(0, 1327, __pyx_L1_error) - - /* "talib/stream.pyx":1393 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - __pyx_tuple__1105 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1105)) __PYX_ERR(0, 1393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1105); - __Pyx_GIVEREF(__pyx_tuple__1105); - __pyx_codeobj__1106 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLADVANCEBLOCK, 1393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1106)) __PYX_ERR(0, 1393, __pyx_L1_error) - - /* "talib/stream.pyx":1457 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - __pyx_tuple__1107 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1107)) __PYX_ERR(0, 1457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1107); - __Pyx_GIVEREF(__pyx_tuple__1107); - __pyx_codeobj__1108 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLBELTHOLD, 1457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1108)) __PYX_ERR(0, 1457, __pyx_L1_error) - - /* "talib/stream.pyx":1521 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - __pyx_tuple__1109 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1109)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1109); - __Pyx_GIVEREF(__pyx_tuple__1109); - __pyx_codeobj__1110 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLBREAKAWAY, 1521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1110)) __PYX_ERR(0, 1521, __pyx_L1_error) - - /* "talib/stream.pyx":1585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - __pyx_tuple__1111 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1111)) __PYX_ERR(0, 1585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1111); - __Pyx_GIVEREF(__pyx_tuple__1111); - __pyx_codeobj__1112 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCLOSINGMARUBOZU, 1585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1112)) __PYX_ERR(0, 1585, __pyx_L1_error) - - /* "talib/stream.pyx":1649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - __pyx_tuple__1113 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1113)) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1113); - __Pyx_GIVEREF(__pyx_tuple__1113); - __pyx_codeobj__1114 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCONCEALBABYSWALL, 1649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1114)) __PYX_ERR(0, 1649, __pyx_L1_error) - - /* "talib/stream.pyx":1713 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - __pyx_tuple__1115 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1115)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1115); - __Pyx_GIVEREF(__pyx_tuple__1115); - __pyx_codeobj__1116 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLCOUNTERATTACK, 1713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1116)) __PYX_ERR(0, 1713, __pyx_L1_error) - - /* "talib/stream.pyx":1777 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1117 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1117)) __PYX_ERR(0, 1777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1117); - __Pyx_GIVEREF(__pyx_tuple__1117); - __pyx_codeobj__1118 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDARKCLOUDCOVER, 1777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1118)) __PYX_ERR(0, 1777, __pyx_L1_error) - - /* "talib/stream.pyx":1843 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - __pyx_tuple__1119 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1119)) __PYX_ERR(0, 1843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1119); - __Pyx_GIVEREF(__pyx_tuple__1119); - __pyx_codeobj__1120 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDOJI, 1843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1120)) __PYX_ERR(0, 1843, __pyx_L1_error) - - /* "talib/stream.pyx":1907 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - __pyx_tuple__1121 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1121)) __PYX_ERR(0, 1907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1121); - __Pyx_GIVEREF(__pyx_tuple__1121); - __pyx_codeobj__1122 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDOJISTAR, 1907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1122)) __PYX_ERR(0, 1907, __pyx_L1_error) - - /* "talib/stream.pyx":1971 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - __pyx_tuple__1123 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1123)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1123); - __Pyx_GIVEREF(__pyx_tuple__1123); - __pyx_codeobj__1124 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLDRAGONFLYDOJI, 1971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1124)) __PYX_ERR(0, 1971, __pyx_L1_error) - - /* "talib/stream.pyx":2035 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - __pyx_tuple__1125 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1125)) __PYX_ERR(0, 2035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1125); - __Pyx_GIVEREF(__pyx_tuple__1125); - __pyx_codeobj__1126 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLENGULFING, 2035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1126)) __PYX_ERR(0, 2035, __pyx_L1_error) - - /* "talib/stream.pyx":2099 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1127 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1127)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1127); - __Pyx_GIVEREF(__pyx_tuple__1127); - __pyx_codeobj__1128 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLEVENINGDOJISTAR, 2099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1128)) __PYX_ERR(0, 2099, __pyx_L1_error) - - /* "talib/stream.pyx":2165 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1129 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1129)) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1129); - __Pyx_GIVEREF(__pyx_tuple__1129); - __pyx_codeobj__1130 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLEVENINGSTAR, 2165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1130)) __PYX_ERR(0, 2165, __pyx_L1_error) - - /* "talib/stream.pyx":2231 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - __pyx_tuple__1131 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1131)) __PYX_ERR(0, 2231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1131); - __Pyx_GIVEREF(__pyx_tuple__1131); - __pyx_codeobj__1132 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLGAPSIDESIDEWHITE, 2231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1132)) __PYX_ERR(0, 2231, __pyx_L1_error) - - /* "talib/stream.pyx":2295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - __pyx_tuple__1133 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1133)) __PYX_ERR(0, 2295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1133); - __Pyx_GIVEREF(__pyx_tuple__1133); - __pyx_codeobj__1134 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLGRAVESTONEDOJI, 2295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1134)) __PYX_ERR(0, 2295, __pyx_L1_error) - - /* "talib/stream.pyx":2359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - __pyx_tuple__1135 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1135)) __PYX_ERR(0, 2359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1135); - __Pyx_GIVEREF(__pyx_tuple__1135); - __pyx_codeobj__1136 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHAMMER, 2359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1136)) __PYX_ERR(0, 2359, __pyx_L1_error) - - /* "talib/stream.pyx":2423 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - __pyx_tuple__1137 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1137)) __PYX_ERR(0, 2423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1137); - __Pyx_GIVEREF(__pyx_tuple__1137); - __pyx_codeobj__1138 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHANGINGMAN, 2423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1138)) __PYX_ERR(0, 2423, __pyx_L1_error) - - /* "talib/stream.pyx":2487 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - __pyx_tuple__1139 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1139)) __PYX_ERR(0, 2487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1139); - __Pyx_GIVEREF(__pyx_tuple__1139); - __pyx_codeobj__1140 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHARAMI, 2487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1140)) __PYX_ERR(0, 2487, __pyx_L1_error) - - /* "talib/stream.pyx":2551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - __pyx_tuple__1141 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1141)) __PYX_ERR(0, 2551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1141); - __Pyx_GIVEREF(__pyx_tuple__1141); - __pyx_codeobj__1142 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHARAMICROSS, 2551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1142)) __PYX_ERR(0, 2551, __pyx_L1_error) - - /* "talib/stream.pyx":2615 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - __pyx_tuple__1143 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1143)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1143); - __Pyx_GIVEREF(__pyx_tuple__1143); - __pyx_codeobj__1144 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIGHWAVE, 2615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1144)) __PYX_ERR(0, 2615, __pyx_L1_error) - - /* "talib/stream.pyx":2679 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - __pyx_tuple__1145 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1145)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1145); - __Pyx_GIVEREF(__pyx_tuple__1145); - __pyx_codeobj__1146 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIKKAKE, 2679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1146)) __PYX_ERR(0, 2679, __pyx_L1_error) - - /* "talib/stream.pyx":2743 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - __pyx_tuple__1147 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1147)) __PYX_ERR(0, 2743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1147); - __Pyx_GIVEREF(__pyx_tuple__1147); - __pyx_codeobj__1148 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHIKKAKEMOD, 2743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1148)) __PYX_ERR(0, 2743, __pyx_L1_error) - - /* "talib/stream.pyx":2807 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - __pyx_tuple__1149 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1149)) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1149); - __Pyx_GIVEREF(__pyx_tuple__1149); - __pyx_codeobj__1150 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLHOMINGPIGEON, 2807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1150)) __PYX_ERR(0, 2807, __pyx_L1_error) - - /* "talib/stream.pyx":2871 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - __pyx_tuple__1151 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1151)) __PYX_ERR(0, 2871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1151); - __Pyx_GIVEREF(__pyx_tuple__1151); - __pyx_codeobj__1152 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLIDENTICAL3CROWS, 2871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1152)) __PYX_ERR(0, 2871, __pyx_L1_error) - - /* "talib/stream.pyx":2935 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - __pyx_tuple__1153 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1153)) __PYX_ERR(0, 2935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1153); - __Pyx_GIVEREF(__pyx_tuple__1153); - __pyx_codeobj__1154 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLINNECK, 2935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1154)) __PYX_ERR(0, 2935, __pyx_L1_error) - - /* "talib/stream.pyx":2999 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - __pyx_tuple__1155 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1155)) __PYX_ERR(0, 2999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1155); - __Pyx_GIVEREF(__pyx_tuple__1155); - __pyx_codeobj__1156 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLINVERTEDHAMMER, 2999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1156)) __PYX_ERR(0, 2999, __pyx_L1_error) - - /* "talib/stream.pyx":3063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - __pyx_tuple__1157 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1157)) __PYX_ERR(0, 3063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1157); - __Pyx_GIVEREF(__pyx_tuple__1157); - __pyx_codeobj__1158 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLKICKING, 3063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1158)) __PYX_ERR(0, 3063, __pyx_L1_error) - - /* "talib/stream.pyx":3127 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - __pyx_tuple__1159 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1159)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1159); - __Pyx_GIVEREF(__pyx_tuple__1159); - __pyx_codeobj__1160 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLKICKINGBYLENGTH, 3127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1160)) __PYX_ERR(0, 3127, __pyx_L1_error) - - /* "talib/stream.pyx":3191 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - __pyx_tuple__1161 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1161)) __PYX_ERR(0, 3191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1161); - __Pyx_GIVEREF(__pyx_tuple__1161); - __pyx_codeobj__1162 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLADDERBOTTOM, 3191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1162)) __PYX_ERR(0, 3191, __pyx_L1_error) - - /* "talib/stream.pyx":3255 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - __pyx_tuple__1163 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1163)) __PYX_ERR(0, 3255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1163); - __Pyx_GIVEREF(__pyx_tuple__1163); - __pyx_codeobj__1164 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLONGLEGGEDDOJI, 3255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1164)) __PYX_ERR(0, 3255, __pyx_L1_error) - - /* "talib/stream.pyx":3319 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - __pyx_tuple__1165 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1165)) __PYX_ERR(0, 3319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1165); - __Pyx_GIVEREF(__pyx_tuple__1165); - __pyx_codeobj__1166 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLLONGLINE, 3319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1166)) __PYX_ERR(0, 3319, __pyx_L1_error) - - /* "talib/stream.pyx":3383 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - __pyx_tuple__1167 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1167)) __PYX_ERR(0, 3383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1167); - __Pyx_GIVEREF(__pyx_tuple__1167); - __pyx_codeobj__1168 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMARUBOZU, 3383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1168)) __PYX_ERR(0, 3383, __pyx_L1_error) - - /* "talib/stream.pyx":3447 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - __pyx_tuple__1169 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1169)) __PYX_ERR(0, 3447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1169); - __Pyx_GIVEREF(__pyx_tuple__1169); - __pyx_codeobj__1170 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMATCHINGLOW, 3447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1170)) __PYX_ERR(0, 3447, __pyx_L1_error) - - /* "talib/stream.pyx":3511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1171 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1171)) __PYX_ERR(0, 3511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1171); - __Pyx_GIVEREF(__pyx_tuple__1171); - __pyx_codeobj__1172 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMATHOLD, 3511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1172)) __PYX_ERR(0, 3511, __pyx_L1_error) - - /* "talib/stream.pyx":3577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1173 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1173)) __PYX_ERR(0, 3577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1173); - __Pyx_GIVEREF(__pyx_tuple__1173); - __pyx_codeobj__1174 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMORNINGDOJISTAR, 3577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1174)) __PYX_ERR(0, 3577, __pyx_L1_error) - - /* "talib/stream.pyx":3643 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_tuple__1175 = PyTuple_Pack(18, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_penetration, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1175)) __PYX_ERR(0, 3643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1175); - __Pyx_GIVEREF(__pyx_tuple__1175); - __pyx_codeobj__1176 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLMORNINGSTAR, 3643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1176)) __PYX_ERR(0, 3643, __pyx_L1_error) - - /* "talib/stream.pyx":3709 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - __pyx_tuple__1177 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1177)) __PYX_ERR(0, 3709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1177); - __Pyx_GIVEREF(__pyx_tuple__1177); - __pyx_codeobj__1178 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLONNECK, 3709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1178)) __PYX_ERR(0, 3709, __pyx_L1_error) - - /* "talib/stream.pyx":3773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - __pyx_tuple__1179 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1179)) __PYX_ERR(0, 3773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1179); - __Pyx_GIVEREF(__pyx_tuple__1179); - __pyx_codeobj__1180 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLPIERCING, 3773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1180)) __PYX_ERR(0, 3773, __pyx_L1_error) - - /* "talib/stream.pyx":3837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - __pyx_tuple__1181 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1181)) __PYX_ERR(0, 3837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1181); - __Pyx_GIVEREF(__pyx_tuple__1181); - __pyx_codeobj__1182 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLRICKSHAWMAN, 3837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1182)) __PYX_ERR(0, 3837, __pyx_L1_error) - - /* "talib/stream.pyx":3901 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - __pyx_tuple__1183 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1183)) __PYX_ERR(0, 3901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1183); - __Pyx_GIVEREF(__pyx_tuple__1183); - __pyx_codeobj__1184 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLRISEFALL3METHODS, 3901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1184)) __PYX_ERR(0, 3901, __pyx_L1_error) - - /* "talib/stream.pyx":3965 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - __pyx_tuple__1185 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1185)) __PYX_ERR(0, 3965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1185); - __Pyx_GIVEREF(__pyx_tuple__1185); - __pyx_codeobj__1186 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSEPARATINGLINES, 3965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1186)) __PYX_ERR(0, 3965, __pyx_L1_error) - - /* "talib/stream.pyx":4029 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - __pyx_tuple__1187 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1187)) __PYX_ERR(0, 4029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1187); - __Pyx_GIVEREF(__pyx_tuple__1187); - __pyx_codeobj__1188 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSHOOTINGSTAR, 4029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1188)) __PYX_ERR(0, 4029, __pyx_L1_error) - - /* "talib/stream.pyx":4093 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - __pyx_tuple__1189 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1189)) __PYX_ERR(0, 4093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1189); - __Pyx_GIVEREF(__pyx_tuple__1189); - __pyx_codeobj__1190 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSHORTLINE, 4093, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1190)) __PYX_ERR(0, 4093, __pyx_L1_error) - - /* "talib/stream.pyx":4157 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - __pyx_tuple__1191 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1191)) __PYX_ERR(0, 4157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1191); - __Pyx_GIVEREF(__pyx_tuple__1191); - __pyx_codeobj__1192 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSPINNINGTOP, 4157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1192)) __PYX_ERR(0, 4157, __pyx_L1_error) - - /* "talib/stream.pyx":4221 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - __pyx_tuple__1193 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1193)) __PYX_ERR(0, 4221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1193); - __Pyx_GIVEREF(__pyx_tuple__1193); - __pyx_codeobj__1194 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSTALLEDPATTERN, 4221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1194)) __PYX_ERR(0, 4221, __pyx_L1_error) - - /* "talib/stream.pyx":4285 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - __pyx_tuple__1195 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1195)) __PYX_ERR(0, 4285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1195); - __Pyx_GIVEREF(__pyx_tuple__1195); - __pyx_codeobj__1196 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLSTICKSANDWICH, 4285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1196)) __PYX_ERR(0, 4285, __pyx_L1_error) - - /* "talib/stream.pyx":4349 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - __pyx_tuple__1197 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1197)) __PYX_ERR(0, 4349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1197); - __Pyx_GIVEREF(__pyx_tuple__1197); - __pyx_codeobj__1198 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTAKURI, 4349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1198)) __PYX_ERR(0, 4349, __pyx_L1_error) - - /* "talib/stream.pyx":4413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - __pyx_tuple__1199 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1199)) __PYX_ERR(0, 4413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1199); - __Pyx_GIVEREF(__pyx_tuple__1199); - __pyx_codeobj__1200 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTASUKIGAP, 4413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1200)) __PYX_ERR(0, 4413, __pyx_L1_error) - - /* "talib/stream.pyx":4477 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - __pyx_tuple__1201 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1201)) __PYX_ERR(0, 4477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1201); - __Pyx_GIVEREF(__pyx_tuple__1201); - __pyx_codeobj__1202 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTHRUSTING, 4477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1202)) __PYX_ERR(0, 4477, __pyx_L1_error) - - /* "talib/stream.pyx":4541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - __pyx_tuple__1203 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1203)) __PYX_ERR(0, 4541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1203); - __Pyx_GIVEREF(__pyx_tuple__1203); - __pyx_codeobj__1204 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLTRISTAR, 4541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1204)) __PYX_ERR(0, 4541, __pyx_L1_error) - - /* "talib/stream.pyx":4605 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - __pyx_tuple__1205 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1205)) __PYX_ERR(0, 4605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1205); - __Pyx_GIVEREF(__pyx_tuple__1205); - __pyx_codeobj__1206 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLUNIQUE3RIVER, 4605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1206)) __PYX_ERR(0, 4605, __pyx_L1_error) - - /* "talib/stream.pyx":4669 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - __pyx_tuple__1207 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1207)) __PYX_ERR(0, 4669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1207); - __Pyx_GIVEREF(__pyx_tuple__1207); - __pyx_codeobj__1208 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLUPSIDEGAP2CROWS, 4669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1208)) __PYX_ERR(0, 4669, __pyx_L1_error) - - /* "talib/stream.pyx":4733 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - __pyx_tuple__1209 = PyTuple_Pack(17, __pyx_n_s_open, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_open_data, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1209)) __PYX_ERR(0, 4733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1209); - __Pyx_GIVEREF(__pyx_tuple__1209); - __pyx_codeobj__1210 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CDLXSIDEGAP3METHODS, 4733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1210)) __PYX_ERR(0, 4733, __pyx_L1_error) - - /* "talib/stream.pyx":4797 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - __pyx_tuple__1211 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1211)) __PYX_ERR(0, 4797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1211); - __Pyx_GIVEREF(__pyx_tuple__1211); - __pyx_codeobj__1212 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CEIL, 4797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1212)) __PYX_ERR(0, 4797, __pyx_L1_error) - - /* "talib/stream.pyx":4831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - __pyx_tuple__1213 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1213)) __PYX_ERR(0, 4831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1213); - __Pyx_GIVEREF(__pyx_tuple__1213); - __pyx_codeobj__1214 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CMO, 4831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1214)) __PYX_ERR(0, 4831, __pyx_L1_error) - - /* "talib/stream.pyx":4867 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - __pyx_tuple__1215 = PyTuple_Pack(14, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1215)) __PYX_ERR(0, 4867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1215); - __Pyx_GIVEREF(__pyx_tuple__1215); - __pyx_codeobj__1216 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_CORREL, 4867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1216)) __PYX_ERR(0, 4867, __pyx_L1_error) - - /* "talib/stream.pyx":4914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - __pyx_tuple__1217 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1217)) __PYX_ERR(0, 4914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1217); - __Pyx_GIVEREF(__pyx_tuple__1217); - __pyx_codeobj__1218 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_COS, 4914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1218)) __PYX_ERR(0, 4914, __pyx_L1_error) - - /* "talib/stream.pyx":4948 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - __pyx_tuple__1219 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1219)) __PYX_ERR(0, 4948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1219); - __Pyx_GIVEREF(__pyx_tuple__1219); - __pyx_codeobj__1220 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_COSH, 4948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1220)) __PYX_ERR(0, 4948, __pyx_L1_error) - - /* "talib/stream.pyx":4982 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1221 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1221)) __PYX_ERR(0, 4982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1221); - __Pyx_GIVEREF(__pyx_tuple__1221); - __pyx_codeobj__1222 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DEMA, 4982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1222)) __PYX_ERR(0, 4982, __pyx_L1_error) - - /* "talib/stream.pyx":5018 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - __pyx_tuple__1223 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1223)) __PYX_ERR(0, 5018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1223); - __Pyx_GIVEREF(__pyx_tuple__1223); - __pyx_codeobj__1224 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DIV, 5018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1224)) __PYX_ERR(0, 5018, __pyx_L1_error) - - /* "talib/stream.pyx":5063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1225 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1225)) __PYX_ERR(0, 5063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1225); - __Pyx_GIVEREF(__pyx_tuple__1225); - __pyx_codeobj__1226 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_DX, 5063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1226)) __PYX_ERR(0, 5063, __pyx_L1_error) - - /* "talib/stream.pyx":5119 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1227 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1227)) __PYX_ERR(0, 5119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1227); - __Pyx_GIVEREF(__pyx_tuple__1227); - __pyx_codeobj__1228 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_EMA, 5119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1228)) __PYX_ERR(0, 5119, __pyx_L1_error) - - /* "talib/stream.pyx":5155 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - __pyx_tuple__1229 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1229)) __PYX_ERR(0, 5155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1229); - __Pyx_GIVEREF(__pyx_tuple__1229); - __pyx_codeobj__1230 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_EXP, 5155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1230)) __PYX_ERR(0, 5155, __pyx_L1_error) - - /* "talib/stream.pyx":5189 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - __pyx_tuple__1231 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1231)) __PYX_ERR(0, 5189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1231); - __Pyx_GIVEREF(__pyx_tuple__1231); - __pyx_codeobj__1232 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_FLOOR, 5189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1232)) __PYX_ERR(0, 5189, __pyx_L1_error) - - /* "talib/stream.pyx":5223 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - __pyx_tuple__1233 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1233)) __PYX_ERR(0, 5223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1233); - __Pyx_GIVEREF(__pyx_tuple__1233); - __pyx_codeobj__1234 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_DCPERIOD, 5223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1234)) __PYX_ERR(0, 5223, __pyx_L1_error) - - /* "talib/stream.pyx":5257 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - __pyx_tuple__1235 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1235)) __PYX_ERR(0, 5257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1235); - __Pyx_GIVEREF(__pyx_tuple__1235); - __pyx_codeobj__1236 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_DCPHASE, 5257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1236)) __PYX_ERR(0, 5257, __pyx_L1_error) - - /* "talib/stream.pyx":5291 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - __pyx_tuple__1237 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinphase, __pyx_n_s_outquadrature); if (unlikely(!__pyx_tuple__1237)) __PYX_ERR(0, 5291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1237); - __Pyx_GIVEREF(__pyx_tuple__1237); - __pyx_codeobj__1238 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_PHASOR, 5291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1238)) __PYX_ERR(0, 5291, __pyx_L1_error) - - /* "talib/stream.pyx":5328 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - __pyx_tuple__1239 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outsine, __pyx_n_s_outleadsine); if (unlikely(!__pyx_tuple__1239)) __PYX_ERR(0, 5328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1239); - __Pyx_GIVEREF(__pyx_tuple__1239); - __pyx_codeobj__1240 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_SINE, 5328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1240)) __PYX_ERR(0, 5328, __pyx_L1_error) - - /* "talib/stream.pyx":5365 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - __pyx_tuple__1241 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1241)) __PYX_ERR(0, 5365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1241); - __Pyx_GIVEREF(__pyx_tuple__1241); - __pyx_codeobj__1242 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_TRENDLINE, 5365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1242)) __PYX_ERR(0, 5365, __pyx_L1_error) - - /* "talib/stream.pyx":5399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - __pyx_tuple__1243 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1243)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1243); - __Pyx_GIVEREF(__pyx_tuple__1243); - __pyx_codeobj__1244 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_HT_TRENDMODE, 5399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1244)) __PYX_ERR(0, 5399, __pyx_L1_error) - - /* "talib/stream.pyx":5433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1245 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1245)) __PYX_ERR(0, 5433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1245); - __Pyx_GIVEREF(__pyx_tuple__1245); - __pyx_codeobj__1246 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_KAMA, 5433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1246)) __PYX_ERR(0, 5433, __pyx_L1_error) - - /* "talib/stream.pyx":5469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - __pyx_tuple__1247 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1247)) __PYX_ERR(0, 5469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1247); - __Pyx_GIVEREF(__pyx_tuple__1247); - __pyx_codeobj__1248 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG, 5469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1248)) __PYX_ERR(0, 5469, __pyx_L1_error) - - /* "talib/stream.pyx":5505 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - __pyx_tuple__1249 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1249)) __PYX_ERR(0, 5505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1249); - __Pyx_GIVEREF(__pyx_tuple__1249); - __pyx_codeobj__1250 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_ANGLE, 5505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1250)) __PYX_ERR(0, 5505, __pyx_L1_error) - - /* "talib/stream.pyx":5541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - __pyx_tuple__1251 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1251)) __PYX_ERR(0, 5541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1251); - __Pyx_GIVEREF(__pyx_tuple__1251); - __pyx_codeobj__1252 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_INTERCEPT, 5541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1252)) __PYX_ERR(0, 5541, __pyx_L1_error) - - /* "talib/stream.pyx":5577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - __pyx_tuple__1253 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1253)) __PYX_ERR(0, 5577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1253); - __Pyx_GIVEREF(__pyx_tuple__1253); - __pyx_codeobj__1254 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LINEARREG_SLOPE, 5577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1254)) __PYX_ERR(0, 5577, __pyx_L1_error) - - /* "talib/stream.pyx":5613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - __pyx_tuple__1255 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1255)) __PYX_ERR(0, 5613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1255); - __Pyx_GIVEREF(__pyx_tuple__1255); - __pyx_codeobj__1256 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LN, 5613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1256)) __PYX_ERR(0, 5613, __pyx_L1_error) - - /* "talib/stream.pyx":5647 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - __pyx_tuple__1257 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1257)) __PYX_ERR(0, 5647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1257); - __Pyx_GIVEREF(__pyx_tuple__1257); - __pyx_codeobj__1258 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_LOG10, 5647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1258)) __PYX_ERR(0, 5647, __pyx_L1_error) - - /* "talib/stream.pyx":5681 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - __pyx_tuple__1259 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1259)) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1259); - __Pyx_GIVEREF(__pyx_tuple__1259); - __pyx_codeobj__1260 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MA, 5681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1260)) __PYX_ERR(0, 5681, __pyx_L1_error) - - /* "talib/stream.pyx":5718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - __pyx_tuple__1261 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__1261)) __PYX_ERR(0, 5718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1261); - __Pyx_GIVEREF(__pyx_tuple__1261); - __pyx_codeobj__1262 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACD, 5718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1262)) __PYX_ERR(0, 5718, __pyx_L1_error) - - /* "talib/stream.pyx":5762 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - __pyx_tuple__1263 = PyTuple_Pack(19, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_fastmatype, __pyx_n_s_slowperiod, __pyx_n_s_slowmatype, __pyx_n_s_signalperiod, __pyx_n_s_signalmatype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__1263)) __PYX_ERR(0, 5762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1263); - __Pyx_GIVEREF(__pyx_tuple__1263); - __pyx_codeobj__1264 = (PyObject*)__Pyx_PyCode_New(7, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACDEXT, 5762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1264)) __PYX_ERR(0, 5762, __pyx_L1_error) - - /* "talib/stream.pyx":5809 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - __pyx_tuple__1265 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_signalperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmacd, __pyx_n_s_outmacdsignal, __pyx_n_s_outmacdhist); if (unlikely(!__pyx_tuple__1265)) __PYX_ERR(0, 5809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1265); - __Pyx_GIVEREF(__pyx_tuple__1265); - __pyx_codeobj__1266 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MACDFIX, 5809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1266)) __PYX_ERR(0, 5809, __pyx_L1_error) - - /* "talib/stream.pyx":5851 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - __pyx_tuple__1267 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastlimit, __pyx_n_s_slowlimit, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmama, __pyx_n_s_outfama); if (unlikely(!__pyx_tuple__1267)) __PYX_ERR(0, 5851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1267); - __Pyx_GIVEREF(__pyx_tuple__1267); - __pyx_codeobj__1268 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAMA, 5851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1268)) __PYX_ERR(0, 5851, __pyx_L1_error) - - /* "talib/stream.pyx":5891 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - __pyx_tuple__1269 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_periods, __pyx_n_s_minperiod, __pyx_n_s_maxperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_periods_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1269)) __PYX_ERR(0, 5891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1269); - __Pyx_GIVEREF(__pyx_tuple__1269); - __pyx_codeobj__1270 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAVP, 5891, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1270)) __PYX_ERR(0, 5891, __pyx_L1_error) - - /* "talib/stream.pyx":5940 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1271 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1271)) __PYX_ERR(0, 5940, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1271); - __Pyx_GIVEREF(__pyx_tuple__1271); - __pyx_codeobj__1272 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAX, 5940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1272)) __PYX_ERR(0, 5940, __pyx_L1_error) - - /* "talib/stream.pyx":5976 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1273 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1273)) __PYX_ERR(0, 5976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1273); - __Pyx_GIVEREF(__pyx_tuple__1273); - __pyx_codeobj__1274 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MAXINDEX, 5976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1274)) __PYX_ERR(0, 5976, __pyx_L1_error) - - /* "talib/stream.pyx":6012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - __pyx_tuple__1275 = PyTuple_Pack(13, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1275)) __PYX_ERR(0, 6012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1275); - __Pyx_GIVEREF(__pyx_tuple__1275); - __pyx_codeobj__1276 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MEDPRICE, 6012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1276)) __PYX_ERR(0, 6012, __pyx_L1_error) - - /* "talib/stream.pyx":6056 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - __pyx_tuple__1277 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_volume, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1277)) __PYX_ERR(0, 6056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1277); - __Pyx_GIVEREF(__pyx_tuple__1277); - __pyx_codeobj__1278 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MFI, 6056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1278)) __PYX_ERR(0, 6056, __pyx_L1_error) - - /* "talib/stream.pyx":6122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - __pyx_tuple__1279 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1279)) __PYX_ERR(0, 6122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1279); - __Pyx_GIVEREF(__pyx_tuple__1279); - __pyx_codeobj__1280 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIDPOINT, 6122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1280)) __PYX_ERR(0, 6122, __pyx_L1_error) - - /* "talib/stream.pyx":6158 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1281 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1281)) __PYX_ERR(0, 6158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1281); - __Pyx_GIVEREF(__pyx_tuple__1281); - __pyx_codeobj__1282 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIDPRICE, 6158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1282)) __PYX_ERR(0, 6158, __pyx_L1_error) - - /* "talib/stream.pyx":6204 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - __pyx_tuple__1283 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1283)) __PYX_ERR(0, 6204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1283); - __Pyx_GIVEREF(__pyx_tuple__1283); - __pyx_codeobj__1284 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MIN, 6204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1284)) __PYX_ERR(0, 6204, __pyx_L1_error) - - /* "talib/stream.pyx":6240 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1285 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outinteger); if (unlikely(!__pyx_tuple__1285)) __PYX_ERR(0, 6240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1285); - __Pyx_GIVEREF(__pyx_tuple__1285); - __pyx_codeobj__1286 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MININDEX, 6240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1286)) __PYX_ERR(0, 6240, __pyx_L1_error) - - /* "talib/stream.pyx":6276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1287 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outmin, __pyx_n_s_outmax); if (unlikely(!__pyx_tuple__1287)) __PYX_ERR(0, 6276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1287); - __Pyx_GIVEREF(__pyx_tuple__1287); - __pyx_codeobj__1288 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINMAX, 6276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1288)) __PYX_ERR(0, 6276, __pyx_L1_error) - - /* "talib/stream.pyx":6315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1289 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outminidx, __pyx_n_s_outmaxidx); if (unlikely(!__pyx_tuple__1289)) __PYX_ERR(0, 6315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1289); - __Pyx_GIVEREF(__pyx_tuple__1289); - __pyx_codeobj__1290 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINMAXINDEX, 6315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1290)) __PYX_ERR(0, 6315, __pyx_L1_error) - - /* "talib/stream.pyx":6354 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1291 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1291)) __PYX_ERR(0, 6354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1291); - __Pyx_GIVEREF(__pyx_tuple__1291); - __pyx_codeobj__1292 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINUS_DI, 6354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1292)) __PYX_ERR(0, 6354, __pyx_L1_error) - - /* "talib/stream.pyx":6410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1293 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1293)) __PYX_ERR(0, 6410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1293); - __Pyx_GIVEREF(__pyx_tuple__1293); - __pyx_codeobj__1294 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MINUS_DM, 6410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1294)) __PYX_ERR(0, 6410, __pyx_L1_error) - - /* "talib/stream.pyx":6456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - __pyx_tuple__1295 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1295)) __PYX_ERR(0, 6456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1295); - __Pyx_GIVEREF(__pyx_tuple__1295); - __pyx_codeobj__1296 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MOM, 6456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1296)) __PYX_ERR(0, 6456, __pyx_L1_error) - - /* "talib/stream.pyx":6492 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - __pyx_tuple__1297 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1297)) __PYX_ERR(0, 6492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1297); - __Pyx_GIVEREF(__pyx_tuple__1297); - __pyx_codeobj__1298 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_MULT, 6492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1298)) __PYX_ERR(0, 6492, __pyx_L1_error) - - /* "talib/stream.pyx":6537 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1299 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1299)) __PYX_ERR(0, 6537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1299); - __Pyx_GIVEREF(__pyx_tuple__1299); - __pyx_codeobj__1300 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_NATR, 6537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1300)) __PYX_ERR(0, 6537, __pyx_L1_error) - - /* "talib/stream.pyx":6593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - __pyx_tuple__1301 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_volume, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_volume_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1301)) __PYX_ERR(0, 6593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1301); - __Pyx_GIVEREF(__pyx_tuple__1301); - __pyx_codeobj__1302 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_OBV, 6593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1302)) __PYX_ERR(0, 6593, __pyx_L1_error) - - /* "talib/stream.pyx":6638 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1303 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1303)) __PYX_ERR(0, 6638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1303); - __Pyx_GIVEREF(__pyx_tuple__1303); - __pyx_codeobj__1304 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PLUS_DI, 6638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1304)) __PYX_ERR(0, 6638, __pyx_L1_error) - - /* "talib/stream.pyx":6694 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_tuple__1305 = PyTuple_Pack(14, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1305)) __PYX_ERR(0, 6694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1305); - __Pyx_GIVEREF(__pyx_tuple__1305); - __pyx_codeobj__1306 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PLUS_DM, 6694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1306)) __PYX_ERR(0, 6694, __pyx_L1_error) - - /* "talib/stream.pyx":6740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_tuple__1307 = PyTuple_Pack(14, __pyx_n_s_real, __pyx_n_s_fastperiod, __pyx_n_s_slowperiod, __pyx_n_s_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1307)) __PYX_ERR(0, 6740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1307); - __Pyx_GIVEREF(__pyx_tuple__1307); - __pyx_codeobj__1308 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_PPO, 6740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1308)) __PYX_ERR(0, 6740, __pyx_L1_error) - - /* "talib/stream.pyx":6778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - __pyx_tuple__1309 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1309)) __PYX_ERR(0, 6778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1309); - __Pyx_GIVEREF(__pyx_tuple__1309); - __pyx_codeobj__1310 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROC, 6778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1310)) __PYX_ERR(0, 6778, __pyx_L1_error) - - /* "talib/stream.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - __pyx_tuple__1311 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1311)) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1311); - __Pyx_GIVEREF(__pyx_tuple__1311); - __pyx_codeobj__1312 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCP, 6814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1312)) __PYX_ERR(0, 6814, __pyx_L1_error) - - /* "talib/stream.pyx":6850 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - __pyx_tuple__1313 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1313)) __PYX_ERR(0, 6850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1313); - __Pyx_GIVEREF(__pyx_tuple__1313); - __pyx_codeobj__1314 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCR, 6850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1314)) __PYX_ERR(0, 6850, __pyx_L1_error) - - /* "talib/stream.pyx":6886 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - __pyx_tuple__1315 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1315)) __PYX_ERR(0, 6886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1315); - __Pyx_GIVEREF(__pyx_tuple__1315); - __pyx_codeobj__1316 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ROCR100, 6886, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1316)) __PYX_ERR(0, 6886, __pyx_L1_error) - - /* "talib/stream.pyx":6922 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - __pyx_tuple__1317 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1317)) __PYX_ERR(0, 6922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1317); - __Pyx_GIVEREF(__pyx_tuple__1317); - __pyx_codeobj__1318 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_RSI, 6922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1318)) __PYX_ERR(0, 6922, __pyx_L1_error) - - /* "talib/stream.pyx":6958 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - __pyx_tuple__1319 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_acceleration, __pyx_n_s_maximum, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1319)) __PYX_ERR(0, 6958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1319); - __Pyx_GIVEREF(__pyx_tuple__1319); - __pyx_codeobj__1320 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SAR, 6958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1320)) __PYX_ERR(0, 6958, __pyx_L1_error) - - /* "talib/stream.pyx":7005 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - __pyx_tuple__1321 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_startvalue, __pyx_n_s_offsetonreverse, __pyx_n_s_accelerationinitlong, __pyx_n_s_accelerationlong, __pyx_n_s_accelerationmaxlong, __pyx_n_s_accelerationinitshort, __pyx_n_s_accelerationshort, __pyx_n_s_accelerationmaxshort, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1321)) __PYX_ERR(0, 7005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1321); - __Pyx_GIVEREF(__pyx_tuple__1321); - __pyx_codeobj__1322 = (PyObject*)__Pyx_PyCode_New(10, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SAREXT, 7005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1322)) __PYX_ERR(0, 7005, __pyx_L1_error) - - /* "talib/stream.pyx":7058 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - __pyx_tuple__1323 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1323)) __PYX_ERR(0, 7058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1323); - __Pyx_GIVEREF(__pyx_tuple__1323); - __pyx_codeobj__1324 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SIN, 7058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1324)) __PYX_ERR(0, 7058, __pyx_L1_error) - - /* "talib/stream.pyx":7092 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - __pyx_tuple__1325 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1325)) __PYX_ERR(0, 7092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1325); - __Pyx_GIVEREF(__pyx_tuple__1325); - __pyx_codeobj__1326 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SINH, 7092, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1326)) __PYX_ERR(0, 7092, __pyx_L1_error) - - /* "talib/stream.pyx":7126 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1327 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1327)) __PYX_ERR(0, 7126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1327); - __Pyx_GIVEREF(__pyx_tuple__1327); - __pyx_codeobj__1328 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SMA, 7126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1328)) __PYX_ERR(0, 7126, __pyx_L1_error) - - /* "talib/stream.pyx":7162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - __pyx_tuple__1329 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1329)) __PYX_ERR(0, 7162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1329); - __Pyx_GIVEREF(__pyx_tuple__1329); - __pyx_codeobj__1330 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SQRT, 7162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1330)) __PYX_ERR(0, 7162, __pyx_L1_error) - - /* "talib/stream.pyx":7196 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_tuple__1331 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1331)) __PYX_ERR(0, 7196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1331); - __Pyx_GIVEREF(__pyx_tuple__1331); - __pyx_codeobj__1332 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STDDEV, 7196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1332)) __PYX_ERR(0, 7196, __pyx_L1_error) - - /* "talib/stream.pyx":7233 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - __pyx_tuple__1333 = PyTuple_Pack(21, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_slowk_period, __pyx_n_s_slowk_matype, __pyx_n_s_slowd_period, __pyx_n_s_slowd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outslowk, __pyx_n_s_outslowd); if (unlikely(!__pyx_tuple__1333)) __PYX_ERR(0, 7233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1333); - __Pyx_GIVEREF(__pyx_tuple__1333); - __pyx_codeobj__1334 = (PyObject*)__Pyx_PyCode_New(8, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCH, 7233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1334)) __PYX_ERR(0, 7233, __pyx_L1_error) - - /* "talib/stream.pyx":7296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_tuple__1335 = PyTuple_Pack(19, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastd); if (unlikely(!__pyx_tuple__1335)) __PYX_ERR(0, 7296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1335); - __Pyx_GIVEREF(__pyx_tuple__1335); - __pyx_codeobj__1336 = (PyObject*)__Pyx_PyCode_New(6, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCHF, 7296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1336)) __PYX_ERR(0, 7296, __pyx_L1_error) - - /* "talib/stream.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_tuple__1337 = PyTuple_Pack(16, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_fastk_period, __pyx_n_s_fastd_period, __pyx_n_s_fastd_matype, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outfastk, __pyx_n_s_outfastd); if (unlikely(!__pyx_tuple__1337)) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1337); - __Pyx_GIVEREF(__pyx_tuple__1337); - __pyx_codeobj__1338 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_STOCHRSI, 7357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1338)) __PYX_ERR(0, 7357, __pyx_L1_error) - - /* "talib/stream.pyx":7399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - __pyx_tuple__1339 = PyTuple_Pack(13, __pyx_n_s_real0, __pyx_n_s_real1, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real0_data, __pyx_n_s_real1_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1339)) __PYX_ERR(0, 7399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1339); - __Pyx_GIVEREF(__pyx_tuple__1339); - __pyx_codeobj__1340 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SUB, 7399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1340)) __PYX_ERR(0, 7399, __pyx_L1_error) - - /* "talib/stream.pyx":7444 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - __pyx_tuple__1341 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1341)) __PYX_ERR(0, 7444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1341); - __Pyx_GIVEREF(__pyx_tuple__1341); - __pyx_codeobj__1342 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_SUM, 7444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1342)) __PYX_ERR(0, 7444, __pyx_L1_error) - - /* "talib/stream.pyx":7480 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - __pyx_tuple__1343 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_vfactor, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1343)) __PYX_ERR(0, 7480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1343); - __Pyx_GIVEREF(__pyx_tuple__1343); - __pyx_codeobj__1344 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_T3, 7480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1344)) __PYX_ERR(0, 7480, __pyx_L1_error) - - /* "talib/stream.pyx":7517 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - __pyx_tuple__1345 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1345)) __PYX_ERR(0, 7517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1345); - __Pyx_GIVEREF(__pyx_tuple__1345); - __pyx_codeobj__1346 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TAN, 7517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1346)) __PYX_ERR(0, 7517, __pyx_L1_error) - - /* "talib/stream.pyx":7551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - __pyx_tuple__1347 = PyTuple_Pack(11, __pyx_n_s_real, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1347)) __PYX_ERR(0, 7551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1347); - __Pyx_GIVEREF(__pyx_tuple__1347); - __pyx_codeobj__1348 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TANH, 7551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1348)) __PYX_ERR(0, 7551, __pyx_L1_error) - - /* "talib/stream.pyx":7585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1349 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1349)) __PYX_ERR(0, 7585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1349); - __Pyx_GIVEREF(__pyx_tuple__1349); - __pyx_codeobj__1350 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TEMA, 7585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1350)) __PYX_ERR(0, 7585, __pyx_L1_error) - - /* "talib/stream.pyx":7621 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - __pyx_tuple__1351 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1351)) __PYX_ERR(0, 7621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1351); - __Pyx_GIVEREF(__pyx_tuple__1351); - __pyx_codeobj__1352 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRANGE, 7621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1352)) __PYX_ERR(0, 7621, __pyx_L1_error) - - /* "talib/stream.pyx":7675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1353 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1353)) __PYX_ERR(0, 7675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1353); - __Pyx_GIVEREF(__pyx_tuple__1353); - __pyx_codeobj__1354 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRIMA, 7675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1354)) __PYX_ERR(0, 7675, __pyx_L1_error) - - /* "talib/stream.pyx":7711 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - __pyx_tuple__1355 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1355)) __PYX_ERR(0, 7711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1355); - __Pyx_GIVEREF(__pyx_tuple__1355); - __pyx_codeobj__1356 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TRIX, 7711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1356)) __PYX_ERR(0, 7711, __pyx_L1_error) - - /* "talib/stream.pyx":7747 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - __pyx_tuple__1357 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1357)) __PYX_ERR(0, 7747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1357); - __Pyx_GIVEREF(__pyx_tuple__1357); - __pyx_codeobj__1358 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TSF, 7747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1358)) __PYX_ERR(0, 7747, __pyx_L1_error) - - /* "talib/stream.pyx":7783 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - __pyx_tuple__1359 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1359)) __PYX_ERR(0, 7783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1359); - __Pyx_GIVEREF(__pyx_tuple__1359); - __pyx_codeobj__1360 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_TYPPRICE, 7783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1360)) __PYX_ERR(0, 7783, __pyx_L1_error) - - /* "talib/stream.pyx":7837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - __pyx_tuple__1361 = PyTuple_Pack(18, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod1, __pyx_n_s_timeperiod2, __pyx_n_s_timeperiod3, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1361)) __PYX_ERR(0, 7837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1361); - __Pyx_GIVEREF(__pyx_tuple__1361); - __pyx_codeobj__1362 = (PyObject*)__Pyx_PyCode_New(6, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_ULTOSC, 7837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1362)) __PYX_ERR(0, 7837, __pyx_L1_error) - - /* "talib/stream.pyx":7895 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_tuple__1363 = PyTuple_Pack(13, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_nbdev, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1363)) __PYX_ERR(0, 7895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1363); - __Pyx_GIVEREF(__pyx_tuple__1363); - __pyx_codeobj__1364 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_VAR, 7895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1364)) __PYX_ERR(0, 7895, __pyx_L1_error) - - /* "talib/stream.pyx":7932 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - __pyx_tuple__1365 = PyTuple_Pack(15, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1365)) __PYX_ERR(0, 7932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1365); - __Pyx_GIVEREF(__pyx_tuple__1365); - __pyx_codeobj__1366 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WCLPRICE, 7932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1366)) __PYX_ERR(0, 7932, __pyx_L1_error) - - /* "talib/stream.pyx":7986 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - __pyx_tuple__1367 = PyTuple_Pack(16, __pyx_n_s_high, __pyx_n_s_low, __pyx_n_s_close, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_high_data, __pyx_n_s_low_data, __pyx_n_s_close_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1367)) __PYX_ERR(0, 7986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1367); - __Pyx_GIVEREF(__pyx_tuple__1367); - __pyx_codeobj__1368 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WILLR, 7986, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1368)) __PYX_ERR(0, 7986, __pyx_L1_error) - - /* "talib/stream.pyx":8042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - __pyx_tuple__1369 = PyTuple_Pack(12, __pyx_n_s_real, __pyx_n_s_timeperiod, __pyx_n_s_length, __pyx_n_s_val, __pyx_n_s_begidx, __pyx_n_s_endidx, __pyx_n_s_lookback, __pyx_n_s_retCode, __pyx_n_s_real_data, __pyx_n_s_outbegidx, __pyx_n_s_outnbelement, __pyx_n_s_outreal); if (unlikely(!__pyx_tuple__1369)) __PYX_ERR(0, 8042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__1369); - __Pyx_GIVEREF(__pyx_tuple__1369); - __pyx_codeobj__1370 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__1369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jbenedik_Dev_ta_lib_talib, __pyx_n_s_WMA, 8042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__1370)) __PYX_ERR(0, 8042, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initstream(void); /*proto*/ -PyMODINIT_FUNC initstream(void) -#else -PyMODINIT_FUNC PyInit_stream(void); /*proto*/ -PyMODINIT_FUNC PyInit_stream(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - double __pyx_t_4; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_stream(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("stream", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_talib__stream) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "talib.stream")) { - if (unlikely(PyDict_SetItemString(modules, "talib.stream", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - __pyx_t_1 = __Pyx_ImportModule("talib.common"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "_ta_check_success", (void (**)(void))&__pyx_f_5talib_6common__ta_check_success, "PyObject *(PyObject *, TA_RetCode, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "talib/stream.pyx":2 - * cimport numpy as np - * from numpy import nan # <<<<<<<<<<<<<< - * from cython import boundscheck, wraparound - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_nan); - __Pyx_GIVEREF(__pyx_n_s_nan); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_nan); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nan, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7 - * from .common cimport _ta_check_success - * - * cdef double NaN = nan # <<<<<<<<<<<<<< - * - * cdef extern from "numpy/arrayobject.h": - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_5talib_6stream_NaN = __pyx_t_4; - - /* "talib/stream.pyx":15 - * object PyArray_GETCONTIGUOUS(np.ndarray) - * - * np.import_array() # Initialize the NumPy C API # <<<<<<<<<<<<<< - * - * cimport libta_lib as lib - */ - import_array(); - - /* "talib/stream.pyx":20 - * from libta_lib cimport TA_RetCode - * - * lib.TA_Initialize() # <<<<<<<<<<<<<< - * - * @wraparound(False) # turn off relative indexing from end of lists - */ - TA_Initialize(); - - /* "talib/stream.pyx":24 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ACOS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ACOS(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_1ACOS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACOS, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":58 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AD( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ AD(high, low, close, volume) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_3AD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AD, __pyx_t_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADD( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ ADD(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_5ADD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD, __pyx_t_3) < 0) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":167 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int fastperiod=-2**31 , int slowperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADOSC(high, low, close, volume[, fastperiod=?, slowperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_7ADOSC, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADOSC, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":234 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADX(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_9ADX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADX, __pyx_t_3) < 0) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":290 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ADXR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ADXR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_11ADXR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADXR, __pyx_t_3) < 0) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":346 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def APO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ APO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_13APO, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_APO, __pyx_t_3) < 0) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":384 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROON( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROON(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_15AROON, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROON, __pyx_t_3) < 0) __PYX_ERR(0, 384, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AROONOSC( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ AROONOSC(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_17AROONOSC, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROONOSC, __pyx_t_3) < 0) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":479 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ASIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ASIN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_19ASIN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASIN, __pyx_t_3) < 0) __PYX_ERR(0, 479, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":513 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ ATAN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_21ATAN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATAN, __pyx_t_3) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":547 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_23ATR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ATR, __pyx_t_3) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":603 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def AVGPRICE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ AVGPRICE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_25AVGPRICE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AVGPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":667 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BBANDS( np.ndarray real not None , int timeperiod=-2**31 , double nbdevup=-4e37 , double nbdevdn=-4e37 , int matype=0 ): # <<<<<<<<<<<<<< - * """ BBANDS(real[, timeperiod=?, nbdevup=?, nbdevdn=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_27BBANDS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BBANDS, __pyx_t_3) < 0) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":712 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BETA( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ BETA(real0, real1[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_29BETA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BETA, __pyx_t_3) < 0) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":759 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def BOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ BOP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_31BOP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BOP, __pyx_t_3) < 0) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":823 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CCI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CCI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_33CCI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CCI, __pyx_t_3) < 0) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":879 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL2CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_35CDL2CROWS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL2CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":943 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3BLACKCROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3BLACKCROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_37CDL3BLACKCROWS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3BLACKCROWS, __pyx_t_3) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1007 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3INSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3INSIDE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_39CDL3INSIDE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3INSIDE, __pyx_t_3) < 0) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1071 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3LINESTRIKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3LINESTRIKE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_41CDL3LINESTRIKE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3LINESTRIKE, __pyx_t_3) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1135 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3OUTSIDE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3OUTSIDE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_43CDL3OUTSIDE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3OUTSIDE, __pyx_t_3) < 0) __PYX_ERR(0, 1135, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1199 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3STARSINSOUTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3STARSINSOUTH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_45CDL3STARSINSOUTH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3STARSINSOUTH, __pyx_t_3) < 0) __PYX_ERR(0, 1199, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1263 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDL3WHITESOLDIERS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDL3WHITESOLDIERS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_47CDL3WHITESOLDIERS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDL3WHITESOLDIERS, __pyx_t_3) < 0) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1327 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLABANDONEDBABY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLABANDONEDBABY(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_49CDLABANDONEDBABY, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLABANDONEDBABY, __pyx_t_3) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1393 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLADVANCEBLOCK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLADVANCEBLOCK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_51CDLADVANCEBLOCK, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLADVANCEBLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 1393, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1457 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBELTHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBELTHOLD(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_53CDLBELTHOLD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBELTHOLD, __pyx_t_3) < 0) __PYX_ERR(0, 1457, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1521 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLBREAKAWAY( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLBREAKAWAY(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_55CDLBREAKAWAY, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLBREAKAWAY, __pyx_t_3) < 0) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCLOSINGMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCLOSINGMARUBOZU(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_57CDLCLOSINGMARUBOZU, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCLOSINGMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(0, 1585, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1649 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCONCEALBABYSWALL( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCONCEALBABYSWALL(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_59CDLCONCEALBABYSWALL, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCONCEALBABYSWALL, __pyx_t_3) < 0) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1713 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLCOUNTERATTACK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLCOUNTERATTACK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_61CDLCOUNTERATTACK, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLCOUNTERATTACK, __pyx_t_3) < 0) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1777 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDARKCLOUDCOVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLDARKCLOUDCOVER(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_63CDLDARKCLOUDCOVER, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDARKCLOUDCOVER, __pyx_t_3) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1843 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_65CDLDOJI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 1843, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1907 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDOJISTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_67CDLDOJISTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 1907, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1971 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLDRAGONFLYDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLDRAGONFLYDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_69CDLDRAGONFLYDOJI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLDRAGONFLYDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2035 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLENGULFING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLENGULFING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_71CDLENGULFING, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLENGULFING, __pyx_t_3) < 0) __PYX_ERR(0, 2035, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2099 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_73CDLEVENINGDOJISTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2165 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLEVENINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLEVENINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_75CDLEVENINGSTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLEVENINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2231 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGAPSIDESIDEWHITE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGAPSIDESIDEWHITE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_77CDLGAPSIDESIDEWHITE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGAPSIDESIDEWHITE, __pyx_t_3) < 0) __PYX_ERR(0, 2231, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2295 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLGRAVESTONEDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLGRAVESTONEDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_79CDLGRAVESTONEDOJI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLGRAVESTONEDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 2295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2359 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHAMMER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_81CDLHAMMER, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHAMMER, __pyx_t_3) < 0) __PYX_ERR(0, 2359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2423 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHANGINGMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHANGINGMAN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_83CDLHANGINGMAN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHANGINGMAN, __pyx_t_3) < 0) __PYX_ERR(0, 2423, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2487 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_85CDLHARAMI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMI, __pyx_t_3) < 0) __PYX_ERR(0, 2487, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHARAMICROSS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHARAMICROSS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_87CDLHARAMICROSS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHARAMICROSS, __pyx_t_3) < 0) __PYX_ERR(0, 2551, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2615 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIGHWAVE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIGHWAVE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_89CDLHIGHWAVE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIGHWAVE, __pyx_t_3) < 0) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2679 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_91CDLHIKKAKE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKE, __pyx_t_3) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2743 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHIKKAKEMOD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHIKKAKEMOD(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_93CDLHIKKAKEMOD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHIKKAKEMOD, __pyx_t_3) < 0) __PYX_ERR(0, 2743, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2807 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLHOMINGPIGEON( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLHOMINGPIGEON(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_95CDLHOMINGPIGEON, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLHOMINGPIGEON, __pyx_t_3) < 0) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2871 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLIDENTICAL3CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLIDENTICAL3CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_97CDLIDENTICAL3CROWS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2871, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLIDENTICAL3CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 2871, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2935 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINNECK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_99CDLINNECK, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINNECK, __pyx_t_3) < 0) __PYX_ERR(0, 2935, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":2999 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLINVERTEDHAMMER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLINVERTEDHAMMER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_101CDLINVERTEDHAMMER, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLINVERTEDHAMMER, __pyx_t_3) < 0) __PYX_ERR(0, 2999, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_103CDLKICKING, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKING, __pyx_t_3) < 0) __PYX_ERR(0, 3063, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3127 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLKICKINGBYLENGTH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLKICKINGBYLENGTH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_105CDLKICKINGBYLENGTH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLKICKINGBYLENGTH, __pyx_t_3) < 0) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3191 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLADDERBOTTOM( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLADDERBOTTOM(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_107CDLLADDERBOTTOM, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLADDERBOTTOM, __pyx_t_3) < 0) __PYX_ERR(0, 3191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3255 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLEGGEDDOJI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLEGGEDDOJI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_109CDLLONGLEGGEDDOJI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLEGGEDDOJI, __pyx_t_3) < 0) __PYX_ERR(0, 3255, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3319 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLLONGLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLLONGLINE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_111CDLLONGLINE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLLONGLINE, __pyx_t_3) < 0) __PYX_ERR(0, 3319, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3383 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMARUBOZU( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMARUBOZU(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_113CDLMARUBOZU, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMARUBOZU, __pyx_t_3) < 0) __PYX_ERR(0, 3383, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3447 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATCHINGLOW( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLMATCHINGLOW(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_115CDLMATCHINGLOW, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATCHINGLOW, __pyx_t_3) < 0) __PYX_ERR(0, 3447, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3511 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMATHOLD( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.5 ): # <<<<<<<<<<<<<< - * """ CDLMATHOLD(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_117CDLMATHOLD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMATHOLD, __pyx_t_3) < 0) __PYX_ERR(0, 3511, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGDOJISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGDOJISTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_119CDLMORNINGDOJISTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGDOJISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 3577, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3643 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLMORNINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , double penetration=0.3 ): # <<<<<<<<<<<<<< - * """ CDLMORNINGSTAR(open, high, low, close[, penetration=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_121CDLMORNINGSTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLMORNINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 3643, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3709 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLONNECK( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLONNECK(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_123CDLONNECK, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLONNECK, __pyx_t_3) < 0) __PYX_ERR(0, 3709, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3773 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLPIERCING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLPIERCING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_125CDLPIERCING, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLPIERCING, __pyx_t_3) < 0) __PYX_ERR(0, 3773, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRICKSHAWMAN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRICKSHAWMAN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_127CDLRICKSHAWMAN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRICKSHAWMAN, __pyx_t_3) < 0) __PYX_ERR(0, 3837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3901 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLRISEFALL3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLRISEFALL3METHODS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_129CDLRISEFALL3METHODS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLRISEFALL3METHODS, __pyx_t_3) < 0) __PYX_ERR(0, 3901, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":3965 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSEPARATINGLINES( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSEPARATINGLINES(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_131CDLSEPARATINGLINES, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSEPARATINGLINES, __pyx_t_3) < 0) __PYX_ERR(0, 3965, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4029 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHOOTINGSTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHOOTINGSTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_133CDLSHOOTINGSTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHOOTINGSTAR, __pyx_t_3) < 0) __PYX_ERR(0, 4029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4093 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSHORTLINE( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSHORTLINE(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_135CDLSHORTLINE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSHORTLINE, __pyx_t_3) < 0) __PYX_ERR(0, 4093, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4157 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSPINNINGTOP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSPINNINGTOP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_137CDLSPINNINGTOP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSPINNINGTOP, __pyx_t_3) < 0) __PYX_ERR(0, 4157, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4221 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTALLEDPATTERN( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTALLEDPATTERN(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_139CDLSTALLEDPATTERN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTALLEDPATTERN, __pyx_t_3) < 0) __PYX_ERR(0, 4221, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4285 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLSTICKSANDWICH( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLSTICKSANDWICH(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_141CDLSTICKSANDWICH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLSTICKSANDWICH, __pyx_t_3) < 0) __PYX_ERR(0, 4285, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4349 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTAKURI( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTAKURI(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_143CDLTAKURI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTAKURI, __pyx_t_3) < 0) __PYX_ERR(0, 4349, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4413 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTASUKIGAP( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTASUKIGAP(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_145CDLTASUKIGAP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTASUKIGAP, __pyx_t_3) < 0) __PYX_ERR(0, 4413, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4477 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTHRUSTING( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTHRUSTING(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_147CDLTHRUSTING, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTHRUSTING, __pyx_t_3) < 0) __PYX_ERR(0, 4477, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLTRISTAR( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLTRISTAR(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_149CDLTRISTAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLTRISTAR, __pyx_t_3) < 0) __PYX_ERR(0, 4541, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4605 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUNIQUE3RIVER( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUNIQUE3RIVER(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_151CDLUNIQUE3RIVER, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUNIQUE3RIVER, __pyx_t_3) < 0) __PYX_ERR(0, 4605, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4669 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLUPSIDEGAP2CROWS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLUPSIDEGAP2CROWS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_153CDLUPSIDEGAP2CROWS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLUPSIDEGAP2CROWS, __pyx_t_3) < 0) __PYX_ERR(0, 4669, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4733 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CDLXSIDEGAP3METHODS( np.ndarray open not None , np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ CDLXSIDEGAP3METHODS(open, high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_155CDLXSIDEGAP3METHODS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CDLXSIDEGAP3METHODS, __pyx_t_3) < 0) __PYX_ERR(0, 4733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4797 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CEIL( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ CEIL(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_157CEIL, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CEIL, __pyx_t_3) < 0) __PYX_ERR(0, 4797, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4831 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CMO( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CMO(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_159CMO, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMO, __pyx_t_3) < 0) __PYX_ERR(0, 4831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4867 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def CORREL( np.ndarray real0 not None , np.ndarray real1 not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ CORREL(real0, real1[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_161CORREL, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CORREL, __pyx_t_3) < 0) __PYX_ERR(0, 4867, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4914 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COS( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COS(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_163COS, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_COS, __pyx_t_3) < 0) __PYX_ERR(0, 4914, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4948 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def COSH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ COSH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_165COSH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_COSH, __pyx_t_3) < 0) __PYX_ERR(0, 4948, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":4982 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DEMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_167DEMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEMA, __pyx_t_3) < 0) __PYX_ERR(0, 4982, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5018 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DIV( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ DIV(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_169DIV, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DIV, __pyx_t_3) < 0) __PYX_ERR(0, 5018, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5063 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def DX( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ DX(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_171DX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DX, __pyx_t_3) < 0) __PYX_ERR(0, 5063, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5119 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ EMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_173EMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMA, __pyx_t_3) < 0) __PYX_ERR(0, 5119, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5155 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def EXP( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ EXP(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_175EXP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXP, __pyx_t_3) < 0) __PYX_ERR(0, 5155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5189 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def FLOOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ FLOOR(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_177FLOOR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FLOOR, __pyx_t_3) < 0) __PYX_ERR(0, 5189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5223 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPERIOD( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPERIOD(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_179HT_DCPERIOD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPERIOD, __pyx_t_3) < 0) __PYX_ERR(0, 5223, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5257 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_DCPHASE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_DCPHASE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_181HT_DCPHASE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_DCPHASE, __pyx_t_3) < 0) __PYX_ERR(0, 5257, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5291 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_PHASOR( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_PHASOR(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_183HT_PHASOR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_PHASOR, __pyx_t_3) < 0) __PYX_ERR(0, 5291, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5328 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_SINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_SINE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_185HT_SINE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_SINE, __pyx_t_3) < 0) __PYX_ERR(0, 5328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5365 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDLINE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDLINE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_187HT_TRENDLINE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDLINE, __pyx_t_3) < 0) __PYX_ERR(0, 5365, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def HT_TRENDMODE( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ HT_TRENDMODE(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_189HT_TRENDMODE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HT_TRENDMODE, __pyx_t_3) < 0) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5433 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def KAMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ KAMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_191KAMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_KAMA, __pyx_t_3) < 0) __PYX_ERR(0, 5433, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5469 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_193LINEARREG, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG, __pyx_t_3) < 0) __PYX_ERR(0, 5469, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5505 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_ANGLE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_ANGLE(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_195LINEARREG_ANGLE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_ANGLE, __pyx_t_3) < 0) __PYX_ERR(0, 5505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5541 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_INTERCEPT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_INTERCEPT(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_197LINEARREG_INTERCEPT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_INTERCEPT, __pyx_t_3) < 0) __PYX_ERR(0, 5541, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5577 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LINEARREG_SLOPE( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ LINEARREG_SLOPE(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_199LINEARREG_SLOPE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LINEARREG_SLOPE, __pyx_t_3) < 0) __PYX_ERR(0, 5577, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5613 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_201LN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LN, __pyx_t_3) < 0) __PYX_ERR(0, 5613, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5647 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def LOG10( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ LOG10(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_203LOG10, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOG10, __pyx_t_3) < 0) __PYX_ERR(0, 5647, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5681 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MA( np.ndarray real not None , int timeperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MA(real[, timeperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_205MA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MA, __pyx_t_3) < 0) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5718 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACD( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACD(real[, fastperiod=?, slowperiod=?, signalperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_207MACD, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACD, __pyx_t_3) < 0) __PYX_ERR(0, 5718, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5762 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDEXT( np.ndarray real not None , int fastperiod=-2**31 , int fastmatype=0 , int slowperiod=-2**31 , int slowmatype=0 , int signalperiod=-2**31 , int signalmatype=0 ): # <<<<<<<<<<<<<< - * """ MACDEXT(real[, fastperiod=?, fastmatype=?, slowperiod=?, slowmatype=?, signalperiod=?, signalmatype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_209MACDEXT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDEXT, __pyx_t_3) < 0) __PYX_ERR(0, 5762, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5809 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MACDFIX( np.ndarray real not None , int signalperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MACDFIX(real[, signalperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_211MACDFIX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MACDFIX, __pyx_t_3) < 0) __PYX_ERR(0, 5809, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5851 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAMA( np.ndarray real not None , double fastlimit=-4e37 , double slowlimit=-4e37 ): # <<<<<<<<<<<<<< - * """ MAMA(real[, fastlimit=?, slowlimit=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_213MAMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAMA, __pyx_t_3) < 0) __PYX_ERR(0, 5851, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5891 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAVP( np.ndarray real not None , np.ndarray periods not None , int minperiod=-2**31 , int maxperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ MAVP(real, periods[, minperiod=?, maxperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_215MAVP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAVP, __pyx_t_3) < 0) __PYX_ERR(0, 5891, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5940 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_217MAX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5940, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX, __pyx_t_3) < 0) __PYX_ERR(0, 5940, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":5976 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_219MAXINDEX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINDEX, __pyx_t_3) < 0) __PYX_ERR(0, 5976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6012 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MEDPRICE( np.ndarray high not None , np.ndarray low not None ): # <<<<<<<<<<<<<< - * """ MEDPRICE(high, low) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_221MEDPRICE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MEDPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 6012, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6056 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MFI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , np.ndarray volume not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MFI(high, low, close, volume[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_223MFI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MFI, __pyx_t_3) < 0) __PYX_ERR(0, 6056, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6122 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPOINT( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPOINT(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_225MIDPOINT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPOINT, __pyx_t_3) < 0) __PYX_ERR(0, 6122, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6158 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIDPRICE( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIDPRICE(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_227MIDPRICE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIDPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 6158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6204 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MIN( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MIN(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_229MIN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MIN, __pyx_t_3) < 0) __PYX_ERR(0, 6204, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6240 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MININDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MININDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_231MININDEX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MININDEX, __pyx_t_3) < 0) __PYX_ERR(0, 6240, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6276 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_233MINMAX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAX, __pyx_t_3) < 0) __PYX_ERR(0, 6276, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6315 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINMAXINDEX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINMAXINDEX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_235MINMAXINDEX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINMAXINDEX, __pyx_t_3) < 0) __PYX_ERR(0, 6315, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6354 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_237MINUS_DI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DI, __pyx_t_3) < 0) __PYX_ERR(0, 6354, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6410 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MINUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MINUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_239MINUS_DM, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINUS_DM, __pyx_t_3) < 0) __PYX_ERR(0, 6410, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6456 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MOM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ MOM(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_241MOM, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOM, __pyx_t_3) < 0) __PYX_ERR(0, 6456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6492 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def MULT( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ MULT(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_243MULT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULT, __pyx_t_3) < 0) __PYX_ERR(0, 6492, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6537 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def NATR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ NATR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_245NATR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NATR, __pyx_t_3) < 0) __PYX_ERR(0, 6537, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6593 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def OBV( np.ndarray real not None , np.ndarray volume not None ): # <<<<<<<<<<<<<< - * """ OBV(real, volume) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_247OBV, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OBV, __pyx_t_3) < 0) __PYX_ERR(0, 6593, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6638 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DI( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DI(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_249PLUS_DI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DI, __pyx_t_3) < 0) __PYX_ERR(0, 6638, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6694 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PLUS_DM( np.ndarray high not None , np.ndarray low not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ PLUS_DM(high, low[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_251PLUS_DM, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PLUS_DM, __pyx_t_3) < 0) __PYX_ERR(0, 6694, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6740 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def PPO( np.ndarray real not None , int fastperiod=-2**31 , int slowperiod=-2**31 , int matype=0 ): # <<<<<<<<<<<<<< - * """ PPO(real[, fastperiod=?, slowperiod=?, matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_253PPO, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PPO, __pyx_t_3) < 0) __PYX_ERR(0, 6740, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6778 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROC( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROC(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_255ROC, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROC, __pyx_t_3) < 0) __PYX_ERR(0, 6778, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6814 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCP( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCP(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_257ROCP, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCP, __pyx_t_3) < 0) __PYX_ERR(0, 6814, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6850 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_259ROCR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR, __pyx_t_3) < 0) __PYX_ERR(0, 6850, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6886 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ROCR100( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ ROCR100(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_261ROCR100, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROCR100, __pyx_t_3) < 0) __PYX_ERR(0, 6886, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6922 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def RSI( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ RSI(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_263RSI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RSI, __pyx_t_3) < 0) __PYX_ERR(0, 6922, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":6958 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAR( np.ndarray high not None , np.ndarray low not None , double acceleration=0.02 , double maximum=0.2 ): # <<<<<<<<<<<<<< - * """ SAR(high, low[, acceleration=?, maximum=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_265SAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAR, __pyx_t_3) < 0) __PYX_ERR(0, 6958, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7005 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SAREXT( np.ndarray high not None , np.ndarray low not None , double startvalue=-4e37 , double offsetonreverse=-4e37 , double accelerationinitlong=-4e37 , double accelerationlong=-4e37 , double accelerationmaxlong=-4e37 , double accelerationinitshort=-4e37 , double accelerationshort=-4e37 , double accelerationmaxshort=-4e37 ): # <<<<<<<<<<<<<< - * """ SAREXT(high, low[, startvalue=?, offsetonreverse=?, accelerationinitlong=?, accelerationlong=?, accelerationmaxlong=?, accelerationinitshort=?, accelerationshort=?, accelerationmaxshort=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_267SAREXT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAREXT, __pyx_t_3) < 0) __PYX_ERR(0, 7005, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7058 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SIN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SIN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_269SIN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIN, __pyx_t_3) < 0) __PYX_ERR(0, 7058, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7092 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SINH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SINH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_271SINH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SINH, __pyx_t_3) < 0) __PYX_ERR(0, 7092, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7126 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_273SMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SMA, __pyx_t_3) < 0) __PYX_ERR(0, 7126, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7162 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SQRT( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ SQRT(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_275SQRT, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQRT, __pyx_t_3) < 0) __PYX_ERR(0, 7162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7196 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STDDEV( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ STDDEV(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_277STDDEV, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STDDEV, __pyx_t_3) < 0) __PYX_ERR(0, 7196, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7233 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCH( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int slowk_period=-2**31 , int slowk_matype=0 , int slowd_period=-2**31 , int slowd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCH(high, low, close[, fastk_period=?, slowk_period=?, slowk_matype=?, slowd_period=?, slowd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_279STOCH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCH, __pyx_t_3) < 0) __PYX_ERR(0, 7233, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7296 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHF( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHF(high, low, close[, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_281STOCHF, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHF, __pyx_t_3) < 0) __PYX_ERR(0, 7296, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7357 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def STOCHRSI( np.ndarray real not None , int timeperiod=-2**31 , int fastk_period=-2**31 , int fastd_period=-2**31 , int fastd_matype=0 ): # <<<<<<<<<<<<<< - * """ STOCHRSI(real[, timeperiod=?, fastk_period=?, fastd_period=?, fastd_matype=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_283STOCHRSI, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_STOCHRSI, __pyx_t_3) < 0) __PYX_ERR(0, 7357, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7399 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUB( np.ndarray real0 not None , np.ndarray real1 not None ): # <<<<<<<<<<<<<< - * """ SUB(real0, real1) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_285SUB, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUB, __pyx_t_3) < 0) __PYX_ERR(0, 7399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7444 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def SUM( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ SUM(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_287SUM, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUM, __pyx_t_3) < 0) __PYX_ERR(0, 7444, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7480 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def T3( np.ndarray real not None , int timeperiod=-2**31 , double vfactor=-4e37 ): # <<<<<<<<<<<<<< - * """ T3(real[, timeperiod=?, vfactor=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_289T3, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_T3, __pyx_t_3) < 0) __PYX_ERR(0, 7480, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7517 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TAN( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TAN(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_291TAN, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAN, __pyx_t_3) < 0) __PYX_ERR(0, 7517, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7551 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TANH( np.ndarray real not None ): # <<<<<<<<<<<<<< - * """ TANH(real) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_293TANH, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TANH, __pyx_t_3) < 0) __PYX_ERR(0, 7551, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7585 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TEMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TEMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_295TEMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEMA, __pyx_t_3) < 0) __PYX_ERR(0, 7585, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7621 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRANGE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TRANGE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_297TRANGE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRANGE, __pyx_t_3) < 0) __PYX_ERR(0, 7621, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7675 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_299TRIMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIMA, __pyx_t_3) < 0) __PYX_ERR(0, 7675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7711 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TRIX( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TRIX(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_301TRIX, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRIX, __pyx_t_3) < 0) __PYX_ERR(0, 7711, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7747 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TSF( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ TSF(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_303TSF, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSF, __pyx_t_3) < 0) __PYX_ERR(0, 7747, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7783 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def TYPPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ TYPPRICE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_305TYPPRICE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 7783, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7837 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def ULTOSC( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod1=-2**31 , int timeperiod2=-2**31 , int timeperiod3=-2**31 ): # <<<<<<<<<<<<<< - * """ ULTOSC(high, low, close[, timeperiod1=?, timeperiod2=?, timeperiod3=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_307ULTOSC, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ULTOSC, __pyx_t_3) < 0) __PYX_ERR(0, 7837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7895 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def VAR( np.ndarray real not None , int timeperiod=-2**31 , double nbdev=-4e37 ): # <<<<<<<<<<<<<< - * """ VAR(real[, timeperiod=?, nbdev=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_309VAR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VAR, __pyx_t_3) < 0) __PYX_ERR(0, 7895, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7932 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WCLPRICE( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None ): # <<<<<<<<<<<<<< - * """ WCLPRICE(high, low, close) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_311WCLPRICE, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WCLPRICE, __pyx_t_3) < 0) __PYX_ERR(0, 7932, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":7986 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WILLR( np.ndarray high not None , np.ndarray low not None , np.ndarray close not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WILLR(high, low, close[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_313WILLR, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WILLR, __pyx_t_3) < 0) __PYX_ERR(0, 7986, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":8042 - * @wraparound(False) # turn off relative indexing from end of lists - * @boundscheck(False) # turn off bounds-checking for entire function - * def WMA( np.ndarray real not None , int timeperiod=-2**31 ): # <<<<<<<<<<<<<< - * """ WMA(real[, timeperiod=?]) - * - */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5talib_6stream_315WMA, NULL, __pyx_n_s_talib_stream); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WMA, __pyx_t_3) < 0) __PYX_ERR(0, 8042, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":8076 - * return outreal - * - * __all__ = ["ACOS","AD","ADD","ADOSC","ADX","ADXR","APO","AROON","AROONOSC","ASIN","ATAN","ATR","AVGPRICE","BBANDS","BETA","BOP","CCI","CDL2CROWS","CDL3BLACKCROWS","CDL3INSIDE","CDL3LINESTRIKE","CDL3OUTSIDE","CDL3STARSINSOUTH","CDL3WHITESOLDIERS","CDLABANDONEDBABY","CDLADVANCEBLOCK","CDLBELTHOLD","CDLBREAKAWAY","CDLCLOSINGMARUBOZU","CDLCONCEALBABYSWALL","CDLCOUNTERATTACK","CDLDARKCLOUDCOVER","CDLDOJI","CDLDOJISTAR","CDLDRAGONFLYDOJI","CDLENGULFING","CDLEVENINGDOJISTAR","CDLEVENINGSTAR","CDLGAPSIDESIDEWHITE","CDLGRAVESTONEDOJI","CDLHAMMER","CDLHANGINGMAN","CDLHARAMI","CDLHARAMICROSS","CDLHIGHWAVE","CDLHIKKAKE","CDLHIKKAKEMOD","CDLHOMINGPIGEON","CDLIDENTICAL3CROWS","CDLINNECK","CDLINVERTEDHAMMER","CDLKICKING","CDLKICKINGBYLENGTH","CDLLADDERBOTTOM","CDLLONGLEGGEDDOJI","CDLLONGLINE","CDLMARUBOZU","CDLMATCHINGLOW","CDLMATHOLD","CDLMORNINGDOJISTAR","CDLMORNINGSTAR","CDLONNECK","CDLPIERCING","CDLRICKSHAWMAN","CDLRISEFALL3METHODS","CDLSEPARATINGLINES","CDLSHOOTINGSTAR","CDLSHORTLINE","CDLSPINNINGTOP","CDLSTALLEDPATTERN","CDLSTICKSANDWICH","CDLTAKURI","CDLTASUKIGAP","CDLTHRUSTING","CDLTRISTAR","CDLUNIQUE3RIVER","CDLUPSIDEGAP2CROWS","CDLXSIDEGAP3METHODS","CEIL","CMO","CORREL","COS","COSH","DEMA","DIV","DX","EMA","EXP","FLOOR","HT_DCPERIOD","HT_DCPHASE","HT_PHASOR","HT_SINE","HT_TRENDLINE","HT_TRENDMODE","KAMA","LINEARREG","LINEARREG_ANGLE","LINEARREG_INTERCEPT","LINEARREG_SLOPE","LN","LOG10","MA","MACD","MACDEXT","MACDFIX","MAMA","MAVP","MAX","MAXINDEX","MEDPRICE","MFI","MIDPOINT","MIDPRICE","MIN","MININDEX","MINMAX","MINMAXINDEX","MINUS_DI","MINUS_DM","MOM","MULT","NATR","OBV","PLUS_DI","PLUS_DM","PPO","ROC","ROCP","ROCR","ROCR100","RSI","SAR","SAREXT","SIN","SINH","SMA","SQRT","STDDEV","STOCH","STOCHF","STOCHRSI","SUB","SUM","T3","TAN","TANH","TEMA","TRANGE","TRIMA","TRIX","TSF","TYPPRICE","ULTOSC","VAR","WCLPRICE","WILLR","WMA"] # <<<<<<<<<<<<<< - */ - __pyx_t_3 = PyList_New(158); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_ACOS); - __Pyx_GIVEREF(__pyx_n_s_ACOS); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ACOS); - __Pyx_INCREF(__pyx_n_s_AD); - __Pyx_GIVEREF(__pyx_n_s_AD); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_AD); - __Pyx_INCREF(__pyx_n_s_ADD); - __Pyx_GIVEREF(__pyx_n_s_ADD); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ADD); - __Pyx_INCREF(__pyx_n_s_ADOSC); - __Pyx_GIVEREF(__pyx_n_s_ADOSC); - PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ADOSC); - __Pyx_INCREF(__pyx_n_s_ADX); - __Pyx_GIVEREF(__pyx_n_s_ADX); - PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ADX); - __Pyx_INCREF(__pyx_n_s_ADXR); - __Pyx_GIVEREF(__pyx_n_s_ADXR); - PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ADXR); - __Pyx_INCREF(__pyx_n_s_APO); - __Pyx_GIVEREF(__pyx_n_s_APO); - PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_APO); - __Pyx_INCREF(__pyx_n_s_AROON); - __Pyx_GIVEREF(__pyx_n_s_AROON); - PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_AROON); - __Pyx_INCREF(__pyx_n_s_AROONOSC); - __Pyx_GIVEREF(__pyx_n_s_AROONOSC); - PyList_SET_ITEM(__pyx_t_3, 8, __pyx_n_s_AROONOSC); - __Pyx_INCREF(__pyx_n_s_ASIN); - __Pyx_GIVEREF(__pyx_n_s_ASIN); - PyList_SET_ITEM(__pyx_t_3, 9, __pyx_n_s_ASIN); - __Pyx_INCREF(__pyx_n_s_ATAN); - __Pyx_GIVEREF(__pyx_n_s_ATAN); - PyList_SET_ITEM(__pyx_t_3, 10, __pyx_n_s_ATAN); - __Pyx_INCREF(__pyx_n_s_ATR); - __Pyx_GIVEREF(__pyx_n_s_ATR); - PyList_SET_ITEM(__pyx_t_3, 11, __pyx_n_s_ATR); - __Pyx_INCREF(__pyx_n_s_AVGPRICE); - __Pyx_GIVEREF(__pyx_n_s_AVGPRICE); - PyList_SET_ITEM(__pyx_t_3, 12, __pyx_n_s_AVGPRICE); - __Pyx_INCREF(__pyx_n_s_BBANDS); - __Pyx_GIVEREF(__pyx_n_s_BBANDS); - PyList_SET_ITEM(__pyx_t_3, 13, __pyx_n_s_BBANDS); - __Pyx_INCREF(__pyx_n_s_BETA); - __Pyx_GIVEREF(__pyx_n_s_BETA); - PyList_SET_ITEM(__pyx_t_3, 14, __pyx_n_s_BETA); - __Pyx_INCREF(__pyx_n_s_BOP); - __Pyx_GIVEREF(__pyx_n_s_BOP); - PyList_SET_ITEM(__pyx_t_3, 15, __pyx_n_s_BOP); - __Pyx_INCREF(__pyx_n_s_CCI); - __Pyx_GIVEREF(__pyx_n_s_CCI); - PyList_SET_ITEM(__pyx_t_3, 16, __pyx_n_s_CCI); - __Pyx_INCREF(__pyx_n_s_CDL2CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDL2CROWS); - PyList_SET_ITEM(__pyx_t_3, 17, __pyx_n_s_CDL2CROWS); - __Pyx_INCREF(__pyx_n_s_CDL3BLACKCROWS); - __Pyx_GIVEREF(__pyx_n_s_CDL3BLACKCROWS); - PyList_SET_ITEM(__pyx_t_3, 18, __pyx_n_s_CDL3BLACKCROWS); - __Pyx_INCREF(__pyx_n_s_CDL3INSIDE); - __Pyx_GIVEREF(__pyx_n_s_CDL3INSIDE); - PyList_SET_ITEM(__pyx_t_3, 19, __pyx_n_s_CDL3INSIDE); - __Pyx_INCREF(__pyx_n_s_CDL3LINESTRIKE); - __Pyx_GIVEREF(__pyx_n_s_CDL3LINESTRIKE); - PyList_SET_ITEM(__pyx_t_3, 20, __pyx_n_s_CDL3LINESTRIKE); - __Pyx_INCREF(__pyx_n_s_CDL3OUTSIDE); - __Pyx_GIVEREF(__pyx_n_s_CDL3OUTSIDE); - PyList_SET_ITEM(__pyx_t_3, 21, __pyx_n_s_CDL3OUTSIDE); - __Pyx_INCREF(__pyx_n_s_CDL3STARSINSOUTH); - __Pyx_GIVEREF(__pyx_n_s_CDL3STARSINSOUTH); - PyList_SET_ITEM(__pyx_t_3, 22, __pyx_n_s_CDL3STARSINSOUTH); - __Pyx_INCREF(__pyx_n_s_CDL3WHITESOLDIERS); - __Pyx_GIVEREF(__pyx_n_s_CDL3WHITESOLDIERS); - PyList_SET_ITEM(__pyx_t_3, 23, __pyx_n_s_CDL3WHITESOLDIERS); - __Pyx_INCREF(__pyx_n_s_CDLABANDONEDBABY); - __Pyx_GIVEREF(__pyx_n_s_CDLABANDONEDBABY); - PyList_SET_ITEM(__pyx_t_3, 24, __pyx_n_s_CDLABANDONEDBABY); - __Pyx_INCREF(__pyx_n_s_CDLADVANCEBLOCK); - __Pyx_GIVEREF(__pyx_n_s_CDLADVANCEBLOCK); - PyList_SET_ITEM(__pyx_t_3, 25, __pyx_n_s_CDLADVANCEBLOCK); - __Pyx_INCREF(__pyx_n_s_CDLBELTHOLD); - __Pyx_GIVEREF(__pyx_n_s_CDLBELTHOLD); - PyList_SET_ITEM(__pyx_t_3, 26, __pyx_n_s_CDLBELTHOLD); - __Pyx_INCREF(__pyx_n_s_CDLBREAKAWAY); - __Pyx_GIVEREF(__pyx_n_s_CDLBREAKAWAY); - PyList_SET_ITEM(__pyx_t_3, 27, __pyx_n_s_CDLBREAKAWAY); - __Pyx_INCREF(__pyx_n_s_CDLCLOSINGMARUBOZU); - __Pyx_GIVEREF(__pyx_n_s_CDLCLOSINGMARUBOZU); - PyList_SET_ITEM(__pyx_t_3, 28, __pyx_n_s_CDLCLOSINGMARUBOZU); - __Pyx_INCREF(__pyx_n_s_CDLCONCEALBABYSWALL); - __Pyx_GIVEREF(__pyx_n_s_CDLCONCEALBABYSWALL); - PyList_SET_ITEM(__pyx_t_3, 29, __pyx_n_s_CDLCONCEALBABYSWALL); - __Pyx_INCREF(__pyx_n_s_CDLCOUNTERATTACK); - __Pyx_GIVEREF(__pyx_n_s_CDLCOUNTERATTACK); - PyList_SET_ITEM(__pyx_t_3, 30, __pyx_n_s_CDLCOUNTERATTACK); - __Pyx_INCREF(__pyx_n_s_CDLDARKCLOUDCOVER); - __Pyx_GIVEREF(__pyx_n_s_CDLDARKCLOUDCOVER); - PyList_SET_ITEM(__pyx_t_3, 31, __pyx_n_s_CDLDARKCLOUDCOVER); - __Pyx_INCREF(__pyx_n_s_CDLDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLDOJI); - PyList_SET_ITEM(__pyx_t_3, 32, __pyx_n_s_CDLDOJI); - __Pyx_INCREF(__pyx_n_s_CDLDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 33, __pyx_n_s_CDLDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLDRAGONFLYDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLDRAGONFLYDOJI); - PyList_SET_ITEM(__pyx_t_3, 34, __pyx_n_s_CDLDRAGONFLYDOJI); - __Pyx_INCREF(__pyx_n_s_CDLENGULFING); - __Pyx_GIVEREF(__pyx_n_s_CDLENGULFING); - PyList_SET_ITEM(__pyx_t_3, 35, __pyx_n_s_CDLENGULFING); - __Pyx_INCREF(__pyx_n_s_CDLEVENINGDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 36, __pyx_n_s_CDLEVENINGDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLEVENINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLEVENINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 37, __pyx_n_s_CDLEVENINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); - __Pyx_GIVEREF(__pyx_n_s_CDLGAPSIDESIDEWHITE); - PyList_SET_ITEM(__pyx_t_3, 38, __pyx_n_s_CDLGAPSIDESIDEWHITE); - __Pyx_INCREF(__pyx_n_s_CDLGRAVESTONEDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLGRAVESTONEDOJI); - PyList_SET_ITEM(__pyx_t_3, 39, __pyx_n_s_CDLGRAVESTONEDOJI); - __Pyx_INCREF(__pyx_n_s_CDLHAMMER); - __Pyx_GIVEREF(__pyx_n_s_CDLHAMMER); - PyList_SET_ITEM(__pyx_t_3, 40, __pyx_n_s_CDLHAMMER); - __Pyx_INCREF(__pyx_n_s_CDLHANGINGMAN); - __Pyx_GIVEREF(__pyx_n_s_CDLHANGINGMAN); - PyList_SET_ITEM(__pyx_t_3, 41, __pyx_n_s_CDLHANGINGMAN); - __Pyx_INCREF(__pyx_n_s_CDLHARAMI); - __Pyx_GIVEREF(__pyx_n_s_CDLHARAMI); - PyList_SET_ITEM(__pyx_t_3, 42, __pyx_n_s_CDLHARAMI); - __Pyx_INCREF(__pyx_n_s_CDLHARAMICROSS); - __Pyx_GIVEREF(__pyx_n_s_CDLHARAMICROSS); - PyList_SET_ITEM(__pyx_t_3, 43, __pyx_n_s_CDLHARAMICROSS); - __Pyx_INCREF(__pyx_n_s_CDLHIGHWAVE); - __Pyx_GIVEREF(__pyx_n_s_CDLHIGHWAVE); - PyList_SET_ITEM(__pyx_t_3, 44, __pyx_n_s_CDLHIGHWAVE); - __Pyx_INCREF(__pyx_n_s_CDLHIKKAKE); - __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKE); - PyList_SET_ITEM(__pyx_t_3, 45, __pyx_n_s_CDLHIKKAKE); - __Pyx_INCREF(__pyx_n_s_CDLHIKKAKEMOD); - __Pyx_GIVEREF(__pyx_n_s_CDLHIKKAKEMOD); - PyList_SET_ITEM(__pyx_t_3, 46, __pyx_n_s_CDLHIKKAKEMOD); - __Pyx_INCREF(__pyx_n_s_CDLHOMINGPIGEON); - __Pyx_GIVEREF(__pyx_n_s_CDLHOMINGPIGEON); - PyList_SET_ITEM(__pyx_t_3, 47, __pyx_n_s_CDLHOMINGPIGEON); - __Pyx_INCREF(__pyx_n_s_CDLIDENTICAL3CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDLIDENTICAL3CROWS); - PyList_SET_ITEM(__pyx_t_3, 48, __pyx_n_s_CDLIDENTICAL3CROWS); - __Pyx_INCREF(__pyx_n_s_CDLINNECK); - __Pyx_GIVEREF(__pyx_n_s_CDLINNECK); - PyList_SET_ITEM(__pyx_t_3, 49, __pyx_n_s_CDLINNECK); - __Pyx_INCREF(__pyx_n_s_CDLINVERTEDHAMMER); - __Pyx_GIVEREF(__pyx_n_s_CDLINVERTEDHAMMER); - PyList_SET_ITEM(__pyx_t_3, 50, __pyx_n_s_CDLINVERTEDHAMMER); - __Pyx_INCREF(__pyx_n_s_CDLKICKING); - __Pyx_GIVEREF(__pyx_n_s_CDLKICKING); - PyList_SET_ITEM(__pyx_t_3, 51, __pyx_n_s_CDLKICKING); - __Pyx_INCREF(__pyx_n_s_CDLKICKINGBYLENGTH); - __Pyx_GIVEREF(__pyx_n_s_CDLKICKINGBYLENGTH); - PyList_SET_ITEM(__pyx_t_3, 52, __pyx_n_s_CDLKICKINGBYLENGTH); - __Pyx_INCREF(__pyx_n_s_CDLLADDERBOTTOM); - __Pyx_GIVEREF(__pyx_n_s_CDLLADDERBOTTOM); - PyList_SET_ITEM(__pyx_t_3, 53, __pyx_n_s_CDLLADDERBOTTOM); - __Pyx_INCREF(__pyx_n_s_CDLLONGLEGGEDDOJI); - __Pyx_GIVEREF(__pyx_n_s_CDLLONGLEGGEDDOJI); - PyList_SET_ITEM(__pyx_t_3, 54, __pyx_n_s_CDLLONGLEGGEDDOJI); - __Pyx_INCREF(__pyx_n_s_CDLLONGLINE); - __Pyx_GIVEREF(__pyx_n_s_CDLLONGLINE); - PyList_SET_ITEM(__pyx_t_3, 55, __pyx_n_s_CDLLONGLINE); - __Pyx_INCREF(__pyx_n_s_CDLMARUBOZU); - __Pyx_GIVEREF(__pyx_n_s_CDLMARUBOZU); - PyList_SET_ITEM(__pyx_t_3, 56, __pyx_n_s_CDLMARUBOZU); - __Pyx_INCREF(__pyx_n_s_CDLMATCHINGLOW); - __Pyx_GIVEREF(__pyx_n_s_CDLMATCHINGLOW); - PyList_SET_ITEM(__pyx_t_3, 57, __pyx_n_s_CDLMATCHINGLOW); - __Pyx_INCREF(__pyx_n_s_CDLMATHOLD); - __Pyx_GIVEREF(__pyx_n_s_CDLMATHOLD); - PyList_SET_ITEM(__pyx_t_3, 58, __pyx_n_s_CDLMATHOLD); - __Pyx_INCREF(__pyx_n_s_CDLMORNINGDOJISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGDOJISTAR); - PyList_SET_ITEM(__pyx_t_3, 59, __pyx_n_s_CDLMORNINGDOJISTAR); - __Pyx_INCREF(__pyx_n_s_CDLMORNINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLMORNINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 60, __pyx_n_s_CDLMORNINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLONNECK); - __Pyx_GIVEREF(__pyx_n_s_CDLONNECK); - PyList_SET_ITEM(__pyx_t_3, 61, __pyx_n_s_CDLONNECK); - __Pyx_INCREF(__pyx_n_s_CDLPIERCING); - __Pyx_GIVEREF(__pyx_n_s_CDLPIERCING); - PyList_SET_ITEM(__pyx_t_3, 62, __pyx_n_s_CDLPIERCING); - __Pyx_INCREF(__pyx_n_s_CDLRICKSHAWMAN); - __Pyx_GIVEREF(__pyx_n_s_CDLRICKSHAWMAN); - PyList_SET_ITEM(__pyx_t_3, 63, __pyx_n_s_CDLRICKSHAWMAN); - __Pyx_INCREF(__pyx_n_s_CDLRISEFALL3METHODS); - __Pyx_GIVEREF(__pyx_n_s_CDLRISEFALL3METHODS); - PyList_SET_ITEM(__pyx_t_3, 64, __pyx_n_s_CDLRISEFALL3METHODS); - __Pyx_INCREF(__pyx_n_s_CDLSEPARATINGLINES); - __Pyx_GIVEREF(__pyx_n_s_CDLSEPARATINGLINES); - PyList_SET_ITEM(__pyx_t_3, 65, __pyx_n_s_CDLSEPARATINGLINES); - __Pyx_INCREF(__pyx_n_s_CDLSHOOTINGSTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLSHOOTINGSTAR); - PyList_SET_ITEM(__pyx_t_3, 66, __pyx_n_s_CDLSHOOTINGSTAR); - __Pyx_INCREF(__pyx_n_s_CDLSHORTLINE); - __Pyx_GIVEREF(__pyx_n_s_CDLSHORTLINE); - PyList_SET_ITEM(__pyx_t_3, 67, __pyx_n_s_CDLSHORTLINE); - __Pyx_INCREF(__pyx_n_s_CDLSPINNINGTOP); - __Pyx_GIVEREF(__pyx_n_s_CDLSPINNINGTOP); - PyList_SET_ITEM(__pyx_t_3, 68, __pyx_n_s_CDLSPINNINGTOP); - __Pyx_INCREF(__pyx_n_s_CDLSTALLEDPATTERN); - __Pyx_GIVEREF(__pyx_n_s_CDLSTALLEDPATTERN); - PyList_SET_ITEM(__pyx_t_3, 69, __pyx_n_s_CDLSTALLEDPATTERN); - __Pyx_INCREF(__pyx_n_s_CDLSTICKSANDWICH); - __Pyx_GIVEREF(__pyx_n_s_CDLSTICKSANDWICH); - PyList_SET_ITEM(__pyx_t_3, 70, __pyx_n_s_CDLSTICKSANDWICH); - __Pyx_INCREF(__pyx_n_s_CDLTAKURI); - __Pyx_GIVEREF(__pyx_n_s_CDLTAKURI); - PyList_SET_ITEM(__pyx_t_3, 71, __pyx_n_s_CDLTAKURI); - __Pyx_INCREF(__pyx_n_s_CDLTASUKIGAP); - __Pyx_GIVEREF(__pyx_n_s_CDLTASUKIGAP); - PyList_SET_ITEM(__pyx_t_3, 72, __pyx_n_s_CDLTASUKIGAP); - __Pyx_INCREF(__pyx_n_s_CDLTHRUSTING); - __Pyx_GIVEREF(__pyx_n_s_CDLTHRUSTING); - PyList_SET_ITEM(__pyx_t_3, 73, __pyx_n_s_CDLTHRUSTING); - __Pyx_INCREF(__pyx_n_s_CDLTRISTAR); - __Pyx_GIVEREF(__pyx_n_s_CDLTRISTAR); - PyList_SET_ITEM(__pyx_t_3, 74, __pyx_n_s_CDLTRISTAR); - __Pyx_INCREF(__pyx_n_s_CDLUNIQUE3RIVER); - __Pyx_GIVEREF(__pyx_n_s_CDLUNIQUE3RIVER); - PyList_SET_ITEM(__pyx_t_3, 75, __pyx_n_s_CDLUNIQUE3RIVER); - __Pyx_INCREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); - __Pyx_GIVEREF(__pyx_n_s_CDLUPSIDEGAP2CROWS); - PyList_SET_ITEM(__pyx_t_3, 76, __pyx_n_s_CDLUPSIDEGAP2CROWS); - __Pyx_INCREF(__pyx_n_s_CDLXSIDEGAP3METHODS); - __Pyx_GIVEREF(__pyx_n_s_CDLXSIDEGAP3METHODS); - PyList_SET_ITEM(__pyx_t_3, 77, __pyx_n_s_CDLXSIDEGAP3METHODS); - __Pyx_INCREF(__pyx_n_s_CEIL); - __Pyx_GIVEREF(__pyx_n_s_CEIL); - PyList_SET_ITEM(__pyx_t_3, 78, __pyx_n_s_CEIL); - __Pyx_INCREF(__pyx_n_s_CMO); - __Pyx_GIVEREF(__pyx_n_s_CMO); - PyList_SET_ITEM(__pyx_t_3, 79, __pyx_n_s_CMO); - __Pyx_INCREF(__pyx_n_s_CORREL); - __Pyx_GIVEREF(__pyx_n_s_CORREL); - PyList_SET_ITEM(__pyx_t_3, 80, __pyx_n_s_CORREL); - __Pyx_INCREF(__pyx_n_s_COS); - __Pyx_GIVEREF(__pyx_n_s_COS); - PyList_SET_ITEM(__pyx_t_3, 81, __pyx_n_s_COS); - __Pyx_INCREF(__pyx_n_s_COSH); - __Pyx_GIVEREF(__pyx_n_s_COSH); - PyList_SET_ITEM(__pyx_t_3, 82, __pyx_n_s_COSH); - __Pyx_INCREF(__pyx_n_s_DEMA); - __Pyx_GIVEREF(__pyx_n_s_DEMA); - PyList_SET_ITEM(__pyx_t_3, 83, __pyx_n_s_DEMA); - __Pyx_INCREF(__pyx_n_s_DIV); - __Pyx_GIVEREF(__pyx_n_s_DIV); - PyList_SET_ITEM(__pyx_t_3, 84, __pyx_n_s_DIV); - __Pyx_INCREF(__pyx_n_s_DX); - __Pyx_GIVEREF(__pyx_n_s_DX); - PyList_SET_ITEM(__pyx_t_3, 85, __pyx_n_s_DX); - __Pyx_INCREF(__pyx_n_s_EMA); - __Pyx_GIVEREF(__pyx_n_s_EMA); - PyList_SET_ITEM(__pyx_t_3, 86, __pyx_n_s_EMA); - __Pyx_INCREF(__pyx_n_s_EXP); - __Pyx_GIVEREF(__pyx_n_s_EXP); - PyList_SET_ITEM(__pyx_t_3, 87, __pyx_n_s_EXP); - __Pyx_INCREF(__pyx_n_s_FLOOR); - __Pyx_GIVEREF(__pyx_n_s_FLOOR); - PyList_SET_ITEM(__pyx_t_3, 88, __pyx_n_s_FLOOR); - __Pyx_INCREF(__pyx_n_s_HT_DCPERIOD); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPERIOD); - PyList_SET_ITEM(__pyx_t_3, 89, __pyx_n_s_HT_DCPERIOD); - __Pyx_INCREF(__pyx_n_s_HT_DCPHASE); - __Pyx_GIVEREF(__pyx_n_s_HT_DCPHASE); - PyList_SET_ITEM(__pyx_t_3, 90, __pyx_n_s_HT_DCPHASE); - __Pyx_INCREF(__pyx_n_s_HT_PHASOR); - __Pyx_GIVEREF(__pyx_n_s_HT_PHASOR); - PyList_SET_ITEM(__pyx_t_3, 91, __pyx_n_s_HT_PHASOR); - __Pyx_INCREF(__pyx_n_s_HT_SINE); - __Pyx_GIVEREF(__pyx_n_s_HT_SINE); - PyList_SET_ITEM(__pyx_t_3, 92, __pyx_n_s_HT_SINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDLINE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDLINE); - PyList_SET_ITEM(__pyx_t_3, 93, __pyx_n_s_HT_TRENDLINE); - __Pyx_INCREF(__pyx_n_s_HT_TRENDMODE); - __Pyx_GIVEREF(__pyx_n_s_HT_TRENDMODE); - PyList_SET_ITEM(__pyx_t_3, 94, __pyx_n_s_HT_TRENDMODE); - __Pyx_INCREF(__pyx_n_s_KAMA); - __Pyx_GIVEREF(__pyx_n_s_KAMA); - PyList_SET_ITEM(__pyx_t_3, 95, __pyx_n_s_KAMA); - __Pyx_INCREF(__pyx_n_s_LINEARREG); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG); - PyList_SET_ITEM(__pyx_t_3, 96, __pyx_n_s_LINEARREG); - __Pyx_INCREF(__pyx_n_s_LINEARREG_ANGLE); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_ANGLE); - PyList_SET_ITEM(__pyx_t_3, 97, __pyx_n_s_LINEARREG_ANGLE); - __Pyx_INCREF(__pyx_n_s_LINEARREG_INTERCEPT); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_INTERCEPT); - PyList_SET_ITEM(__pyx_t_3, 98, __pyx_n_s_LINEARREG_INTERCEPT); - __Pyx_INCREF(__pyx_n_s_LINEARREG_SLOPE); - __Pyx_GIVEREF(__pyx_n_s_LINEARREG_SLOPE); - PyList_SET_ITEM(__pyx_t_3, 99, __pyx_n_s_LINEARREG_SLOPE); - __Pyx_INCREF(__pyx_n_s_LN); - __Pyx_GIVEREF(__pyx_n_s_LN); - PyList_SET_ITEM(__pyx_t_3, 100, __pyx_n_s_LN); - __Pyx_INCREF(__pyx_n_s_LOG10); - __Pyx_GIVEREF(__pyx_n_s_LOG10); - PyList_SET_ITEM(__pyx_t_3, 101, __pyx_n_s_LOG10); - __Pyx_INCREF(__pyx_n_s_MA); - __Pyx_GIVEREF(__pyx_n_s_MA); - PyList_SET_ITEM(__pyx_t_3, 102, __pyx_n_s_MA); - __Pyx_INCREF(__pyx_n_s_MACD); - __Pyx_GIVEREF(__pyx_n_s_MACD); - PyList_SET_ITEM(__pyx_t_3, 103, __pyx_n_s_MACD); - __Pyx_INCREF(__pyx_n_s_MACDEXT); - __Pyx_GIVEREF(__pyx_n_s_MACDEXT); - PyList_SET_ITEM(__pyx_t_3, 104, __pyx_n_s_MACDEXT); - __Pyx_INCREF(__pyx_n_s_MACDFIX); - __Pyx_GIVEREF(__pyx_n_s_MACDFIX); - PyList_SET_ITEM(__pyx_t_3, 105, __pyx_n_s_MACDFIX); - __Pyx_INCREF(__pyx_n_s_MAMA); - __Pyx_GIVEREF(__pyx_n_s_MAMA); - PyList_SET_ITEM(__pyx_t_3, 106, __pyx_n_s_MAMA); - __Pyx_INCREF(__pyx_n_s_MAVP); - __Pyx_GIVEREF(__pyx_n_s_MAVP); - PyList_SET_ITEM(__pyx_t_3, 107, __pyx_n_s_MAVP); - __Pyx_INCREF(__pyx_n_s_MAX); - __Pyx_GIVEREF(__pyx_n_s_MAX); - PyList_SET_ITEM(__pyx_t_3, 108, __pyx_n_s_MAX); - __Pyx_INCREF(__pyx_n_s_MAXINDEX); - __Pyx_GIVEREF(__pyx_n_s_MAXINDEX); - PyList_SET_ITEM(__pyx_t_3, 109, __pyx_n_s_MAXINDEX); - __Pyx_INCREF(__pyx_n_s_MEDPRICE); - __Pyx_GIVEREF(__pyx_n_s_MEDPRICE); - PyList_SET_ITEM(__pyx_t_3, 110, __pyx_n_s_MEDPRICE); - __Pyx_INCREF(__pyx_n_s_MFI); - __Pyx_GIVEREF(__pyx_n_s_MFI); - PyList_SET_ITEM(__pyx_t_3, 111, __pyx_n_s_MFI); - __Pyx_INCREF(__pyx_n_s_MIDPOINT); - __Pyx_GIVEREF(__pyx_n_s_MIDPOINT); - PyList_SET_ITEM(__pyx_t_3, 112, __pyx_n_s_MIDPOINT); - __Pyx_INCREF(__pyx_n_s_MIDPRICE); - __Pyx_GIVEREF(__pyx_n_s_MIDPRICE); - PyList_SET_ITEM(__pyx_t_3, 113, __pyx_n_s_MIDPRICE); - __Pyx_INCREF(__pyx_n_s_MIN); - __Pyx_GIVEREF(__pyx_n_s_MIN); - PyList_SET_ITEM(__pyx_t_3, 114, __pyx_n_s_MIN); - __Pyx_INCREF(__pyx_n_s_MININDEX); - __Pyx_GIVEREF(__pyx_n_s_MININDEX); - PyList_SET_ITEM(__pyx_t_3, 115, __pyx_n_s_MININDEX); - __Pyx_INCREF(__pyx_n_s_MINMAX); - __Pyx_GIVEREF(__pyx_n_s_MINMAX); - PyList_SET_ITEM(__pyx_t_3, 116, __pyx_n_s_MINMAX); - __Pyx_INCREF(__pyx_n_s_MINMAXINDEX); - __Pyx_GIVEREF(__pyx_n_s_MINMAXINDEX); - PyList_SET_ITEM(__pyx_t_3, 117, __pyx_n_s_MINMAXINDEX); - __Pyx_INCREF(__pyx_n_s_MINUS_DI); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DI); - PyList_SET_ITEM(__pyx_t_3, 118, __pyx_n_s_MINUS_DI); - __Pyx_INCREF(__pyx_n_s_MINUS_DM); - __Pyx_GIVEREF(__pyx_n_s_MINUS_DM); - PyList_SET_ITEM(__pyx_t_3, 119, __pyx_n_s_MINUS_DM); - __Pyx_INCREF(__pyx_n_s_MOM); - __Pyx_GIVEREF(__pyx_n_s_MOM); - PyList_SET_ITEM(__pyx_t_3, 120, __pyx_n_s_MOM); - __Pyx_INCREF(__pyx_n_s_MULT); - __Pyx_GIVEREF(__pyx_n_s_MULT); - PyList_SET_ITEM(__pyx_t_3, 121, __pyx_n_s_MULT); - __Pyx_INCREF(__pyx_n_s_NATR); - __Pyx_GIVEREF(__pyx_n_s_NATR); - PyList_SET_ITEM(__pyx_t_3, 122, __pyx_n_s_NATR); - __Pyx_INCREF(__pyx_n_s_OBV); - __Pyx_GIVEREF(__pyx_n_s_OBV); - PyList_SET_ITEM(__pyx_t_3, 123, __pyx_n_s_OBV); - __Pyx_INCREF(__pyx_n_s_PLUS_DI); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DI); - PyList_SET_ITEM(__pyx_t_3, 124, __pyx_n_s_PLUS_DI); - __Pyx_INCREF(__pyx_n_s_PLUS_DM); - __Pyx_GIVEREF(__pyx_n_s_PLUS_DM); - PyList_SET_ITEM(__pyx_t_3, 125, __pyx_n_s_PLUS_DM); - __Pyx_INCREF(__pyx_n_s_PPO); - __Pyx_GIVEREF(__pyx_n_s_PPO); - PyList_SET_ITEM(__pyx_t_3, 126, __pyx_n_s_PPO); - __Pyx_INCREF(__pyx_n_s_ROC); - __Pyx_GIVEREF(__pyx_n_s_ROC); - PyList_SET_ITEM(__pyx_t_3, 127, __pyx_n_s_ROC); - __Pyx_INCREF(__pyx_n_s_ROCP); - __Pyx_GIVEREF(__pyx_n_s_ROCP); - PyList_SET_ITEM(__pyx_t_3, 128, __pyx_n_s_ROCP); - __Pyx_INCREF(__pyx_n_s_ROCR); - __Pyx_GIVEREF(__pyx_n_s_ROCR); - PyList_SET_ITEM(__pyx_t_3, 129, __pyx_n_s_ROCR); - __Pyx_INCREF(__pyx_n_s_ROCR100); - __Pyx_GIVEREF(__pyx_n_s_ROCR100); - PyList_SET_ITEM(__pyx_t_3, 130, __pyx_n_s_ROCR100); - __Pyx_INCREF(__pyx_n_s_RSI); - __Pyx_GIVEREF(__pyx_n_s_RSI); - PyList_SET_ITEM(__pyx_t_3, 131, __pyx_n_s_RSI); - __Pyx_INCREF(__pyx_n_s_SAR); - __Pyx_GIVEREF(__pyx_n_s_SAR); - PyList_SET_ITEM(__pyx_t_3, 132, __pyx_n_s_SAR); - __Pyx_INCREF(__pyx_n_s_SAREXT); - __Pyx_GIVEREF(__pyx_n_s_SAREXT); - PyList_SET_ITEM(__pyx_t_3, 133, __pyx_n_s_SAREXT); - __Pyx_INCREF(__pyx_n_s_SIN); - __Pyx_GIVEREF(__pyx_n_s_SIN); - PyList_SET_ITEM(__pyx_t_3, 134, __pyx_n_s_SIN); - __Pyx_INCREF(__pyx_n_s_SINH); - __Pyx_GIVEREF(__pyx_n_s_SINH); - PyList_SET_ITEM(__pyx_t_3, 135, __pyx_n_s_SINH); - __Pyx_INCREF(__pyx_n_s_SMA); - __Pyx_GIVEREF(__pyx_n_s_SMA); - PyList_SET_ITEM(__pyx_t_3, 136, __pyx_n_s_SMA); - __Pyx_INCREF(__pyx_n_s_SQRT); - __Pyx_GIVEREF(__pyx_n_s_SQRT); - PyList_SET_ITEM(__pyx_t_3, 137, __pyx_n_s_SQRT); - __Pyx_INCREF(__pyx_n_s_STDDEV); - __Pyx_GIVEREF(__pyx_n_s_STDDEV); - PyList_SET_ITEM(__pyx_t_3, 138, __pyx_n_s_STDDEV); - __Pyx_INCREF(__pyx_n_s_STOCH); - __Pyx_GIVEREF(__pyx_n_s_STOCH); - PyList_SET_ITEM(__pyx_t_3, 139, __pyx_n_s_STOCH); - __Pyx_INCREF(__pyx_n_s_STOCHF); - __Pyx_GIVEREF(__pyx_n_s_STOCHF); - PyList_SET_ITEM(__pyx_t_3, 140, __pyx_n_s_STOCHF); - __Pyx_INCREF(__pyx_n_s_STOCHRSI); - __Pyx_GIVEREF(__pyx_n_s_STOCHRSI); - PyList_SET_ITEM(__pyx_t_3, 141, __pyx_n_s_STOCHRSI); - __Pyx_INCREF(__pyx_n_s_SUB); - __Pyx_GIVEREF(__pyx_n_s_SUB); - PyList_SET_ITEM(__pyx_t_3, 142, __pyx_n_s_SUB); - __Pyx_INCREF(__pyx_n_s_SUM); - __Pyx_GIVEREF(__pyx_n_s_SUM); - PyList_SET_ITEM(__pyx_t_3, 143, __pyx_n_s_SUM); - __Pyx_INCREF(__pyx_n_s_T3); - __Pyx_GIVEREF(__pyx_n_s_T3); - PyList_SET_ITEM(__pyx_t_3, 144, __pyx_n_s_T3); - __Pyx_INCREF(__pyx_n_s_TAN); - __Pyx_GIVEREF(__pyx_n_s_TAN); - PyList_SET_ITEM(__pyx_t_3, 145, __pyx_n_s_TAN); - __Pyx_INCREF(__pyx_n_s_TANH); - __Pyx_GIVEREF(__pyx_n_s_TANH); - PyList_SET_ITEM(__pyx_t_3, 146, __pyx_n_s_TANH); - __Pyx_INCREF(__pyx_n_s_TEMA); - __Pyx_GIVEREF(__pyx_n_s_TEMA); - PyList_SET_ITEM(__pyx_t_3, 147, __pyx_n_s_TEMA); - __Pyx_INCREF(__pyx_n_s_TRANGE); - __Pyx_GIVEREF(__pyx_n_s_TRANGE); - PyList_SET_ITEM(__pyx_t_3, 148, __pyx_n_s_TRANGE); - __Pyx_INCREF(__pyx_n_s_TRIMA); - __Pyx_GIVEREF(__pyx_n_s_TRIMA); - PyList_SET_ITEM(__pyx_t_3, 149, __pyx_n_s_TRIMA); - __Pyx_INCREF(__pyx_n_s_TRIX); - __Pyx_GIVEREF(__pyx_n_s_TRIX); - PyList_SET_ITEM(__pyx_t_3, 150, __pyx_n_s_TRIX); - __Pyx_INCREF(__pyx_n_s_TSF); - __Pyx_GIVEREF(__pyx_n_s_TSF); - PyList_SET_ITEM(__pyx_t_3, 151, __pyx_n_s_TSF); - __Pyx_INCREF(__pyx_n_s_TYPPRICE); - __Pyx_GIVEREF(__pyx_n_s_TYPPRICE); - PyList_SET_ITEM(__pyx_t_3, 152, __pyx_n_s_TYPPRICE); - __Pyx_INCREF(__pyx_n_s_ULTOSC); - __Pyx_GIVEREF(__pyx_n_s_ULTOSC); - PyList_SET_ITEM(__pyx_t_3, 153, __pyx_n_s_ULTOSC); - __Pyx_INCREF(__pyx_n_s_VAR); - __Pyx_GIVEREF(__pyx_n_s_VAR); - PyList_SET_ITEM(__pyx_t_3, 154, __pyx_n_s_VAR); - __Pyx_INCREF(__pyx_n_s_WCLPRICE); - __Pyx_GIVEREF(__pyx_n_s_WCLPRICE); - PyList_SET_ITEM(__pyx_t_3, 155, __pyx_n_s_WCLPRICE); - __Pyx_INCREF(__pyx_n_s_WILLR); - __Pyx_GIVEREF(__pyx_n_s_WILLR); - PyList_SET_ITEM(__pyx_t_3, 156, __pyx_n_s_WILLR); - __Pyx_INCREF(__pyx_n_s_WMA); - __Pyx_GIVEREF(__pyx_n_s_WMA); - PyList_SET_ITEM(__pyx_t_3, 157, __pyx_n_s_WMA); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 8076, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "talib/stream.pyx":1 - * cimport numpy as np # <<<<<<<<<<<<<< - * from numpy import nan - * from cython import boundscheck, wraparound - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init talib.stream", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init talib.stream"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); - case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); - case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_absf(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); - case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); - case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_abs(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -/* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); - if (!d) - goto bad; - cobj = PyDict_GetItemString(d, funcname); - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C function %.200s", - PyModule_GetName(module), funcname); - goto bad; - } -#if PY_VERSION_HEX >= 0x02070000 - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); -#else - {const char *desc, *s1, *s2; - desc = (const char *)PyCObject_GetDesc(cobj); - if (!desc) - goto bad; - s1 = desc; s2 = sig; - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - if (*s1 != *s2) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, desc); - goto bad; - } - tmp.p = PyCObject_AsVoidPtr(cobj);} -#endif - *f = tmp.fp; - if (!(*f)) - goto bad; - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(d); - return -1; -} -#endif - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ From 23b3dfc1549718d3a15e9bcdde066206636ae45c Mon Sep 17 00:00:00 2001 From: mckelvin Date: Sat, 4 Feb 2017 12:23:42 +0800 Subject: [PATCH 3/3] tools: Update scripts for generating code --- .gitignore | 4 +++- DEVELOPMENT | 24 ++++++++++++------------ Makefile | 11 +++++++++-- talib/_abstract.pxi | 2 -- talib/abstract.py | 2 +- tools/generate_func.py | 9 ++++----- tools/generate_stream.py | 24 +++++------------------- 7 files changed, 34 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index aa4d524e5..49ddb78e1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,10 @@ docs/html docs/.tadoc.org.html *.pyc -build +build/ +dist/ *.so .* *~ +*.egg-info/ diff --git a/DEVELOPMENT b/DEVELOPMENT index 6be2ee04e..fd29fec0e 100644 --- a/DEVELOPMENT +++ b/DEVELOPMENT @@ -12,34 +12,34 @@ Here's the full list of make commands (see the Makefile file): make build # builds and places libs in the project directory; required for testing make clean # cleans the local build files make install # installs talib system-wide -make generate: # generates a fresh func.pyx file. Requires talib and TA-Lib to both be installed +make generate: # generates a fresh _func.pxi, _stream.pxi file. Requires talib and TA-Lib to both be installed make perf # run performance profiling make test # run tests The source code is comprised of one python package, located in the talib -directory, which itself has three Cython modules: func, abstract, and -common. +directory, which itself has one Cython module (_ta_lib) which consists of +four parts: _common, _func, _abstract and _stream. -talib/common.pyx - An internal-use module for functionality shared between func and abstract. +talib/_common.pxi + An internal-use file for functionality shared between func and abstract. -talib/func.pyx - This file is generated automatically by tools/generate.py and any changes made +talib/_func.pxi + This file is generated automatically by tools/generate_func.py and any changes made to it directly will get overwritten! -talib/abstract.pyx +talib/_abstract.pxi This file contains the code for interfacing with the TA-Lib abstract interface and wrapping it into a pythonic Function class. -talib/libta_lib.pxd +talib/_ta_lib.pyx This "Cython header file" defines the C-level functions, variables and types we need to use in the above pyx files. -talib/stream.pyx +talib/_stream.pxi This file contains code for interfacing a "streaming" interface to TA-Lib. -tools/generate.py - A script that generates and prints func.pyx to stdout. Gets information +tools/generate_func.py,generate_stream.py + Scripts that generate and print _func.pxi or _stream.pxi to stdout. Gets information about all functions from the C headers of the installed TA-Lib. If you are interested in developing new indicator functions or whatnot on diff --git a/Makefile b/Makefile index c0897ad01..5c02a15b4 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,18 @@ +.PHONY: build + build: python setup.py build_ext --inplace install: python setup.py install -generate: - python tools/generate_func.py > talib/func.pyx +talib/_func.pxi: tools/generate_func.py + python tools/generate_func.py > talib/_func.pxi + +talib/_stream.pxi: tools/generate_stream.py + python tools/generate_stream.py > talib/_stream.pxi + +generate: talib/_func.pxi talib/_stream.pxi clean: rm -rf build talib/func*.so talib/abstract*.so talib/common*.so talib/stream*.so talib/*.pyc diff --git a/talib/_abstract.pxi b/talib/_abstract.pxi index 1d27a6a7e..8b6ef41b7 100644 --- a/talib/_abstract.pxi +++ b/talib/_abstract.pxi @@ -14,8 +14,6 @@ cimport numpy as np cimport _ta_lib as lib # NOTE: _ta_check_success, MA_Type is defined in _common.pxi -lib.TA_Initialize() - __INPUT_ARRAYS_DEFAULTS = {'open': None, 'high': None, diff --git a/talib/abstract.py b/talib/abstract.py index 5ab26d37b..87a9e2790 100644 --- a/talib/abstract.py +++ b/talib/abstract.py @@ -22,4 +22,4 @@ def Function(function_name, *args, **kwargs): globals()[func_name] = Function(func_name) -__all__ = ["Function"] + __TA_FUNCTION_NAMES__ +__all__ = ["Function", "_get_defaults_and_docs"] + __TA_FUNCTION_NAMES__ diff --git a/tools/generate_func.py b/tools/generate_func.py index 35e0a78d7..61cc82896 100644 --- a/tools/generate_func.py +++ b/tools/generate_func.py @@ -51,7 +51,7 @@ from numpy import nan from cython import boundscheck, wraparound -from .common cimport _ta_check_success +# _ta_check_success: defined in _common.pxi cdef double NaN = nan @@ -63,10 +63,9 @@ np.import_array() # Initialize the NumPy C API -cimport libta_lib as lib -from libta_lib cimport TA_RetCode +cimport _ta_lib as lib +from _ta_lib cimport TA_RetCode -lib.TA_Initialize() """) # cleanup variable names to make them more pythonic @@ -338,4 +337,4 @@ def cleanup(name): print('') print('') -print('__all__ = [%s]' % ','.join(['\"%s\"' % name for name in names])) +print('__TA_FUNCTION_NAMES__ = [%s]' % ','.join(['\"%s\"' % name for name in names])) diff --git a/tools/generate_stream.py b/tools/generate_stream.py index 86509b4c2..48df55b6f 100644 --- a/tools/generate_stream.py +++ b/tools/generate_stream.py @@ -48,25 +48,12 @@ # print headers print("""\ cimport numpy as np -from numpy import nan from cython import boundscheck, wraparound +cimport _ta_lib as lib +from _ta_lib cimport TA_RetCode +# NOTE: _ta_check_success, NaN are defined in common.pxi +# NumPy C API is initialize in _func.pxi -from .common cimport _ta_check_success - -cdef double NaN = nan - -cdef extern from "numpy/arrayobject.h": - int PyArray_TYPE(np.ndarray) - object PyArray_EMPTY(int, np.npy_intp*, int, int) - int PyArray_FLAGS(np.ndarray) - object PyArray_GETCONTIGUOUS(np.ndarray) - -np.import_array() # Initialize the NumPy C API - -cimport libta_lib as lib -from libta_lib cimport TA_RetCode - -lib.TA_Initialize() """) # cleanup variable names to make them more pythonic @@ -96,7 +83,7 @@ def cleanup(name): print('@wraparound(False) # turn off relative indexing from end of lists') print('@boundscheck(False) # turn off bounds-checking for entire function') - print('def %s(' % shortname, end=' ') + print('def stream_%s(' % shortname, end=' ') docs = [' %s(' % shortname] i = 0 for arg in args: @@ -302,4 +289,3 @@ def cleanup(name): print('') print('') -print('__all__ = [%s]' % ','.join(['\"%s\"' % name for name in names]))